aboutsummaryrefslogtreecommitdiff
path: root/plugin/max-function-menu.vim
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/max-function-menu.vim')
-rw-r--r--plugin/max-function-menu.vim173
1 files changed, 173 insertions, 0 deletions
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 @@
1augroup MAX_FUNCTION_MENU
2 if has('menu')
3 source $VIMRUNTIME/menu.vim
4 set wildmenu
5 set cpo-=<
6 set wcm=<C-Z>
7
8 01menu &Functions.toggle\ file\ browser
9 \<Tab><leader><leader>
10 \ <leader><leader>
11 01menu &Functions.-Sep0- :
12
13 01menu &Functions.help
14 \<Tab><F1>
15 \ <F1>
16 01menu &Functions.bp:\ previous\ buffer
17 \<Tab><F2>
18 \ <F2>
19 01menu &Functions.bn:\ next\ buffer
20 \<Tab><F3>
21 \ <F3>
22 01menu &Functions.^wc\:\ close\ window
23 \<Tab><F4>
24 \ <F4>
25 01menu &Functions.-Sep1- :
26
27 01menu &Functions.make
28 \<Tab><F5>
29 \ <F5>
30 01menu &Functions.clear\ matches,\ update\ viewport
31 \<Tab><F6>
32 \ <F6>
33 01menu &Functions.copen\:\ show\ quickfix\ list
34 \<Tab><F7>
35 \ <F7>
36 01menu &Functions.lopen\:\ show\ location\ list
37 \<Tab><F8>
38 \ <F8>
39 01menu &Functions.-Sep2- :
40
41 01menu &Functions.toggle\ tagbar
42 \<Tab><F9>
43 \ <F9>
44
45 if has("gui_running") == 0
46 " in the gui F10 already triggers the menu, not in a terminal vim, so upgrade that...
47 map <F10> :emenu <C-Z>
48 endif
49 01menu &Functions.activate\ menu\ (:emenu)
50 \<Tab><F10>
51 \ <F10>
52
53 01menu &Functions.undef11
54 \<Tab><F11>
55 \ <F11>
56 01menu &Functions.undef12
57 \<Tab><F12>
58 \ <F12>
59 01menu &Functions.-Sep2- :
60
61
62 09menu &Directory.print\ current\ directory
63 \<Tab>:pwd
64 \ :pwd<CR>
65
66 09menu &Directory.-Sep- :
67
68 09menu &Directory.Change\ to\ GIT\ root
69 \<Tab>:Gcd
70 \ :Gcd<CR>:pwd<CR>
71
72 09menu &Directory.Change\ to\ current\ buffers\ directory\ (global)
73 \<tab>:cd\ %:p:h
74 \ :cd %:h<CR>:pwd<CR>
75
76 09menu &Directory.Change\ to\ current\ buffers\ directory\ (local\ window)<tab>:lcd\ %:p:h
77 \ :lcd %:p:h<CR>:pwd<CR>
78
79 menu &Git.&Display\ uncommited\ files\ in\ location\ list
80 \ :call setloclist(0, map(systemlist("git diff --name-only --pretty=''"), {_, p->{'filename': fnamemodify(p, ':.')}}))<CR>:lopen<CR>
81 menu &Git.&Display\ recently\ changed\ files\ in\ quickfix\ list
82 \ :call setqflist([], 'r', {'title': 'Recently changed in GIT', 'items':map(systemlist("git show --name-only --pretty=''"), {_, p->{'filename': fnamemodify(p, ':.')}}) })<CR>:copen<CR>
83 menu &Git.&Display\ last\ changes
84 \ :let g:signify_vcs_cmds={'git': 'git diff --no-color --no-ext-diff -U0 HEAD^ -- %f'}<CR>:SignifyRefresh<CR>
85 menu &Git.&Display\ unmerged\ files\ in\ location\ list
86 \ :call setloclist(0, map(systemlist("git diff --name-only --diff-filter=U \| uniq"), {_, p->{'filename': fnamemodify(p, ':.')}}))<CR>:lopen<CR>
87 menu &Git.&Display\ significance\ of\ changes
88 \ :!git diff --stat HEAD~1..HEAD
89 menu &Git.&Display\ Changed\ files\ compared\ to\ master
90 \ :!git diff --name-status ..master
91
92 menu &Match.Clear\ All\ Matches
93 \<Tab><F6>
94 \ :call clearmatches()<CR>
95
96 menu &Match.-Sep- :
97
98 menu &Match.&dispensable\ white\ spaces
99 \ :call matchadd("Convention", '\s\+$', 0)<CR>
100
101 menu &Match.&long\ lines\ (exeeding\ textwidth)
102 \ :call matchadd("Convention", '\%>'.&textwidth.'v.', 0)<CR>
103
104 menu &Match.Highlight\ current\ file\ name
105 \ :call matchadd("Search", escape(expand('%:t'), '.'))<CR>
106
107 " :execute ':match SpellBad /'.escape(expand('%:t'), '.').'/'<CR>
108
109 menu &Window.-Sep- :
110
111
112 menu &Window.Scratch
113 \ :Scratch<CR>
114
115
116 menu &Find.file\ under\ the\ cursor
117 \<Tab>gf
118 \ gf
119
120 menu &Find.Open\ search\ results\ in\ location\ list
121 \<Tab>:gf
122 \ :execute ':vimgrep /'.escape(getreg('/'), '.').'/g %'<CR>
123 \ :copen<CR>
124
125 menu &Changes.list
126 \<Tab>:changes
127 \ :changes<CR>
128 menu &Changes.-Sep- :
129 menu &Changes.previous
130 \<Tab>g;
131 \ g;
132 menu &Changes.next
133 \<Tab>g,
134 \ g,
135 menu &List.location.signs\ to\ list
136 \<Tab>CMD
137 \ :execute ":call setloclist(0, map(get(getbufinfo('%')[0], 'signs'), {_, p->extend(p, {'bufnr':buffer_number('.'), 'text':get(p, 'name')})}))"<CR>
138 menu &List.location.list\ to\ signs
139 \<Tab>CMD
140 \ :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('%')})))<CR>
141 menu &Jump.list
142 \<Tab>:jumps
143 \ :jumps<CR>
144 menu &Jump.-Sep1- :
145 menu &Jump.previous\ position
146 \<Tab>CTRL-O
147 \ <C-O>
148 menu &Jump.next\ position
149 \<Tab>CTRL-I
150 \ <C-I>
151 menu &Jump.-Sep2- :
152 menu &Jump.clear\ list
153 \<Tab>:clearjumps
154 \ :clearjumps
155
156 1000menu &Tag.list
157 \<Tab>:tags
158 \ :tags<CR>
159 1000menu &Tag.selection\ list
160 \<Tab>:ts
161 \ :ts<CR>
162
163 1000menu &Tag.-Sep1- :
164
165 1000menu &Tag.stack.jump\ older
166 \<Tab><C-T>
167 \ :po
168 1000menu &Tag.stack.jump\
169 \<Tab>:ta
170 \ :ta
171 endif
172augroup END " MAX_FUNCTION_MENU
173
..