]> git.rmz.io Git - dotfiles.git/blobdiff - vim/vimrc
vim: fix node snippets
[dotfiles.git] / vim / vimrc
index e5a69e6d5b0247f52274bd71b1a6c3bde319fd13..d927be15bb0b802782c871412c407de457ea6501 100644 (file)
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -16,22 +16,28 @@ Plugin 'gmarik/vundle'
 
 Plugin 'airblade/vim-gitgutter'
 Plugin 'bling/vim-airline'
+Plugin 'derekwyatt/vim-fswitch'
 Plugin 'elzr/vim-json'
-Plugin 'http://git.code.sf.net/p/vim-latex/vim-latex'
+Plugin 'firef0x/pkgbuild.vim'
 Plugin 'junegunn/vim-easy-align'
 Plugin 'kien/ctrlp.vim'
+" Plugin 'klen/python-mode'
+Plugin 'wilywampa/python-mode'
 Plugin 'kshenoy/vim-signature'
 Plugin 'majutsushi/tagbar'
+Plugin 'raimondi/delimitmate'
 Plugin 'rking/ag.vim'
 Plugin 'scrooloose/nerdtree'
 Plugin 'scrooloose/syntastic'
 Plugin 'sjl/gundo.vim'
 Plugin 'tomtom/tcomment_vim'
+Plugin 'tpope/vim-endwise'
 Plugin 'tpope/vim-fugitive'
 Plugin 'tpope/vim-repeat'
 Plugin 'tpope/vim-surround'
 Plugin 'tpope/vim-unimpaired'
 Plugin 'valloric/youcompleteme'
+Plugin 'vim-scripts/yankring.vim'
 
 " snippets
 Plugin 'sirver/ultisnips'
@@ -41,20 +47,21 @@ Plugin 'honza/vim-snippets'
 Plugin 'ompugao/ros.vim'
 Plugin 'ompugao/ctrlp-ros'
 
-Plugin 'firef0x/pkgbuild.vim'
-Plugin 'derekwyatt/vim-fswitch'
 " seems to have problems right now... may be add later?
 " Plugin 'jalcine/cmake.vim'
 " Plugin 'powerman/vim-plugin-viewdoc'
 
-" endwise needs to be after delimitmate
-Plugin 'raimondi/delimitmate'
-Plugin 'tpope/vim-endwise'
-Plugin 'lokaltog/vim-easymotion'
+" find an alternative
+Plugin 'http://git.code.sf.net/p/vim-latex/vim-latex'
+" Plugin 'lokaltog/vim-easymotion'
+Plugin 'justinmk/vim-sneak'
 Plugin 'chrisbra/checkattach'
-Plugin 'klen/python-mode'
 Plugin 'nathanaelkane/vim-indent-guides'
-Plugin 'vim-scripts/yankring.vim'
+Plugin 'alx741/vinfo'
+
+Plugin 'kana/vim-textobj-user'
+Plugin 'julian/vim-textobj-variable-segment'
+Plugin 'sgur/vim-textobj-parameter'
 
 " remove entries first
 set runtimepath -=$HOME/.vim
@@ -166,7 +173,7 @@ set foldmethod=marker           " folding type
 set foldlevelstart=0            " value for 'foldlevel' when starting to edit a file
 
 " save and restore folds
-set viewoptions=folds,cursor    " don't save local options
+set viewoptions=cursor          " only save cursor position
 
 " diff mode {{{2
 set diffopt=filler,vertical
@@ -257,6 +264,7 @@ augroup END
 map <space> <leader>
 
 " make
+nnoremap <leader>r :make<cr>
 nnoremap <leader><cr> :make<cr>
 
 " unhighlight search
@@ -266,9 +274,6 @@ nnoremap <silent> <Leader>/ :silent nohl<CR>
 nnoremap <leader>[ :tabprev<cr>
 nnoremap <leader>] :tabnext<cr>
 
-" Wrap
-nnoremap <leader>W :set wrap!<cr>
-
 " paste from selection
 nnoremap <leader>p* :silent! set paste<CR>"*p:set nopaste<CR>
 " paste from clipboard
