diff --git a/.vimrc b/.vimrc index 830aa71..352285b 100755 --- a/.vimrc +++ b/.vimrc @@ -21,11 +21,13 @@ if filereadable(expand(vundle_dir) . "/README.md") " Plugin 'shougo/neocomplete' Plugin 'godlygeek/tabular' Plugin 'airblade/vim-gitgutter' + Plugin 'jeetsukumaran/vim-pythonsense' + Plugin 'easymotion/vim-easymotion' call vundle#end() " required else let vundle_repo="https://github.com/VundleVim/Vundle.vim.git" - echo "Vundle not installed, type :CloneVundle to clone the vundle repo" + echo "Vundle not installed, type :CloneVundle to clone the vundle repo and install it" command CloneVundle execute "!git clone " . vundle_repo . " " . vundle_dir endif @@ -45,6 +47,7 @@ set expandtab " On pressing tab, insert 4 spaces set mouse=a set hlsearch +set scrolloff=5 " Don't let cursor be within 5 lines from top or bottom " Warn for trailing whitespace. Search with wrap (w) do not move cursor (n) function! WhitespaceWarn() @@ -73,6 +76,11 @@ augroup numbertoggle autocmd BufLeave,FocusLost,InsertEnter * set nornu augroup END +" Do incremental searching when it's possible to timeout. +if has('reltime') + set incsearch +endif + " Copy to the end of line noremap Y y$ @@ -118,8 +126,6 @@ command! Csc cscope find c " Regen cscope " sh ~/bin/gen_cscope.sh . .git/cscope.out " -" Key binds -" " Simulate maximize/minimize window nnoremap m :call ToggleMiniMaxiWin() @@ -137,8 +143,13 @@ function! ToggleMiniMaxiWin() endif endfunction +" Key binds +" + " Replace the word under cursor nnoremap * :%s/\<\>//g +" Replace visual selection +vnoremap * y:%sno/"//g nmap :NERDTreeToggle nmap :NERDTreeFind @@ -156,3 +167,18 @@ nmap vv :vsp $MYVIMRC nmap vt :tabnew $MYVIMRC nmap vo :e $MYVIMRC nmap v :e $MYVIMRC + +" Match git conflict markers +nmap /g /[<=>]\{7,}.*$ + +" Toggle wrapping of long lines +nmap l :set wrap! + +" Scroll window while keeping cursor on same line with shift +nmap +nmap +vmap +vmap + +" Misc. +vmap T :'<,'> Tabularize /