Mercurial > dotfiles
comparison vim/vimrc @ 80:121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Wed, 14 Mar 2012 11:33:52 -0700 |
parents | 990968329a9b |
children | a54180045075 |
comparison
equal
deleted
inserted
replaced
79:3e8f6dbbbe31 | 80:121bef55252f |
---|---|
117 set directory=~/$HOMEVIM/temp | 117 set directory=~/$HOMEVIM/temp |
118 | 118 |
119 " Better command-line completion, but don't show some | 119 " Better command-line completion, but don't show some |
120 " stuff we don't care about. | 120 " stuff we don't care about. |
121 set wildmenu | 121 set wildmenu |
122 set wildignore+=.DS_Store,Thumbs.db | 122 set wildignore+=.DS_Store,Thumbs.db,*.so,*.dll,*.exe |
123 | 123 |
124 " Always display the tab-page line. | 124 " Always display the tab-page line. |
125 set showtabline=2 | 125 set showtabline=2 |
126 | 126 |
127 " Set the file-formats. | 127 " Set the file-formats. |
153 set whichwrap+=<,>,h,l | 153 set whichwrap+=<,>,h,l |
154 | 154 |
155 " Folds are defined by markers in the text. | 155 " Folds are defined by markers in the text. |
156 set foldmethod=marker | 156 set foldmethod=marker |
157 | 157 |
158 " Nice auto-complete menu. | |
159 set completeopt=longest,menuone,preview | |
160 | |
158 " And now, for some system-dependent settings: | 161 " And now, for some system-dependent settings: |
159 " - font to use | 162 " - font to use |
160 if $PLATFORM == "windows" | 163 if $PLATFORM == "windows" |
161 set guifont=Consolas:h12 | 164 set guifont=Consolas:h12 |
162 else | 165 else |
196 | 199 |
197 " }}} | 200 " }}} |
198 | 201 |
199 " Plugin Settings {{{ | 202 " Plugin Settings {{{ |
200 | 203 |
201 " Navigate MiniBufExplorer with CTRL+Tab/CTRL+Shift+Tab. | 204 " We'll set our own mappings. |
202 let g:miniBufExplMapCTabSwitchBufs = 1 | 205 let g:ctrlp_map = '' |
206 | |
207 " Ctrl-P should manage the working directory. | |
208 let g:ctrlp_working_path_mode = 2 | |
209 | |
210 " Ctrl-P should however ignore some stuff. | |
211 let g:ctrlp_custom_ignore = { | |
212 \ 'dir': '\.git$\|\.hg$\|\.svn$', | |
213 \ 'file': '\.exe$\|\.so$\|\.dll$' | |
214 \ } | |
215 | |
216 " Make Ctrl-P cache stuff in our temp directory. | |
217 let g:ctrlp_cache_dir = '~/'.$HOMEVIM.'/cache' | |
203 | 218 |
204 " }}} | 219 " }}} |
205 | 220 |
206 " File-Specific Settings {{{ | 221 " File-Specific Settings {{{ |
207 | 222 |
218 noremap <up> g<up> | 233 noremap <up> g<up> |
219 noremap <down> g<down> | 234 noremap <down> g<down> |
220 noremap <home> g<home> | 235 noremap <home> g<home> |
221 noremap <end> g<end> | 236 noremap <end> g<end> |
222 | 237 |
238 " Buffer navigation | |
239 noremap <C-Tab> :bnext<cr> | |
240 noremap <C-S-Tab> :bprevious<cr> | |
241 | |
242 " Window navigation | |
243 nnoremap <C-up> :wincmd k<cr> | |
244 nnoremap <C-down> :wincmd j<cr> | |
245 nnoremap <C-left> :wincmd h<cr> | |
246 nnoremap <C-right> :wincmd l<cr> | |
247 | |
248 " Split windows | |
249 nnoremap <leader>s :split<cr> | |
250 nnoremap <leader>v :vsplit<cr> | |
251 | |
223 " Edit & source the VIMRC. | 252 " Edit & source the VIMRC. |
224 nnoremap <leader>ev :vsplit $MYVIMRC<cr> | 253 nnoremap <leader>ev :vsplit $MYVIMRC<cr> |
225 nnoremap <leader>sv :source $MYVIMRC<cr> | 254 nnoremap <leader>sv :source $MYVIMRC<cr> |
226 | 255 |
227 " MiniBufExplorer mappings. | 256 " Easier things to type |
228 nnoremap <F2> :TMiniBufExplorer<cr> | 257 nnoremap <leader>w :w<cr> |
258 nnoremap <leader>q :q<cr> | |
259 | |
260 " Toggle invisible characters | |
261 nnoremap <leader>i :set list!<cr> | |
262 | |
263 " Clear search matches | |
264 nnoremap <leader><space> :noh<cr>:call clearmatches()<cr> | |
229 | 265 |
230 " Open NERDtree. | 266 " Open NERDtree. |
231 nnoremap <F3> :NERDTreeToggle<cr> | 267 nnoremap <F2> :NERDTreeToggle<cr> |
232 | 268 |
233 " Switch buffers. | 269 " Switch buffers. |
234 nnoremap <F4> :execute ("buffer " . bufname("#"))<cr> | 270 nnoremap <F3> :execute ("buffer " . bufname("#"))<cr> |
271 | |
272 " Ctrl-P mappings. | |
273 nnoremap <silent> <C-p> :CtrlP<cr> | |
274 nnoremap <silent> <C-b> :CtrlPBuffer<cr> | |
275 nnoremap <silent> <C-m> :CtrlPMRU<cr> | |
235 | 276 |
236 " Switch between FR and US keyboard layouts. | 277 " Switch between FR and US keyboard layouts. |
237 nnoremap <leader>fr :setlocal keymap=french<cr> | 278 nnoremap <leader>fr :setlocal keymap=french<cr> |
238 nnoremap <leader>us :setlocal keymap=<cr> | 279 nnoremap <leader>us :setlocal keymap=<cr> |
239 | 280 |
246 " Toggle folds with <space> | 287 " Toggle folds with <space> |
247 nnoremap <space> za | 288 nnoremap <space> za |
248 | 289 |
249 " Create folds with <space> (in visual mode) | 290 " Create folds with <space> (in visual mode) |
250 vnoremap <space> zf | 291 vnoremap <space> zf |
292 | |
293 " File-type switching | |
294 nnoremap <leader>ftmd :set ft=markdown<CR> | |
251 | 295 |
252 " }}} | 296 " }}} |
253 | 297 |
254 " Abbreviations {{{ | 298 " Abbreviations {{{ |
255 | 299 |