# HG changeset patch # User Ludovic Chabant # Date 1331750032 25200 # Node ID 121bef55252fc69a62c482032ec82a115c8ae5d0 # Parent 3e8f6dbbbe31b13b09d730a38a33cde9086183c6 Added more VIM plugins (ctrlp, easymotion, powerline). diff -r 3e8f6dbbbe31 -r 121bef55252f .hgignore --- 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 diff -r 3e8f6dbbbe31 -r 121bef55252f .hgsub --- 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 diff -r 3e8f6dbbbe31 -r 121bef55252f vim/vimrc --- 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 g noremap g +" Buffer navigation +noremap :bnext +noremap :bprevious + +" Window navigation +nnoremap :wincmd k +nnoremap :wincmd j +nnoremap :wincmd h +nnoremap :wincmd l + +" Split windows +nnoremap s :split +nnoremap v :vsplit + " Edit & source the VIMRC. nnoremap ev :vsplit $MYVIMRC nnoremap sv :source $MYVIMRC -" MiniBufExplorer mappings. -nnoremap :TMiniBufExplorer +" Easier things to type +nnoremap w :w +nnoremap q :q + +" Toggle invisible characters +nnoremap i :set list! + +" Clear search matches +nnoremap :noh:call clearmatches() " Open NERDtree. -nnoremap :NERDTreeToggle +nnoremap :NERDTreeToggle " Switch buffers. -nnoremap :execute ("buffer " . bufname("#")) +nnoremap :execute ("buffer " . bufname("#")) + +" Ctrl-P mappings. +nnoremap :CtrlP +nnoremap :CtrlPBuffer +nnoremap :CtrlPMRU " Switch between FR and US keyboard layouts. nnoremap fr :setlocal keymap=french @@ -249,6 +290,9 @@ " Create folds with (in visual mode) vnoremap zf +" File-type switching +nnoremap ftmd :set ft=markdown + " }}} " Abbreviations {{{