aboutsummaryrefslogtreecommitdiff
path: root/plugin/max-function-menu.vim
blob: b981997ff56842940599e98a2d2eff23b7165cee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
augroup MAX_FUNCTION_MENU
    if has('menu')
        source $VIMRUNTIME/menu.vim
        set wildmenu
        set cpo-=<
        set wcm=<C-Z>

        01menu &Functions.toggle\ file\ browser
                    \<Tab><leader><leader>
                    \ <leader><leader>
        01menu &Functions.-Sep0- :

        01menu &Functions.help
                    \<Tab><F1>
                    \ <F1>
        01menu &Functions.bp:\ previous\ buffer
                    \<Tab><F2>
                    \ <F2>
        01menu &Functions.bn:\ next\ buffer
                    \<Tab><F3>
                    \ <F3>
        01menu &Functions.^wc\:\ close\ window
                    \<Tab><F4>
                    \ <F4>
        01menu &Functions.-Sep1- :

        01menu &Functions.make
                    \<Tab><F5>
                    \ <F5>
        01menu &Functions.clear\ matches,\ update\ viewport
                    \<Tab><F6>
                    \ <F6>
        01menu &Functions.copen\:\ show\ quickfix\ list
                    \<Tab><F7>
                    \ <F7>
        01menu &Functions.lopen\:\ show\ location\ list
                    \<Tab><F8>
                    \ <F8>
        01menu &Functions.-Sep2- :

        01menu &Functions.toggle\ tagbar
                    \<Tab><F9>
                    \ <F9>

        if has("gui_running") == 0
            " in the gui F10 already triggers the menu, not in a terminal vim, so upgrade that...
            map <F10> :emenu <C-Z>
        endif
        01menu &Functions.activate\ menu\ (:emenu)
                    \<Tab><F10>
                    \ <F10>

        01menu &Functions.undef11
                    \<Tab><F11>
                    \ <F11>
        01menu &Functions.undef12
                    \<Tab><F12>
                    \ <F12>
        01menu &Functions.-Sep2- :


        09menu &Directory.print\ current\ directory
                    \<Tab>:pwd
                    \ :pwd<CR>

        09menu &Directory.-Sep- :

        09menu &Directory.Change\ to\ GIT\ root
                    \<Tab>:Gcd
                    \ :Gcd<CR>:pwd<CR>

        09menu &Directory.Change\ to\ current\ buffers\ directory\ (global)
                    \<tab>:cd\ %:p:h
                    \ :cd %:h<CR>:pwd<CR>

        09menu &Directory.Change\ to\ current\ buffers\ directory\ (local\ window)<tab>:lcd\ %:p:h
                    \ :lcd %:p:h<CR>:pwd<CR>

        menu &Git.&Display\ uncommited\ files\ in\ location\ list
                    \ :call setloclist(0, map(systemlist("git diff --name-only --pretty=''"), {_, p->{'filename': fnamemodify(p, ':.')}}))<CR>:lopen<CR>
        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, ':.')}}) })<CR>:copen<CR>
        menu &Git.&Display\ last\ changes
                    \ :let g:signify_vcs_cmds={'git': 'git diff --no-color --no-ext-diff -U0 HEAD^ -- %f', 'svn': '', 'cvs': ''}<CR>:SignifyRefresh<CR>
        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, ':.')}}))<CR>:lopen<CR>
        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
                    \<Tab><F6>
                    \ :call clearmatches()<CR>

        menu &Match.-Sep- :

        menu &Match.&dispensable\ white\ spaces
                    \ :call matchadd("Convention", '\s\+$', 0)<CR>

        menu &Match.&long\ lines\ (exeeding\ textwidth)
                    \ :call matchadd("Convention", '\%>'.&textwidth.'v.', 0)<CR>

        menu &Match.Highlight\ current\ file\ name
                    \ :call matchadd("Search", escape(expand('%:t'), '.'))<CR>

        " :execute ':match SpellBad /'.escape(expand('%:t'), '.').'/'<CR>

        menu &Window.-Sep- :


        menu &Window.Scratch
                    \ :Scratch<CR>


        menu &Find.file\ under\ the\ cursor
                    \<Tab>gf
                    \ gf

        menu &Find.Open\ search\ results\ in\ location\ list
                    \<Tab>:gf
                    \ :execute ':vimgrep /'.escape(getreg('/'), '.').'/g %'<CR>
                    \ :copen<CR>

        menu &Changes.list
                    \<Tab>:changes
                    \ :changes<CR>
        menu &Changes.-Sep- :
        menu &Changes.previous
                    \<Tab>g;
                    \ g;
        menu &Changes.next
                    \<Tab>g,
                    \ g,
        menu &List.location.signs\ to\ list
                    \<Tab>CMD
                    \ :execute ":call setloclist(0, map(get(getbufinfo('%')[0], 'signs'), {_, p->extend(p, {'bufnr':buffer_number('.'), 'text':get(p, 'name')})}))"<CR>
        menu &List.location.list\ to\ signs
                    \<Tab>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('%')})))<CR>
        menu &Jump.list
                    \<Tab>:jumps
                    \ :jumps<CR>
        menu &Jump.-Sep1- :
        menu &Jump.previous\ position
                    \<Tab>CTRL-O
                    \ <C-O>
        menu &Jump.next\ position
                    \<Tab>CTRL-I
                    \ <C-I>
        menu &Jump.-Sep2- :
        menu &Jump.clear\ list
                    \<Tab>:clearjumps
                    \ :clearjumps

        1000menu &Tag.list
                    \<Tab>:tags
                    \ :tags<CR>
        1000menu &Tag.selection\ list
                    \<Tab>:ts
                    \ :ts<CR>

        1000menu &Tag.-Sep1- :

        1000menu &Tag.stack.jump\ older
                    \<Tab><C-T>
                    \ :po
        1000menu &Tag.stack.jump\
                    \<Tab>:ta
                    \ :ta
    endif
augroup END " MAX_FUNCTION_MENU

..