@@ -287,15 +292,12 @@ noremap ' `
 " Select (charwise) the contents of the current line, excluding indentation.
 nnoremap vv ^vg_
 
-" Toggle [i]nvisible characters
-nnoremap <leader>i :set list!<cr>
-
 " Unfuck my screen
 nnoremap U :syntax sync fromstart<cr>:AirlineRefresh<cr>:redraw!<cr>
 
 " Ranger
-nnoremap <leader>r :silent !ranger %:h<cr>:redraw!<cr>
-nnoremap <leader>R :silent !ranger<cr>:redraw!<cr>
+nnoremap <leader>r :silent !ranger %:h<cr>:redraw!<cr>
+nnoremap <leader>R :silent !ranger<cr>:redraw!<cr>
 
 " Use sane regexes.
 nnoremap / /\v
@@ -376,8 +378,7 @@ noremap <silent> <Leader>O :set paste<CR>m`O<ESC>``:set nopaste<CR>
 " Don't use Ex mode, use Q for formatting
 map Q gq
 
-" allow undoing in insert-mode
-inoremap <C-U> <C-G>u<C-U>
+" break undo sequence before removing word
 inoremap <C-W> <C-G>u<C-W>
 
 nmap <Leader>b :set expandtab tabstop=4 shiftwidth=4 softtabstop=4<CR>
@@ -396,6 +397,9 @@ autocmd BufWinEnter *.* silent loadview
 " save with sudo
 cnoremap w!! w !sudo tee % > /dev/null
 
+" uppercase previous word
+inoremap <C-C> <Esc>gUiwgi
+
 " plugins options {{{1
 " ag {{{2
 let g:AgSmartCase = 1
@@ -409,6 +413,7 @@ let g:airline_powerline_fonts = 1
 
 " checkattach {{{2
 let g:checkattach_filebrowser = 'ranger'
+let g:checkattach_once = 'y'
 
 " delimitmate {{{2
 let delimitMate_expand_cr = 2
@@ -526,7 +531,7 @@ let g:ycm_extra_conf_globlist = ['~/src/*','/mnt/data/src/*']
 let g:ycm_global_ycm_extra_conf = expand('$XDG_CONFIG_HOME/vim/ycm_extra_conf.py')
 let g:ycm_extra_conf_vim_data = ['getcwd()']
 let g:ycm_add_preview_to_completeopt = 1
-let g:ycm_autoclose_preview_window_after_insertion = 1
+let g:ycm_autoclose_preview_window_after_insertion = 0
 "let g:ycm_extra_conf_vim_data = ['%:p']
 nnoremap <leader>jd :YcmCompleter GoTo<CR>
 
@@ -542,6 +547,24 @@ let g:tex_flavor='latex'
 let g:Tex_DefaultTargetFormat='pdf'
 let g:Tex_MultipleCompileFormats='pdf'
 
+" vim-sneak {{{2
+let g:sneak#streak = 1
+let g:sneak#target_labels = "aoeuisnthdpylrcgfqjkxzmwvz" " dvorak
+let g:sneak#use_ic_scs = 1  " follow 'ignorecase' and 'smartcase'
+
+" sneaky f and t
+nmap f <Plug>Sneak_f
+nmap F <Plug>Sneak_F
+xmap f <Plug>Sneak_f
+xmap F <Plug>Sneak_F
+omap f <Plug>Sneak_f
+omap F <Plug>Sneak_F
+nmap t <Plug>Sneak_t
+nmap T <Plug>Sneak_T
+xmap t <Plug>Sneak_t
+xmap T <Plug>Sneak_T
+omap t <Plug>Sneak_t
+omap T <Plug>Sneak_T
 
 " functions {{{1
 
@@ -579,7 +602,6 @@ function! SwitchSpell()
   echo "setlocal spelllang=" g:myLangList[b:myLang]
 endfunction
 
-nnoremap <silent> <Leader>s :call ToggleSpell()<CR>
-nnoremap <silent> <Leader>S :call SwitchSpell()<CR>
+nnoremap <silent> coS :call SwitchSpell()<CR>
 " fix spelling with first choice
 nnoremap <Leader>f 1z=