Mercurial > vim
comparison runtime/menu.vim @ 1648:58cad056e608 v7.2a.00
updated for version 7.2a-00
author | vimboss |
---|---|
date | Wed, 25 Jun 2008 20:13:35 +0000 |
parents | bd94e22dd3db |
children | b7c89e3e19f7 |
comparison
equal
deleted
inserted
replaced
1647:484fb4dfd452 | 1648:58cad056e608 |
---|---|
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: 2007 Nov 19 | 5 " Last Change: 2008 Jun 16 |
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 |
133 | 133 |
134 func! <SID>SelectAll() | 134 func! <SID>SelectAll() |
135 exe "norm gg" . (&slm == "" ? "VG" : "gH\<C-O>G") | 135 exe "norm gg" . (&slm == "" ? "VG" : "gH\<C-O>G") |
136 endfunc | 136 endfunc |
137 | 137 |
138 func! s:FnameEscape(fname) | |
139 if exists('*fnameescape') | |
140 return fnameescape(a:fname) | |
141 return escape(a:fname, " \t\n*?[{`$\\%#'\"|!<") | |
142 endfunc | |
138 | 143 |
139 " Edit menu | 144 " Edit menu |
140 an 20.310 &Edit.&Undo<Tab>u u | 145 an 20.310 &Edit.&Undo<Tab>u u |
141 an 20.320 &Edit.&Redo<Tab>^R <C-R> | 146 an 20.320 &Edit.&Redo<Tab>^R <C-R> |
142 an 20.330 &Edit.Rep&eat<Tab>\. . | 147 an 20.330 &Edit.Rep&eat<Tab>\. . |
191 elseif has("amiga") | 196 elseif has("amiga") |
192 let fname = "s:.vimrc" | 197 let fname = "s:.vimrc" |
193 else | 198 else |
194 let fname = "$HOME/.vimrc" | 199 let fname = "$HOME/.vimrc" |
195 endif | 200 endif |
201 let fname = s:FnameEscape(fname) | |
196 if &mod | 202 if &mod |
197 exe "split " . fname | 203 exe "split " . fname |
198 else | 204 else |
199 exe "edit " . fname | 205 exe "edit " . fname |
200 endif | 206 endif |
804 if !exists("*MenuExplOpen") | 810 if !exists("*MenuExplOpen") |
805 fun MenuExplOpen() | 811 fun MenuExplOpen() |
806 if @% == "" | 812 if @% == "" |
807 20vsp . | 813 20vsp . |
808 else | 814 else |
809 exe "20vsp " . expand("%:p:h") | 815 exe "20vsp " . s:FnameEscape(expand("%:p:h")) |
810 endif | 816 endif |
811 endfun | 817 endfun |
812 endif | 818 endif |
813 endif | 819 endif |
814 an 70.335 &Window.-SEP1- <Nop> | 820 an 70.335 &Window.-SEP1- <Nop> |
1026 endif | 1032 endif |
1027 | 1033 |
1028 " Select a session to load; default to current session name if present | 1034 " Select a session to load; default to current session name if present |
1029 fun! s:LoadVimSesn() | 1035 fun! s:LoadVimSesn() |
1030 if strlen(v:this_session) > 0 | 1036 if strlen(v:this_session) > 0 |
1031 let name = escape(v:this_session, ' \t#%$|<>"*?[{`') | 1037 let name = s:FnameEscape(v:this_session) |
1032 else | 1038 else |
1033 let name = "Session.vim" | 1039 let name = "Session.vim" |
1034 endif | 1040 endif |
1035 execute "browse so " . name | 1041 execute "browse so " . name |
1036 endfun | 1042 endfun |
1038 " Select a session to save; default to current session name if present | 1044 " Select a session to save; default to current session name if present |
1039 fun! s:SaveVimSesn() | 1045 fun! s:SaveVimSesn() |
1040 if strlen(v:this_session) == 0 | 1046 if strlen(v:this_session) == 0 |
1041 let v:this_session = "Session.vim" | 1047 let v:this_session = "Session.vim" |
1042 endif | 1048 endif |
1043 execute "browse mksession! " . escape(v:this_session, ' \t#%$|<>"*?[{`') | 1049 execute "browse mksession! " . s:FnameEscape(v:this_session) |
1044 endfun | 1050 endfun |
1045 | 1051 |
1046 endif | 1052 endif |
1047 | 1053 |
1048 endif " !exists("did_install_default_menus") | 1054 endif " !exists("did_install_default_menus") |