comparison runtime/menu.vim @ 719:82ef0c58b012

updated for version 7.0219
author vimboss
date Thu, 09 Mar 2006 22:32:39 +0000
parents 0f9f4761ad9c
children 23f82b5d2814
comparison
equal deleted inserted replaced
718:7b21554be7a1 719:82ef0c58b012
1 " Vim support file to define the default menus 1 " Vim support file to define the default menus
2 " You can also use this as a start for your own set of menus. 2 " You can also use this as a start for your own set of menus.
3 " 3 "
4 " Maintainer: Bram Moolenaar <Bram@vim.org> 4 " Maintainer: Bram Moolenaar <Bram@vim.org>
5 " Last Change: 2006 Mar 05 5 " Last Change: 2006 Mar 09
6 6
7 " Note that ":an" (short for ":anoremenu") is often used to make a menu work 7 " Note that ":an" (short for ":anoremenu") is often used to make a menu work
8 " in all modes and avoid side effects from mappings defined by the user. 8 " in all modes and avoid side effects from mappings defined by the user.
9 9
10 " Make sure the '<' and 'C' flags are not included in 'cpoptions', otherwise 10 " Make sure the '<' and 'C' flags are not included in 'cpoptions', otherwise
129 endif 129 endif
130 an 10.600 &File.-SEP4- <Nop> 130 an 10.600 &File.-SEP4- <Nop>
131 an 10.610 &File.Sa&ve-Exit<Tab>:wqa :confirm wqa<CR> 131 an 10.610 &File.Sa&ve-Exit<Tab>:wqa :confirm wqa<CR>
132 an 10.620 &File.E&xit<Tab>:qa :confirm qa<CR> 132 an 10.620 &File.E&xit<Tab>:qa :confirm qa<CR>
133 133
134 " Pasting blockwise and linewise selections is not possible in Insert and
135 " Visual mode without the +virtualedit feature. They are pasted as if they
136 " were characterwise instead. Add to that some tricks to leave the cursor in
137 " the right position, also for "gi".
138 " Note: the same stuff appears in mswin.vim.
139 if has("virtualedit")
140 let s:paste_cmd = ":call <SID>Paste()<CR>"
141 func! <SID>Paste()
142 let ove = &ve
143 set ve=all
144 normal! `^
145 if @+ != ''
146 normal! "+gP
147 endif
148 let c = col(".")
149 normal! i
150 if col(".") < c " compensate for i<ESC> moving the cursor left
151 normal! l
152 endif
153 let &ve = ove
154 endfunc
155 else
156 let s:paste_cmd = "\"=@+.'xy'<CR>gPFx\"_2x"
157 endif
158
159 " Define the string to use for items that are present both in Edit, Popup and
160 " Toolbar menu.
161 if has("virtualedit")
162 let s:paste_v_cmd = '"-c<Esc>' . s:paste_cmd
163 let s:paste_i_cmd = '<Esc>' . s:paste_cmd . 'gi'
164 else
165 let s:paste_v_cmd = '"-c<Esc>gix<Esc>' . s:paste_cmd . '"_x'
166 let s:paste_i_cmd = 'x<Esc>' . s:paste_cmd . '"_s'
167 endif
168
169 func! <SID>SelectAll() 134 func! <SID>SelectAll()
170 exe "norm gg" . (&slm == "" ? "VG" : "gH\<C-O>G") 135 exe "norm gg" . (&slm == "" ? "VG" : "gH\<C-O>G")
171 endfunc 136 endfunc
172 137
173 138
180 vnoremenu 20.340 &Edit.Cu&t<Tab>"+x "+x 145 vnoremenu 20.340 &Edit.Cu&t<Tab>"+x "+x
181 vnoremenu 20.350 &Edit.&Copy<Tab>"+y "+y 146 vnoremenu 20.350 &Edit.&Copy<Tab>"+y "+y
182 cnoremenu 20.350 &Edit.&Copy<Tab>"+y <C-Y> 147 cnoremenu 20.350 &Edit.&Copy<Tab>"+y <C-Y>
183 nnoremenu 20.360 &Edit.&Paste<Tab>"+gP "+gP 148 nnoremenu 20.360 &Edit.&Paste<Tab>"+gP "+gP
184 cnoremenu &Edit.&Paste<Tab>"+gP <C-R>+ 149 cnoremenu &Edit.&Paste<Tab>"+gP <C-R>+
185 exe 'vnoremenu <script> &Edit.&Paste<Tab>"+gP ' . s:paste_v_cmd 150 exe 'vnoremenu <script> &Edit.&Paste<Tab>"+gP ' . paste#paste_cmd['v']
186 exe 'inoremenu <script> &Edit.&Paste<Tab>"+gP ' . s:paste_i_cmd 151 exe 'inoremenu <script> &Edit.&Paste<Tab>"+gP ' . paste#paste_cmd['i']
187 nnoremenu 20.370 &Edit.Put\ &Before<Tab>[p [p 152 nnoremenu 20.370 &Edit.Put\ &Before<Tab>[p [p
188 inoremenu &Edit.Put\ &Before<Tab>[p <C-O>[p 153 inoremenu &Edit.Put\ &Before<Tab>[p <C-O>[p
189 nnoremenu 20.380 &Edit.Put\ &After<Tab>]p ]p 154 nnoremenu 20.380 &Edit.Put\ &After<Tab>]p ]p
190 inoremenu &Edit.Put\ &After<Tab>]p <C-O>]p 155 inoremenu &Edit.Put\ &After<Tab>]p <C-O>]p
191 if has("win32") || has("win16") 156 if has("win32") || has("win16")
197 162
198 an 20.405 &Edit.-SEP2- <Nop> 163 an 20.405 &Edit.-SEP2- <Nop>
199 if has("win32") || has("win16") || has("gui_gtk") || has("gui_kde") || has("gui_motif") 164 if has("win32") || has("win16") || has("gui_gtk") || has("gui_kde") || has("gui_motif")
200 an 20.410 &Edit.&Find\.\.\. :promptfind<CR> 165 an 20.410 &Edit.&Find\.\.\. :promptfind<CR>
201 vunmenu &Edit.&Find\.\.\. 166 vunmenu &Edit.&Find\.\.\.
202 vnoremenu <silent> &Edit.&Find\.\.\. y:call <SID>FixFText()<CR>:promptfind <C-R>"<CR> 167 vnoremenu <silent> &Edit.&Find\.\.\. y:promptfind <C-R>=<SID>FixFText()<CR><CR>
203 an 20.420 &Edit.Find\ and\ Rep&lace\.\.\. :promptrepl<CR> 168 an 20.420 &Edit.Find\ and\ Rep&lace\.\.\. :promptrepl<CR>
204 vunmenu &Edit.Find\ and\ Rep&lace\.\.\. 169 vunmenu &Edit.Find\ and\ Rep&lace\.\.\.
205 vnoremenu <silent> &Edit.Find\ and\ Rep&lace\.\.\. y:call <SID>FixFText()<CR>:promptrepl <C-R>"<CR> 170 vnoremenu <silent> &Edit.Find\ and\ Rep&lace\.\.\. y:promptrepl <C-R>=<SID>FixFText()<CR><CR>
206 else 171 else
207 an 20.410 &Edit.&Find<Tab>/ / 172 an 20.410 &Edit.&Find<Tab>/ /
208 an 20.420 &Edit.Find\ and\ Rep&lace<Tab>:%s :%s/ 173 an 20.420 &Edit.Find\ and\ Rep&lace<Tab>:%s :%s/
209 vunmenu &Edit.Find\ and\ Rep&lace<Tab>:%s 174 vunmenu &Edit.Find\ and\ Rep&lace<Tab>:%s
210 vnoremenu &Edit.Find\ and\ Rep&lace<Tab>:s :s/ 175 vnoremenu &Edit.Find\ and\ Rep&lace<Tab>:s :s/
213 an 20.425 &Edit.-SEP3- <Nop> 178 an 20.425 &Edit.-SEP3- <Nop>
214 an 20.430 &Edit.Settings\ &Window :options<CR> 179 an 20.430 &Edit.Settings\ &Window :options<CR>
215 180
216 fun! s:FixFText() 181 fun! s:FixFText()
217 " Fix text in nameless register to be used with :promptfind. 182 " Fix text in nameless register to be used with :promptfind.
218 let @" = substitute(@", "[\r\n]", '\\n', 'g') 183 return substitute(@", "[\r\n]", '\\n', 'g')
219 endfun 184 endfun
220 185
221 " Edit/Global Settings 186 " Edit/Global Settings
222 an 20.440.100 &Edit.&Global\ Settings.Toggle\ Pattern\ &Highlight<Tab>:set\ hls! :set hls! hls?<CR> 187 an 20.440.100 &Edit.&Global\ Settings.Toggle\ Pattern\ &Highlight<Tab>:set\ hls! :set hls! hls?<CR>
223 an 20.440.110 &Edit.&Global\ Settings.Toggle\ &Ignore-case<Tab>:set\ ic! :set ic! ic?<CR> 188 an 20.440.110 &Edit.&Global\ Settings.Toggle\ &Ignore-case<Tab>:set\ ic! :set ic! ic?<CR>
849 vnoremenu 1.20 PopUp.Cu&t "+x 814 vnoremenu 1.20 PopUp.Cu&t "+x
850 vnoremenu 1.30 PopUp.&Copy "+y 815 vnoremenu 1.30 PopUp.&Copy "+y
851 cnoremenu 1.30 PopUp.&Copy <C-Y> 816 cnoremenu 1.30 PopUp.&Copy <C-Y>
852 nnoremenu 1.40 PopUp.&Paste "+gP 817 nnoremenu 1.40 PopUp.&Paste "+gP
853 cnoremenu 1.40 PopUp.&Paste <C-R>+ 818 cnoremenu 1.40 PopUp.&Paste <C-R>+
854 exe 'vnoremenu <script> 1.40 PopUp.&Paste ' . s:paste_v_cmd 819 exe 'vnoremenu <script> 1.40 PopUp.&Paste ' . paste#paste_cmd['v']
855 exe 'inoremenu <script> 1.40 PopUp.&Paste ' . s:paste_i_cmd 820 exe 'inoremenu <script> 1.40 PopUp.&Paste ' . paste#paste_cmd['i']
856 vnoremenu 1.50 PopUp.&Delete x 821 vnoremenu 1.50 PopUp.&Delete x
857 an 1.55 PopUp.-SEP2- <Nop> 822 an 1.55 PopUp.-SEP2- <Nop>
858 vnoremenu 1.60 PopUp.Select\ Blockwise <C-V> 823 vnoremenu 1.60 PopUp.Select\ Blockwise <C-V>
859 824
860 nnoremenu 1.70 PopUp.Select\ &Word vaw 825 nnoremenu 1.70 PopUp.Select\ &Word vaw
974 vnoremenu 1.70 ToolBar.Cut "+x 939 vnoremenu 1.70 ToolBar.Cut "+x
975 vnoremenu 1.80 ToolBar.Copy "+y 940 vnoremenu 1.80 ToolBar.Copy "+y
976 cnoremenu 1.80 ToolBar.Copy <C-Y> 941 cnoremenu 1.80 ToolBar.Copy <C-Y>
977 nnoremenu 1.90 ToolBar.Paste "+gP 942 nnoremenu 1.90 ToolBar.Paste "+gP
978 cnoremenu ToolBar.Paste <C-R>+ 943 cnoremenu ToolBar.Paste <C-R>+
979 exe 'vnoremenu <script> ToolBar.Paste ' . s:paste_v_cmd 944 exe 'vnoremenu <script> ToolBar.Paste ' . paste#paste_cmd['v']
980 exe 'inoremenu <script> ToolBar.Paste ' . s:paste_i_cmd 945 exe 'inoremenu <script> ToolBar.Paste ' . paste#paste_cmd['i']
981 946
982 if !has("gui_athena") 947 if !has("gui_athena")
983 an 1.95 ToolBar.-sep3- <Nop> 948 an 1.95 ToolBar.-sep3- <Nop>
984 an 1.100 ToolBar.Replace :promptrepl<CR> 949 an 1.100 ToolBar.Replace :promptrepl<CR>
985 vunmenu ToolBar.Replace 950 vunmenu ToolBar.Replace
986 vnoremenu ToolBar.Replace y:promptrepl <C-R>"<CR> 951 vnoremenu ToolBar.Replace y:promptrepl <C-R>=<SID>FixFText()<CR><CR>
987 an 1.110 ToolBar.FindNext n 952 an 1.110 ToolBar.FindNext n
988 an 1.120 ToolBar.FindPrev N 953 an 1.120 ToolBar.FindPrev N
989 endif 954 endif
990 955
991 an 1.215 ToolBar.-sep5- <Nop> 956 an 1.215 ToolBar.-sep5- <Nop>
1097 an 50.720 &Syntax.&Highlight\ test :runtime syntax/hitest.vim<CR> 1062 an 50.720 &Syntax.&Highlight\ test :runtime syntax/hitest.vim<CR>
1098 an 50.730 &Syntax.&Convert\ to\ HTML :runtime syntax/2html.vim<CR> 1063 an 50.730 &Syntax.&Convert\ to\ HTML :runtime syntax/2html.vim<CR>
1099 1064
1100 endif " !exists("did_install_syntax_menu") 1065 endif " !exists("did_install_syntax_menu")
1101 1066
1102 unlet! s:paste_i_cmd s:paste_v_cmd s:paste_cmd
1103
1104 " Restore the previous value of 'cpoptions'. 1067 " Restore the previous value of 'cpoptions'.
1105 let &cpo = s:cpo_save 1068 let &cpo = s:cpo_save
1106 unlet s:cpo_save 1069 unlet s:cpo_save
1107 1070
1108 " vim: set sw=2 : 1071 " vim: set sw=2 :