aboutsummaryrefslogtreecommitdiff
path: root/vim/.vimrc
blob: 7a8cde103cd5be43bcb806d1359b0af4df394111 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
call plug#begin('~/.vim/plugins')

Plug 'ctrlpvim/ctrlp.vim'                  " fuzzy file, ctag search
Plug 'scrooloose/nerdtree'                 " nicer file browser with sidebar support
Plug 'simnalamburt/vim-mundo'              " visualize undo tree
Plug 'vim-airline/vim-airline'             " better status bar
Plug 'vim-airline/vim-airline-themes'      " airline themes
Plug 'tpope/vim-unimpaired'                " bracket mappings
Plug 'airblade/vim-gitgutter'              " display git diffs alongside line numbers
Plug 'qpkorr/vim-renamer'                  " file renaming utility
Plug 'vim-pandoc/vim-pandoc'               " `pandoc` integration
Plug 'vim-pandoc/vim-pandoc-syntax'        " `pandoc` syntax module
Plug 'junegunn/goyo.vim'                   " distraction free writing mode
Plug 'elmanuelito/vim-matlab-behave'       " add basic matlab support
Plug 'vim-latex/vim-latex'                 " latex integration, main usecase for me is the concealment of math expressions
Plug 'Chiel92/vim-autoformat'              " autoformatting integration
Plug 'majutsushi/tagbar'                   " display ctag tree in sidebar
Plug 'godlygeek/tabular'                   " text alignment helper
Plug 'MarcWeber/vim-addon-local-vimrc'     " folder specific vim configuration
Plug 'nathanaelkane/vim-indent-guides'     " pretty indentations
Plug 'octol/vim-cpp-enhanced-highlight'    " better C++ highlighting
Plug 'easymotion/vim-easymotion'           " visual motion help
Plug 'haya14busa/incsearch.vim'            " visual incremental search
Plug 'haya14busa/incsearch-easymotion.vim' " intergration of incsearch and easymotion
Plug 'yegappan/greplace'                   " global interactive replace

call plug#end()

syntax enable
filetype plugin indent on

set encoding=utf-8
set showcmd
set nocompatible
set nocursorline
set number
set lazyredraw
set ttyfast
set mouse=a
set t_Co=256
set background=dark
set shell=/bin/sh
set sessionoptions-=options

colorscheme jellybeans

set directory=~/.vim/swap//,.

set wrap
set tabstop=4 shiftwidth=4
set backspace=indent,eol,start
set listchars=tab:\ \ 
set list
set linebreak

set hlsearch
set incsearch
set ignorecase
set smartcase

let mapleader=","

map <leader>s  :let @/=""<CR>
map <leader>t  :Tab/\|<CR>
map <leader>c  zz
map <leader>d  <c-]>
map <leader>f <Plug>(incsearch-easymotion-/)

nmap <backspace> :e#<CR>
nmap f           za
nmap F           zA

autocmd InsertEnter *      :setlocal nohlsearch
autocmd InsertLeave *      :setlocal hlsearch

" redraw wiki instance when managed via e.g. _i3wm scratch buffer_
autocmd FocusGained *.wiki :redraw!
autocmd BufRead,BufNewFile *.wiki set filetype=pandoc
autocmd BufReadPre,FileReadPre,BufNewFile * :SourceLocalVimrc

autocmd FileType scheme  setlocal shiftwidth=2 tabstop=2 expandtab
autocmd FileType lisp    setlocal shiftwidth=2 tabstop=2 expandtab
autocmd FileType racket  setlocal shiftwidth=2 tabstop=2 expandtab
autocmd FileType pandoc  setlocal nonumber autoread
autocmd FileType pandoc  let      g:airline#extensions#whitespace#checks=['indent', 'trailing', 'long']
autocmd FileType tex     set      conceallevel=2

vnoremap cc "+y
nnoremap cc "+p

nnoremap <C-left> gT
nnoremap <C-right> gt
nnoremap <space> @q
nnoremap J }
nnoremap K {

nmap <Left> <<
nmap <Right> >>
vmap <Left> <gv
vmap <Right> >gv

nmap <Up> [e
nmap <Down> ]e
vmap <Up> [egv
vmap <Down> ]egv

nnoremap <A-left> <C-W>h
nnoremap <A-right> <C-W>l
nnoremap <A-up> <C-W>k
nnoremap <A-down> <C-W>j

set laststatus=2
let g:airline#extensions#tabline#enabled              = 1
let g:airline#extensions#tabline#show_buffers         = 0
let g:airline#extensions#tabline#show_tab_type        = 0
let g:airline#extensions#tabline#formatter            = 'unique_tail_improved'
let g:airline#extensions#tabline#buffer_idx_mode      = 0
let g:airline#extensions#tabline#left_sep             = ''
let g:airline#extensions#tabline#left_alt_sep         = ''
let g:airline#extensions#tabline#right_sep            = ''
let g:airline#extensions#tabline#right_alt_sep        = ''
let g:airline#extensions#tabline#show_close_button    = 0
let g:airline#extensions#tabline#show_splits          = 0
let g:airline#extensions#tabline#show_tab_nr          = 0
let g:airline#extensions#whitespace#mixed_indent_algo = 2

let g:gitgutter_enabled         = 0
let g:gitgutter_highlight_lines = 1
let g:goyo_width                = 90
let g:goyo_margin_top           = 1
let g:goyo_margin_bottom        = 0
let g:matlab_behave_paste_cmd   = "alt+v"

nnoremap <F4>  :NERDTreeToggle<CR>
nnoremap <F5>  :MundoToggle<CR>
nnoremap <F6>  :GitGutterToggle<CR>
nnoremap <F7>  :set cursorline!<CR>
nnoremap <F8>  :TagbarToggle<CR>
nnoremap <F12> :Goyo<CR>

" indent guides
let g:indent_guides_space_guides = 0

" ctrlp file opener
nnoremap <c-b> :CtrlPBuffer<CR>
nnoremap <c-t> :CtrlPTag<CR>
nnoremap <a-t> :CtrlPBufTag<CR>

let g:ctrlp_custom_ignore = {
\ 'dir':  '\.git$',
\ 'file': '\.o$\|\.d$'
\ }

" tagbar
let g:tagbar_autoclose      = 1
let g:tagbar_autopreview    = 1
let g:tagbar_compact        = 1
let g:tagbar_width          = 70

" pandoc
let g:pandoc#modules#disabled = ["folding","spell","chdir"]
let g:pandoc#syntax#conceal#blacklist = ["image","atx"]
let g:pandoc#syntax#codeblocks#embeds#langs = ["c","cpp","sh","xslt","xml","python","php","diff","gdb","lisp","scheme","asm"]

" latex suite
set grepprg=grep\ -nH\ $*
let g:tex_flavor = "latex"
let g:Imap_UsePlaceHolders = 0
let g:Tex_PromptedEnvironments = ''