Plugin 'justinmk/vim-sneak'
Plugin 'chrisbra/checkattach'
Plugin 'nathanaelkane/vim-indent-guides'
+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
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
" close all folds open fold in cursor
nnoremap zx zMzxzt
-" edit vimrc in new tab
-nmap <leader>ev :tabedit $MYVIMRC<CR>:lcd %:p:h<CR>
-
map <F1> :ls<CR>:b<space>
nnoremap <C-L> <C-W>w
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>
\ | wincmd p | diffthis
endif
+" edit configs {{{2
+function! EditConfig(what)
+ let l:dir = split(&runtimepath,',')[0]
+ if a:what == 'vimrc'
+ let l:file = expand($MYVIMRC)
+ elseif ! isdirectory(globpath(l:dir, a:what))
+ echoe a:what." is not valid!"
+ elseif empty(&filetype)
+ echoe 'filetype is empty!'
+ else
+ let l:file = l:dir.'/'.a:what.'/'.&filetype.'.vim'
+ endif
+
+ execute ':vsplit '.file
+ execute ':lcd %:p:h'
+endf
+nmap <leader>ev :call EditConfig('vimrc')<CR>
+nmap <leader>ef :call EditConfig('ftplugin')<CR>
+nmap <leader>es :call EditConfig('syntax')<CR>
+nmap <leader>ei :call EditConfig('indent')<CR>
+nmap <leader>eu :UltiSnipsEdit<CR>
+
" spell check {{{2
" http://tex.stackexchange.com/a/52932
let g:myLangList=["en_gb","en_us","de","fr"]