From f2e01d7e513067ddb57c75f6e38cdcf434946cf8 Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Mon, 22 Oct 2018 00:02:58 +0200 Subject: Major refactoring for version 2.0 vim-plug has been removed and replaced with Vims internal bundle mechanism. But I already noticed, that there is also GLVM now and started trying that as well. --- vimrc-full | 1255 ------------------------------------------------------------ 1 file changed, 1255 deletions(-) delete mode 100644 vimrc-full (limited to 'vimrc-full') diff --git a/vimrc-full b/vimrc-full deleted file mode 100644 index 7512908..0000000 --- a/vimrc-full +++ /dev/null @@ -1,1255 +0,0 @@ -" vim: noai:ts=2:sw=2:sts=2 iskeyword+=\:,\<,\>,\-,\& number - -"======================================================================================================================= -" GENERAL: -"======================================================================================================================= -set exrc | " enable exrc, a specific .exrc per project, which can contain usual .vimrc commands -set textwidth=0 | " better done with modeline or local exrc and not here -set ts=4 sts=4 sw=4 expandtab | " better done with a modeline or local exrc -set virtualedit=all | " virtual edit should be default behaviour, because I don't see any reason against -set nonumber norelativenumber | " do not show numbers by default, because that causes a performance loss, instead activate them on a file type basis -set ignorecase smartcase hlsearch | " search with ignore case by default, but use case sensitive search when one capital char is contained and highlight while typing (even though its slower) -set cindent cinoptions+=(0 | " indent at parentheses - - -set path+=** | " allow recursive searches for files -let &path = &path.",/usr/lib/modules/".substitute(system('uname -r'), "\n", "", "")."/build/include" - -"======================================================================================================================= -" SHELL -"======================================================================================================================= -if filereadable("/bin/bash") - set shell=/bin/bash | " many scripts rely on bash, but its path varies why it is commented out here -elseif filereadable("/usr/local/bin/bash") - set shell=/usr/local/bin/bash -endif - -"======================================================================================================================= -" Persistent undo -"======================================================================================================================= -if has('persistent_undo') - if isdirectory('/dev/shm') - set undodir=/dev/shm/ | " save undo file in memory. That is volatile, but fast and we have GIT for longer lasting undoes - set directory=/dev/shm/ | " swap file directory to RAM - set swapfile - elseif isdirectory('/tmp/') - set undodir=/tmp/ - endif - set undofile | " preserve undo history when closing and reopening buffers (see :help undo-persistence) -endif - -"======================================================================================================================= -" multi byte -"======================================================================================================================= -if has("multi_byte") - scriptencoding utf-8 | " tell vim that we are using UTF-8 here - set encoding=utf-8 | " we need default UTF-8 encoding to use cool chars as line break and so on (see below) - let &termencoding=&encoding | " once we use special chars we assume everybody uses a terminal supporting those - - set fillchars= | " initialize empty fillchars - set listchars= | " initialize empty listchars - - if &term == "linux" - set fillchars+=vert:\│ | " cool vertical split char - else - set fillchars+=vert:\║ | " cool vertical split char - endif - - set fillchars+=fold:\ | " - set fillchars+=diff:\ | " a white space gets used here - - set listchars+=extends:» | " symbols used when using :set list (which displays non-printable chars) - set listchars+=precedes:« | " symbols used when using :set list (which displays non-printable chars) - - set listchars+=tab:▏\ | " - set listchars+=trail:· | " symbols used when using :set list (which displays non-printable chars) - " set listchars+=eol:↲ | " symbols used when using :set list (which displays non-printable chars) - " set listchars+=space:· | " symbols used when using :set list (which displays non-printable chars) - set showbreak+=› | " symbol used in the beginning of a wrapped line - - " automatically enter list mode when going in insert mode (makes above syntax command temporarily ineffective) - set nolist - autocmd InsertEnter * set list - autocmd InsertLeave * set nolist -" set fillchars+=stlnc:\― | " -end - - -"======================================================================================================================= -" SPELL_CHECKING -"======================================================================================================================= -let g:spellfile_URL='http://ftp.vim.org/vim/runtime/spell' -" add local user default spell file as primary source for words -let &spellfile=fnamemodify($MYVIMRC, ":p:h")."/spell/spellfile-user.UTF-8.add" - -set nospell | " disable spell checker by default -set spelllang=en,de | " languages for the spell checker -set spellsuggest=10 | " how many words will z= suggest? -set thesaurus+=~/.vim/thesaurus/php.txt - -"======================================================================================================================= -" cscope -"======================================================================================================================= -" http://vim.wikia.com/wiki/Cscope -if has('cscope') " compiled with cscope support? - set cscopetag " CTRL-] uses cscope first, then ctags - set cscopeverbose - - if has('quickfix') - set cscopequickfix=s+,c+,d+,i+,t+,e+ - endif - - if has('menu') - 1001menu &Cscope.find.c\ symbol - \s - \ :cscope find s <:cR> - 1001menu &Cscope.find.definition - \g - \ :cscope find g <:cR> - 1001menu &Cscope.find.functions\ called\ by\ this - \d - \ :cscope find d <:cR> - 1001menu &Cscope.find.functions\ calling\ this - \c - \ :cscope find c <:cR> - 1001menu &Cscope.find.text\ string - \t - \ :cscope find t <:cR> - 1001menu &Cscope.find.egrep\ pattern - \e - \ :cscope find e <:cR> - 1001menu &Cscope.find.this\ file - \f - \ :cscope find f <:cR> - 1001menu &Cscope.find.files\ including\ this\ file - \i - \ :cscope find i <:cR> - 1001menu &Cscope.find.places\ where\ this\ symbol\ is\ assigned\ a\ value - \a - \ :cscope find a <:cR> - 1001menu &Cscope.-Sep1- - \ : - 1001menu &Cscope.create\ and\ add\ database - \ :cscope kill -1:execute '!find -type f -regex ".*\.\(c\\|h\\|cpp\\|cxx\\|hh\\|hpp\\|hxx\)$" cscope -i- -b -q -v':cscope add . - 1001menu &Cscope.-Sep2- - \ : - 1001menu &Cscope.add\ \. - \ :cscope add . - 1001menu &Cscope.show - \ :cscope show - 1001menu &Cscope.reset - \ :cscope reset - endif -endif - -" ====================================================================================================================== -" GUI_VERSION -" ====================================================================================================================== -if has("gui_running") - set guicursor=a:block-blinkon100 - set browsedir=buffer - set toolbar+=text - set guiheadroom=0 - set guioptions+=eig - set guioptions-=T | " toolbar - set guioptions+=c | " use console dialogues instead of popups - set guioptions+=a | " auto select: copy&paste using middle click - set guioptions+=m | " remove menu - set guioptions-=e | " do not display tabs - set guioptions-=L | " do not show left scrollbar - set guioptions-=r | " do not show right scrollbar - set winaltkeys=menu | " behave like other windows: ALT-key can be used to open the menu (and cannot be :remaped) -" set selectmode=mouse,key,cmd | " enters vim's select mode when pressing shift-left or shift-END -" set keymodel=startsel,stopsel | " makes shift-left, shift-right available for selecting text - - - " its possible to define alternative fonts (order matters) - set guifont=Monospace\ 10 - set guifont+=Noto\ Sans\ Mono\ Bold - set guifont+=Noto\ Sans\ Mono\ Bold - set guifont+=Hasklug\ Nerd\ Font\ Mono\ Semi-Bold\ 10 - set guifont+=Hasklig\ Semi-Bold\ 10 - set guifont+=Bitstream\ Vera\ Sans\ Mono\ 10 - set guifont+=FuraMono\ Nerd\ Font\ Mono\ Medium\ 11 - set guifont+=Source\ Code\ Pro\ for\ Powerline\ SemiBold\ 10 - set guifont+=LiterationMono\ Nerd\ Font\ Mono\ 10 - set guifont+=RobotoMono\ Nerd\ Font\ Medium\ 10 - set guifont+=Source\ Code\ Pro\ Semi-Bold\ 10 - set guifont+=Dejavu\ Sans\ Mono\ for\ Powerline\ Semibold - set guifont+=Droid\ Sans\ Mono\ for\ Powerline\ 10 - set guifont+=Meslo\ LG\ M\ for\ Powerline\ 10 - - " like in the terminal: use Ctrl-shift-v for paste in vim's command editor - cnoremap * -endif - -" ====================================================================================================================== -" SETTINGS: -" ====================================================================================================================== -set breakindent | " Every wrapped line will continue visually indented -set clipboard=unnamedplus | " makes copy and paste work (autoselectplus might work as well) -set concealcursor=nc | " limits the display of concealed text to normal and command mode -set conceallevel=2 | " replace escaped chars by their UTF-8 representation (useful for LaTeX) -set confirm | " asks 'do you want to save?' -set cpoptions+=P | " makes :w filename set the current buffer to filename -set hidden | " allows switching buffers even if the current buffer contains changes (displays +) -set linebreak | " wrap long lines at char 'breakat', not inside words -set mousemodel=popup | " only in gvim: right click opens a pop-up-menu -set mouse=n | " allow mouse in normal mode only, so one can use the terminals c&p feature in insert mode -set noautochdir | " When on, Vim will change the current working directory -set nostartofline | " when scrolling: do not move the cursor to column 1 -set nowrap | " but do not (by default) wrap long lines around -set nrformats+=alpha | " allows CTRL-A & CTRL-X to increment and decrement letters, not just numbers -set incsearch | " highlight pattern while entering it (performance wise this isn't that good) - -if has('nvim') " Neovim? -set inccommand=nosplit | " preview substitute and such things in real time -endif - -set pumheight=8 | " Determines the maximum number of items to show in the pop-up menu for -set scrolljump=5 | " how many lines get scrolled into view when cursor reaches the screens edge -set scrolloff=0 | " keeps cursor centered -set shiftround | " indent/un-indent snaps to multiple of shiftwidths -set writedelay=0 - -" display and performance -set lazyredraw | " disables redraw during macro execution (improves performance) -set cmdheight=2 | " sets the command line's height -set signcolumn=yes | " auto=auto hide, yes=always, no=never show the column with error indicators -set nocursorcolumn | " turn visual cursor column off (improves performance) -set updatetime=80 | " updates the screen more often -set redrawtime=1500 | " Timeout in milliseconds for redrawing the screen (switches syntax off when ssh too slow) / CTRL+L to retry -set notimeout | " improves performance but is known to cause problems on slow terminals -set ttimeout ttimeoutlen=150 | " set Esc key timeout in ms- -set showcmd | " essential: show keys of combined commands in the lower right corner (BUT SLOW, makes cursor flickering) -set showtabline=2 | " 0: never, 1: only if there are at least two tabs, 2:always -set shortmess+=I | " don't give the intro message when starting Vim |:intro|. -set wildmenu | " use a menu in the command line -set wildmode=longest:full | " do not preselect any entry and show all possible - -" code completion -" set dictionary=/usr/share/dict/cracklib-small -" set complete+=k " make default completer respect the dictionary -set complete-=u " scan current and included files -set complete+=i " scan current and included files -set complete+=d " scan current and included files for defined name or macro -set complete+=d | " scan current and included files for defined name or macro -set complete+=i | " scan current and included files for completions -set completeopt+=noinsert | " Do not insert any text for a match until the user selects one -set completeopt+=noselect | " Do not select a completion from the menu, let the user do that -set tagcase=match | " tagcase match, because we mostly use ^] to jump around and that variant respects the upper/lower case [followscs, followic, match, ignore] -set tags+=../tags - -" code folding... -set nofoldenable | " disable folding, because we have zi to toggle foldenable :) -set foldclose=all | " automatically fold, when the cursor leaves the folded area -set foldcolumn=2 | " I think I don't need this second indicator -" set numberwidth=5 -" set foldmethod=syntax | " foldlevel: syntax, indent, manual / foldmethod=syntax makes Vim incredible slow -set foldnestmax=1 | " top level folding only -set foldopen=block,hor,search | " when do we unfold? -" set foldtext=Foldtext() | " -" set foldtext=v:folddashes.substitute(getline(v:foldstart),'\\v^/[/*]\','','g') -" set foldtext='⊞\ '.substitute(getline(v:foldstart),'^[\ '.printf(&cms,'').']*','','').'↵'.getline(v:foldstart+1).'↵'.getline(v:foldstart+2) -" set foldtext=repeat('',indent(v:foldstart)).substitute(substitute(substitute(join(getline(v:foldstart,v:foldend)),'\\s\\s\\+\\\|\[\*\/\]','\ ','g'),'\^\\s\\+','','g'),\ '\\s\\s\\+',\ '\ ',\ 'g') -set foldtext=printf('%*s%.*S',indent(v:foldstart),'',&textwidth-indent(v:foldstart),substitute(substitute(join(getline(v:foldstart,v:foldend),'\ '),'[[:space:]]\\+','\ ','g'),'^[[:space:]*]','','g')) - -" works ... -" set foldexpr=match(synIDattr(synID(v:lnum,indent(v:lnum)+1,0),'name'),'Comment')>-1 -set foldexpr=!empty(filter(synstack(v:lnum,indent(v:lnum)+1),{_,val->match(synIDattr(val,'name'),'Comment')>-1})) - -" set foldtext=printf('%*s%.'.eval(&textwidth-indent(v:foldstart)).'S',indent(v:foldstart),'',substitute(substitute(substitute(join(getline(v:foldstart,v:foldend)),'\\s\\s\\+\\\|\[\*\/\]','\ ','g'),'\^\\s\\+','','g'),\ '\\s\\s\\+',\ '\ ',\ 'g')) - -" vim window behaviour -set splitbelow | " open new windows below the current one (i find that more intuitive) -set splitright | " this also works for me and makes better use of the scren space I think -set winminwidth=0 | " (and all other windows, so TODO: watch out) -set winwidth=30 | " keep NERDTreeWindow at least this size - - -" vim session handling and restore behaviour -set viminfo+=% | " restore buffer list -set sessionoptions= -set sessionoptions+=buffers -set sessionoptions+=curdir -set sessionoptions+=folds -set sessionoptions+=resize -set sessionoptions+=slash -set sessionoptions+=tabpages -set sessionoptions+=unix -set sessionoptions+=winpos -set sessionoptions+=winsize - - -" set nocindent smartindent | " use smart indent rather then cindent -set noautoindent -set nosmartindent - -set noshiftround | " indent/un-indent sna=ps to multiple of shiftwidths -set noequalalways | " do not evenly size windows when opening new or closing old -set nocursorline | " turn visual cursor line off (improves performance) -"======================================================================================================================= - -" Vim 8 has a terminal command... -if has('terminal') - " use default ESC key to leave insert mode in the internal terminal emulator - tnoremap N - " make terminal windows hidden by default (copied from :help terminal) - autocmd BufWinEnter * if &buftype == 'terminal' | setlocal bufhidden=hide | endif -endif - - -" NEOVIM_incompatible: -" -if has('nvim') " Neovim? - autocmd TermOpen term://* set nobuflisted - " use default ESC key to leave insert mode in the internal terminal emulator - tnoremap -" set shada+=n~/.vim/shada | " shada file to use -" - menu &UI.&Open\ in\ Serversession - \ :execute ':!nvr --servername /tmp/nvimsocket --remote % +'.line('.'):stopinsert:set readonly - -else " default Vim? - autocmd VimLeave * call system("echo -n $'" . escape(getreg(), "'") . "' | xsel -ib") - - set ttymouse=xterm2 - set ttyscroll=100 | " improves speed for terminal vim, incompatible with nvim - set ttyfast | " improves speed for terminal vim (incompatible with nvim) - set nottybuiltin | " use external termcaps - set restorescreen | " restores the console after exiting vim (intentionally not in nvim) - " - let g:loaded_ruby_provider = 1 " disable ruby support - let g:loaded_python_provider = 1 " disable python 3 - - if version >= 702 " clean up (see: http://vim.wikia.com/wiki/VimTip396) - autocmd BufWinLeave * call clearmatches() - endif - - - " scripts from the default vim installation, which do not get loaded by default, but are useful. - if filereadable($VIMRUNTIME.'/macros/editexisting.vim') - packadd! editexisting - endif - - " load default plugin 'matchit' to allow % to jump between tags - if filereadable($VIMRUNTIME.'/macros/matchit.vim') - packadd! matchit - endif - -endif - - -if has("autocmd") - set modeline | " set variables specific to a file, like indentation by adding a comment - " set default completion function in case YouCompleteMe cannot help - " set omnifunc=syntaxcomplete#Complete - - augroup set_window_title " { - " autocmd BufEnter * let &titlestring = hostname() . "[vim(" . expand("%:t") . ")]" - autocmd CursorHold * let &titlestring = "%t %y ".$USER."@".hostname().":%{expand(\"%:~:.:h\")}" - set title - " autocmd CursorHold * let &titlestring = "Vim (".airline#extensions#tagbar#currenttag().")" - - " set window title for screen(3) - if &term == "screen" - set t_ts=k - set t_fs=\ - endif - if &term == "screen" || &term == "xterm" - set titlelen=40 - set title - endif - augroup END - - augroup ChangeIcon - "if filereadable("/usr/bin/xseticon") - "if filereadable("~/.vim/nvim.png") - " autocmd VimEnter * silent :execute "!xseticon -id $WINDOWID ~/.vim/nvim.png" - " autocmd VimLeave * silent :execute "!xseticon -id $WINDOWID /usr/share/icons/gnome/32x32/apps/xfce-terminal.png" - "endif - "endif - augroup END - - " Fix terminal title ================================================================================================= - " autocmd VimEnter * let &t_EI .= "\[0 q" - " autocmd VimEnter * let &t_SI = "\]12;green\x7" - autocmd VimLeave * silent !echo -ne "\033]112\007" - - " highlight word under the cursor ==================================================================================== - let w:m1 = 0 - function! HighlightWordUnderCursor() - if(exists('w:m1') && w:m1 > 0) - silent! call matchdelete(w:m1) - let w:m1 = 0 - endif - let l:currentword = escape(expand(''), '.') - if(strlen(l:currentword) > 0) - let w:m1=100 - silent! call matchadd('BoldUnderline', '\<'.l:currentword.'\>', -1, w:m1) - endif - endfunction - autocmd! CursorHold,CursorHoldI * call HighlightWordUnderCursor() - - " hitting K over a keyword shows a help in a buffer. - " Here we define the commands used to look those keywords up - " as per file type... - augroup filetype_specific - autocmd FileType python setlocal keywordprg=pydoc - autocmd FileType vim setlocal keywordprg=:help |. - autocmd FileType c,cpp setlocal equalprg=clang-format - autocmd FileType c,cpp setlocal breakat-=- - - if filereadable("/usr/bin/vendor_perl/ack") - autocmd FileType c,cpp set grepprg=/usr/bin/vendor_perl/ack\ --type=cc\ --nogroup\ --column\ $* - autocmd FileType c,cpp set grepformat=%f:%l:%c:%m - endif - - autocmd BufWinEnter * if &previewwindow | setlocal nonumber nolist signcolumn=no filetype=c nobuflisted | endif - - - " autocmd FileType c,cpp setlocal iskeyword-=_ - - " the following helps to make file=/etc/something work with gf, but disallows filenames with an equal sign in them - autocmd FileType conf setlocal isfname-== - - - autocmd Filetype css command! CSSsort :g/{/+1;/}/-1 sort - - " keyboard mapping for xml alike languages - " Alt-Up : Move cursor up one tag - " Alt-Down: Move cursor down one tag - " leader-=: tidies currently selected tag and subtags and sorts attributes by name (alphabetically) - autocmd Filetype html,markdown,xml iabbrev - autocmd Filetype html,htmldjango,xml - \ :nnoremap - \ - \ :call search('^ *<', 'e'):nohlsearch| - \ :nnoremap - \ - \ :call search('^ *<', 'eb'):nohlsearch| - \ :nnoremap - \ = - \ vat:'<,'>!tidy -xml --wrap 0 --sort-attributes alpha 2>/dev/nullvat= - augroup END - - " autocmd BufNewFile set nobuflisted - " use the shada/viminfo file to return the cursor to where it was... - autocmd BufReadPost * call setpos(".", getpos("'\"")) - - augroup CurrentFileName - " highlight the current files name inside the document... - let @g = ":exe ':match SpellBad /'.escape(expand('%:t'), '.').'/'" - " put the current files name after the cursor... - let @f = ":exe ':normal a'.expand('%:t')" - - " grep all buffers for a given string and return result in a quickfix window - let @q = ":cex [] | bufdo vimgrepadd /foo/g % | cw" - - let @l = ":let g:signify_vcs_cmds={'git': 'git diff --no-color --no-ext-diff -U0 HEAD^ -- %f'}|:SignifyRefresh" - - if has('menu') - source $VIMRUNTIME/menu.vim - set wildmenu - set cpo-=< - set wcm= - - 01menu &Functions.toggle\ file\ browser - \ - \ - 01menu &Functions.-Sep0- : - - 01menu &Functions.help - \ - \ - 01menu &Functions.bp:\ previous\ buffer - \ - \ - 01menu &Functions.bn:\ next\ buffer - \ - \ - 01menu &Functions.^wc\:\ close\ window - \ - \ - 01menu &Functions.-Sep1- : - - 01menu &Functions.make - \ - \ - 01menu &Functions.clear\ matches,\ update\ viewport - \ - \ - 01menu &Functions.copen\:\ show\ quickfix\ list - \ - \ - 01menu &Functions.lopen\:\ show\ location\ list - \ - \ - 01menu &Functions.-Sep2- : - - 01menu &Functions.toggle\ tagbar - \ - \ - - if has("gui_running") == 0 - " in the gui F10 already triggers the menu, not in a terminal vim, so upgrade that... - map :emenu - endif - 01menu &Functions.activate\ menu\ (:emenu) - \ - \ - - 01menu &Functions.undef11 - \ - \ - 01menu &Functions.undef12 - \ - \ - 01menu &Functions.-Sep2- : - - - 09menu &Directory.print\ current\ directory - \:pwd - \ :pwd - - 09menu &Directory.-Sep- : - - 09menu &Directory.Change\ to\ GIT\ root - \:Gcd - \ :Gcd:pwd - - 09menu &Directory.Change\ to\ current\ buffers\ directory\ (global) - \:cd\ %:p:h - \ :cd %:h:pwd - - 09menu &Directory.Change\ to\ current\ buffers\ directory\ (local\ window):lcd\ %:p:h - \ :lcd %:p:h:pwd - - menu &Git.&Display\ uncommited\ files\ in\ location\ list - \ :call setloclist(0, map(systemlist("git diff --name-only --pretty=''"), {_, p->{'filename': fnamemodify(p, ':.')}})):lopen - menu &Git.&Display\ recently\ changed\ files\ in\ quickfix\ list - \ :call setqflist([], 'r', {'title': 'Recently changed in GIT', 'items':map(systemlist("git show --name-only --pretty=''"), {_, p->{'filename': fnamemodify(p, ':.')}}) }):copen - menu &Git.&Display\ last\ changes - \ :let g:signify_vcs_cmds={'git': 'git diff --no-color --no-ext-diff -U0 HEAD^ -- %f'}:SignifyRefresh - menu &Git.&Display\ unmerged\ files\ in\ location\ list - \ :call setloclist(0, map(systemlist("git diff --name-only --diff-filter=U \| uniq"), {_, p->{'filename': fnamemodify(p, ':.')}})):lopen - menu &Git.&Display\ significance\ of\ changes - \ :!git diff --stat HEAD~1..HEAD - menu &Git.&Display\ Changed\ files\ compared\ to\ master - \ :!git diff --name-status ..master - - menu &Match.Clear\ All\ Matches - \ - \ :call clearmatches() - - menu &Match.-Sep- : - - menu &Match.&dispensable\ white\ spaces - \ :call matchadd("Convention", '\s\+$', 0) - - menu &Match.&long\ lines\ (exeeding\ textwidth) - \ :call matchadd("Convention", '\%>'.&textwidth.'v.', 0) - - menu &Match.Highlight\ current\ file\ name - \ :call matchadd("Search", escape(expand('%:t'), '.')) - - " :execute ':match SpellBad /'.escape(expand('%:t'), '.').'/' - - menu &Window.-Sep- : - - - menu &Window.Scratch - \ :Scratch - - - menu &Find.file\ under\ the\ cursor - \gf - \ gf - - menu &Find.Open\ search\ results\ in\ location\ list - \:gf - \ :execute ':vimgrep /'.escape(getreg('/'), '.').'/g %' - \ :copen - - menu &Changes.list - \:changes - \ :changes - menu &Changes.-Sep- : - menu &Changes.previous - \g; - \ g; - menu &Changes.next - \g, - \ g, - menu &List.location.signs\ to\ list - \CMD - \ :execute ":call setloclist(0, map(get(getbufinfo('%')[0], 'signs'), {_, p->extend(p, {'bufnr':buffer_number('.'), 'text':get(p, 'name')})}))" - menu &List.location.list\ to\ signs - \CMD - \ :call execute(extend(['sign define LocationListEntry text=L', 'sign unplace *'], map(getloclist('%'), {key, val->'sign place '.(key+100).' name=LocationListEntry line='.val['lnum'].' buffer='.buffer_number('%')}))) - menu &Jump.list - \:jumps - \ :jumps - menu &Jump.-Sep1- : - menu &Jump.previous\ position - \CTRL-O - \ - menu &Jump.next\ position - \CTRL-I - \ - menu &Jump.-Sep2- : - menu &Jump.clear\ list - \:clearjumps - \ :clearjumps - - 1000menu &Tag.list - \:tags - \ :tags - 1000menu &Tag.selection\ list - \:ts - \ :ts - - 1000menu &Tag.-Sep1- : - - 1000menu &Tag.stack.jump\ older - \ - \ :po - 1000menu &Tag.stack.jump\ - \:ta - \ :ta - endif - - " autocmd BufEnter * @f - augroup END - - " autocmd VimEnter * set nobuflisted -endif - - -" ====================================================================================================================== -" SHORTCUTS: custom shortcuts -" inoremap -" inoremap - -" Bind CTRL+Backspace to vim's version (CTRL+W) in " insert mode (only works with gvim) -inoremap - \ - \ - -" INDENTATION: allows un-indenting a selected block and keeps selection -vnoremap < >gv - -" make shift-home select to the beginning of the line -nnoremap v^ -nnoremap v$ - -nnoremap vj -vnoremap j -nnoremap vk -vnoremap k - - -" close current buffer with q... -nnoremap q :bpspbnbd. -" google the word under the cursor -nnoremap G :execute ":!xdg-open https://google.de/search?q=".expand("") - -nnoremap :make! -nnoremap :silent syntax sync fromstart:nohlsearch:silent match:silent 2match:silent 3match -nnoremap r :syntax sync fromstart - -nnoremap :wincmd k -nnoremap :wincmd j -nnoremap :wincmd h -nnoremap :wincmd l - -" INSERT_MODE_MAPPINGS: -" default copy&paste insert key binding (just in insert mode, so it doesn't conflict -" with visual block mode)- would have been nice, but collides with c-w for digraphs -" inoremap + -" -inoremap :w - -" NEOVIM_SPECIFIC: -if has('nvim') " only neovim... - " shortcut \t opens a terminal in a horizontal split - nnoremap t :new +terminal -endif - - - -" ====================================================================================================================== -" START: LOADING PLUGINS -" ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ -call plug#begin() -" Colorschemes: -Plug 'coderonline/vim-remote-menu' -" Plug 'bbchung/clighter8' -" Plug 'octol/vim-cpp-enhanced-highlight' -" Plug 'vim-scripts/TagHighlight' -" if ! exists('g:TagHighlightSettings') -" let g:TagHighlightSettings = {} -" endif -" let g:TagHighlightSettings['TagFileName'] = 'tags' -" let g:TagHighlightSettings['CtagsExecutable'] = 'ctags' - -Plug 'chriskempson/base16-vim' | " not just one high quality color scheme (all named base16-*) -Plug 'NLKNguyen/papercolor-theme' | " the one I like the most - -Plug 'mhinz/vim-signify' | " uses the sign column to indicate added, modified and removed lines -Plug 'tpope/vim-fugitive' | " the most complete GIT integration plugin -Plug 'godlygeek/tabular' | " align code on a sign, like :Tab/= -Plug 'tpope/vim-surround' | " plugin makes cs"' inside a line replace " with ' -let g:signify_vcs_list = [ 'git' ] | " use signify only with git (improves speed when loading buffers, see :h signify) -let g:signify_cursorhold_insert = 0 -let g:signify_cursorhold_normal = 0 -let g:signify_update_on_bufenter = 0 -let g:signify_update_on_focusgained = 0 -let g:signify_sign_show_count = 0 - -let g:signify_sign_add = '➕' -let g:signify_sign_delete = '➖' -let g:signify_sign_delete_first_line = '➖' -let g:signify_sign_change = '❗' -let g:signify_sign_changedelete = g:signify_sign_change - - -" NERDTree: replaces NetRW, as long as it has so many bugs -Plug 'scrooloose/nerdtree' | " -let NERDTreeIgnore = ['\.aux$', '\.o$'] -let NERDTreeCascadeSingleChildDir = 0 | " I don't get how one can use to create files in that included directory -let NERDTreeChDirMode = 0 -let NERDTreeHiddenFirst = 1 -let NERDTreeMinimalUI = 1 -let NERDTreeShowBookmarks = 1 | " show bookmarks by default (when opening for the first time) -let NERDTreeWinSize = 40 -let NERDTreeQuitOnOpen = 1 - -" depending on if NERDTree has the focus: -nnoremap - \ - \ bufwinnr("%")==g:NERDTree.GetWinNum() ? ':NERDTreeClose' : ':NERDTreeFind' -nnoremap - \ - \ bufwinnr("%")==g:NERDTree.GetWinNum() ? '' : ':N' - -nnoremap - \ - \ bufwinnr("%")==g:NERDTree.GetWinNum() ? '' : ':n' - -nnoremap - \ :wincmd c -" close NERDTree if it is the last remaining window (taken from the official documentation) -" autocmd bufenter * -" \ if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif -" -" map CTRL-PageUp/Down to next/previous buffer -" and Shift-PageUp/Down to next/previous arglist file -nnoremap :bn -nnoremap :bp -nnoremap :N -nnoremap :n - -" indent within