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. --- plugin/max-function-menu.vim | 173 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 173 insertions(+) create mode 100644 plugin/max-function-menu.vim (limited to 'plugin/max-function-menu.vim') diff --git a/plugin/max-function-menu.vim b/plugin/max-function-menu.vim new file mode 100644 index 0000000..6c7308a --- /dev/null +++ b/plugin/max-function-menu.vim @@ -0,0 +1,173 @@ +augroup MAX_FUNCTION_MENU + 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 +augroup END " MAX_FUNCTION_MENU + -- cgit v1.2.3