From 3032cf7c1b595b2604f70712c7a9fe9b663c4c65 Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Tue, 15 Aug 2017 17:13:05 +0200 Subject: Replaced registers with menus --- vimrc-full | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 58 insertions(+), 10 deletions(-) (limited to 'vimrc-full') diff --git a/vimrc-full b/vimrc-full index 1b9b1f5..2a9cf88 100644 --- a/vimrc-full +++ b/vimrc-full @@ -1,6 +1,10 @@ +" vim: iskeyword+=\:,\!,\<,\>,\-,\& set textwidth=120 | " better done with modeline set ts=4 sts=4 sw=4 expandtab | " better done with a modeline +" scripts from the default vim installation, which do not get loaded by default, but are useful. +source $VIMRUNTIME/macros/editexisting.vim + "======================================================================================================================= " SETTINGS: "======================================================================================================================= @@ -396,7 +400,7 @@ function! ExtendColorTheme() highlight! PmenuThumb cterm=inverse highlight! MoreMsg cterm=inverse highlight! link Folded LineNr - highlight! Cursor guibg=green ctermbg=yellow + highlight! Cursor guibg=#729fcf ctermbg=yellow highlight! link VertSplit LineNr highlight! SpellBad ctermbg=none highlight! SpecialKey ctermfg=19 @@ -437,7 +441,7 @@ endif " SPELL_CHECKING: "======================================================================================================================= let g:spellfile_URL='http://ftp.vim.org/vim/runtime/spell' -set spell | " enable spell checker +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+=/home/max/.vim/thesaurus/php.txt @@ -652,15 +656,13 @@ if has("autocmd") augroup extra_whitespace " { highlight ExtraWhitespace ctermbg=red ctermfg=white guibg=red " autocmd BufEnter * syn match ExtraWhitespace /\s\+$/ - autocmd BufEnter * match ExtraWhitespace /\s\+$/ + " autocmd BufEnter * match ExtraWhitespace /\s\+$/ augroup END "} augroup CurrentFileName highlight CurrentFileName ctermbg=yellow guibg=yellow - let @w = ":execute ':match ColorColumn /\\%>'.&textwidth.'v./' | :2match ExtraWhitespace /\\s\\+$/" - " let @w = ":execute ':match ColorColumn /\\%>'.&textwidth.'v./'" " highlight the current files name inside the document... let @g = ":exe ':match CurrentFileName /'.escape(expand('%:t'), '.').'/'" " put the current files name after the cursor... @@ -669,12 +671,58 @@ if has("autocmd") " grep all buffers for a given string and return result in a quickfix window let @q = ":cex [] | bufdo vimgrepadd /foo/g % | cw" - " change to the current working directory (p like pwd) - let @p = ":lcd %:p:h" - let @l = ":let g:signify_vcs_cmds={'git': 'git diff --no-color --no-ext-diff -U0 HEAD^ -- %f'}|:SignifyRefresh" - let @r = ":exe ':!nvr --servername /tmp/nvimsocket --remote % +'.line('.')|:stopinsert|:set readonly" + + source $VIMRUNTIME/menu.vim + set wildmenu + set cpo-=< + set wcm= + map :emenu + + if has('menu') + + + menu &Chdir.Git\ root + \ :Gcd:pwd + + menu &Chdir.current\ buffer + \ :lcd %:p:h:pwd + + menu &Git.&Display\ last\ changes + \ :let g:signify_vcs_cmds={'git': 'git diff --no-color --no-ext-diff -U0 HEAD^ -- %f'}:SignifyRefresh + + menu &UI.&Open\ in\ Serversession + \ :execute ':!nvr --servername /tmp/nvimsocket --remote % +'.line('.'):stopinsert:set readonly + + menu &Verify.&Textwidth\ and\ white\ space + \ :execute ':match ColorColumn /\%>'.&textwidth.'v./' + \ :2match ExtraWhitespace /\s\+$/ + + menu &Verify.Highlight\ current\ file\ name + \ :execute ':match ColorColumn /'.escape(expand('%:t'), '.').'/' + + + menu &CScope.add + \ :cscope add . + + menu &Window.-Sep- : + + menu &Window.Quickfix\ List + \ :copen + + menu &Window.Location\ List + \ :lopen + + menu &Window.Scratch + \ :Scratch + + menu &Go.file\ under\ the\ cursor:gf + \ gf + + endif + + " exec current line as a command, insert output of command (from: https://youtu.be/MquaityA1SM?t=35m45s) @@ -749,7 +797,7 @@ let g:netrw_preview = 0 | " let g:netrw_winsize = 20 | " window size in percent -highlight WordBold ctermbg=LightYellow ctermfg=black cterm=bold gui=bold +highlight WordBold ctermbg=LightYellow ctermfg=black cterm=bold gui=bold guibg=LightYellow guifg=black let w:m1 = 0 function! HighlightWordUnderCursor() if(exists('w:m1') && w:m1 > 0) -- cgit v1.2.3