" 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
\ | 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"]