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 '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'
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'
" remove entries first
set runtimepath -=$HOME/.vim
map <space> <leader>
" make
+nnoremap <leader>r :make<cr>
nnoremap <leader><cr> :make<cr>
" unhighlight search
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
" save with sudo
cnoremap w!! w !sudo tee % > /dev/null
-" plugins {{{1
+" plugins options {{{1
" ag {{{2
let g:AgSmartCase = 1
nnoremap <leader>ag yiw:Ag \12"<cr>
" checkattach {{{2
let g:checkattach_filebrowser = 'ranger'
+let g:checkattach_once = 'y'
" delimitmate {{{2
let delimitMate_expand_cr = 2
let g:UltiSnipsEditSplit = 'vertical'
let g:UltiSnipsSnippetsDir = expand("$XDG_CONFIG_HOME/vim/ultisnips")
let g:UltiSnipsSnippetDirectories = ["UltiSnips", "ultisnips"]
-let g:UltiSnipsExpandTrigger = "<C-L>"
-let g:UltiSnipsJumpForwardTrigger = "<C-L>"
-let g:UltiSnipsJumpBackwardTrigger = "<C-H>"
+let g:UltiSnipsExpandTrigger = "<tab>"
+let g:UltiSnipsJumpForwardTrigger = "<tab>"
+let g:UltiSnipsJumpBackwardTrigger = "<s-tab>"
+
+" UltiSnips completion function that tries to expand a snippet. If there's no
+" snippet for expanding, it checks for completion window and if it's shown,
+" selects first element. If there's no completion window it tries to jump to
+" next placeholder. If there's no placeholder it just returns TAB key
+" https://github.com/Valloric/YouCompleteMe/issues/36#issuecomment-15451411
+function! g:UltiSnips_Complete()
+ call UltiSnips#ExpandSnippet()
+ if g:ulti_expand_res == 0
+ if pumvisible()
+ return "\<C-n>"
+ else
+ call UltiSnips#JumpForwards()
+ if g:ulti_jump_forwards_res == 0
+ return "\<TAB>"
+ endif
+ endif
+ endif
+ return ""
+endfunction
+au InsertEnter * exec "inoremap <silent> " . g:UltiSnipsExpandTrigger . " <C-R>=g:UltiSnips_Complete()<cr>"
+let g:UltiSnipsListSnippets="<c-e>"
" yankring {{{2
nnoremap <silent> <leader>p :YRShow<cr>
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
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=