X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/bc7fe9a3b5914cbcc18bac12635c2fefdf6558bb..45ae13e4b54571a2a01b78d9a2efa4727b5886fe:/vim/vimrc diff --git a/vim/vimrc b/vim/vimrc index 1b445f6..2cdb19d 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -21,7 +21,8 @@ Plugin 'elzr/vim-json' Plugin 'firef0x/pkgbuild.vim' Plugin 'junegunn/vim-easy-align' Plugin 'kien/ctrlp.vim' -Plugin 'klen/python-mode' +" Plugin 'klen/python-mode' +Plugin 'wilywampa/python-mode' Plugin 'kshenoy/vim-signature' Plugin 'majutsushi/tagbar' Plugin 'raimondi/delimitmate' @@ -56,6 +57,11 @@ Plugin 'http://git.code.sf.net/p/vim-latex/vim-latex' 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 @@ -167,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 @@ -268,9 +274,6 @@ nnoremap / :silent nohl nnoremap [ :tabprev nnoremap ] :tabnext -" Wrap -nnoremap W :set wrap! - " paste from selection nnoremap p* :silent! set paste"*p:set nopaste " paste from clipboard @@ -289,9 +292,6 @@ noremap ' ` " Select (charwise) the contents of the current line, excluding indentation. nnoremap vv ^vg_ -" Toggle [i]nvisible characters -nnoremap i :set list! - " Unfuck my screen nnoremap U :syntax sync fromstart:AirlineRefresh:redraw! @@ -353,9 +353,6 @@ cnoremap " close all folds open fold in cursor nnoremap zx zMzxzt -" edit vimrc in new tab -nmap ev :tabedit $MYVIMRC:lcd %:p:h - map :ls:b nnoremap w @@ -378,8 +375,7 @@ noremap O :set pastem`O``:set nopaste " Don't use Ex mode, use Q for formatting map Q gq -" allow undoing in insert-mode -inoremap u +" break undo sequence before removing word inoremap u nmap b :set expandtab tabstop=4 shiftwidth=4 softtabstop=4 @@ -398,6 +394,9 @@ autocmd BufWinEnter *.* silent loadview " save with sudo cnoremap w!! w !sudo tee % > /dev/null +" uppercase previous word +inoremap gUiwgi + " plugins options {{{1 " ag {{{2 let g:AgSmartCase = 1 @@ -411,6 +410,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 @@ -528,7 +528,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 jd :YcmCompleter GoTo @@ -549,6 +549,20 @@ 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 Sneak_f +nmap F Sneak_F +xmap f Sneak_f +xmap F Sneak_F +omap f Sneak_f +omap F Sneak_F +nmap t Sneak_t +nmap T Sneak_T +xmap t Sneak_t +xmap T Sneak_T +omap t Sneak_t +omap T Sneak_T + " functions {{{1 " Convenient command to see the difference between the current buffer and the @@ -559,6 +573,28 @@ if !exists(":DiffOrig") \ | 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 ev :call EditConfig('vimrc') +nmap ef :call EditConfig('ftplugin') +nmap es :call EditConfig('syntax') +nmap ei :call EditConfig('indent') +nmap eu :UltiSnipsEdit + " spell check {{{2 " http://tex.stackexchange.com/a/52932 let g:myLangList=["en_gb","en_us","de","fr"]