Mercurial > dotfiles
changeset 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 | 3e8f6dbbbe31 |
children | 2e0fbe44e9fe |
files | .hgignore .hgsub vim/vimrc |
diffstat | 3 files changed, 55 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgignore Fri Mar 09 20:44:10 2012 -0800 +++ b/.hgignore Wed Mar 14 11:33:52 2012 -0700 @@ -1,6 +1,7 @@ syntax:glob temp/* backup/* +cache/* .netrwhist hgrc/hgrc-local
--- a/.hgsub Fri Mar 09 20:44:10 2012 -0800 +++ b/.hgsub Wed Mar 14 11:33:52 2012 -0700 @@ -3,6 +3,9 @@ vim/bundle/badwolf = https://bitbucket.org/sjl/badwolf vim/bundle/colorschemes = [git]https://github.com/flazz/vim-colorschemes.git +vim/bundle/ctrlp = [git]https://github.com/kien/ctrlp.vim.git +vim/bundle/easymotion = [git]https://github.com/Lokaltog/vim-easymotion.git +vim/bundle/powerline = [git]https://github.com/Lokaltog/vim-powerline.git vim/bundle/markdown = [git]https://github.com/tpope/vim-markdown.git vim/bundle/surround = [git]https://github.com/tpope/vim-surround.git vim/bundle/commentary = [git]git://github.com/tpope/vim-commentary.git
--- a/vim/vimrc Fri Mar 09 20:44:10 2012 -0800 +++ b/vim/vimrc Wed Mar 14 11:33:52 2012 -0700 @@ -119,7 +119,7 @@ " Better command-line completion, but don't show some " stuff we don't care about. set wildmenu -set wildignore+=.DS_Store,Thumbs.db +set wildignore+=.DS_Store,Thumbs.db,*.so,*.dll,*.exe " Always display the tab-page line. set showtabline=2 @@ -155,6 +155,9 @@ " Folds are defined by markers in the text. set foldmethod=marker +" Nice auto-complete menu. +set completeopt=longest,menuone,preview + " And now, for some system-dependent settings: " - font to use if $PLATFORM == "windows" @@ -198,8 +201,20 @@ " Plugin Settings {{{ -" Navigate MiniBufExplorer with CTRL+Tab/CTRL+Shift+Tab. -let g:miniBufExplMapCTabSwitchBufs = 1 +" We'll set our own mappings. +let g:ctrlp_map = '' + +" Ctrl-P should manage the working directory. +let g:ctrlp_working_path_mode = 2 + +" Ctrl-P should however ignore some stuff. +let g:ctrlp_custom_ignore = { + \ 'dir': '\.git$\|\.hg$\|\.svn$', + \ 'file': '\.exe$\|\.so$\|\.dll$' + \ } + +" Make Ctrl-P cache stuff in our temp directory. +let g:ctrlp_cache_dir = '~/'.$HOMEVIM.'/cache' " }}} @@ -220,18 +235,44 @@ noremap <home> g<home> noremap <end> g<end> +" Buffer navigation +noremap <C-Tab> :bnext<cr> +noremap <C-S-Tab> :bprevious<cr> + +" Window navigation +nnoremap <C-up> :wincmd k<cr> +nnoremap <C-down> :wincmd j<cr> +nnoremap <C-left> :wincmd h<cr> +nnoremap <C-right> :wincmd l<cr> + +" Split windows +nnoremap <leader>s :split<cr> +nnoremap <leader>v :vsplit<cr> + " Edit & source the VIMRC. nnoremap <leader>ev :vsplit $MYVIMRC<cr> nnoremap <leader>sv :source $MYVIMRC<cr> -" MiniBufExplorer mappings. -nnoremap <F2> :TMiniBufExplorer<cr> +" Easier things to type +nnoremap <leader>w :w<cr> +nnoremap <leader>q :q<cr> + +" Toggle invisible characters +nnoremap <leader>i :set list!<cr> + +" Clear search matches +nnoremap <leader><space> :noh<cr>:call clearmatches()<cr> " Open NERDtree. -nnoremap <F3> :NERDTreeToggle<cr> +nnoremap <F2> :NERDTreeToggle<cr> " Switch buffers. -nnoremap <F4> :execute ("buffer " . bufname("#"))<cr> +nnoremap <F3> :execute ("buffer " . bufname("#"))<cr> + +" Ctrl-P mappings. +nnoremap <silent> <C-p> :CtrlP<cr> +nnoremap <silent> <C-b> :CtrlPBuffer<cr> +nnoremap <silent> <C-m> :CtrlPMRU<cr> " Switch between FR and US keyboard layouts. nnoremap <leader>fr :setlocal keymap=french<cr> @@ -249,6 +290,9 @@ " Create folds with <space> (in visual mode) vnoremap <space> zf +" File-type switching +nnoremap <leader>ftmd :set ft=markdown<CR> + " }}} " Abbreviations {{{