1 " System gvimrc file for MacVim
3 " Maintainer: Bjorn Winckler <bjorn.winckler@gmail.com>
4 " Last Change: Sun Mar 15 2009
6 " This is a work in progress. If you feel so inclined, please help me improve
10 " Make sure the '<' and 'C' flags are not included in 'cpoptions', otherwise
11 " <CR> would not be recognized. See ":help 'cpoptions'".
17 " Global default options
20 if !exists("syntax_on")
24 if !exists("colors_name")
25 " Use the macvim color scheme by default
29 " To make tabs more readable, the label only contains the tail of the file
30 " name and the buffer modified flag.
34 " Send print jobs to Preview.app. This does not delete the temporary ps file
35 " that is generated by :hardcopy.
36 set printexpr=system('open\ -a\ Preview\ '.v:fname_in)\ +\ v:shell_error
47 aunmenu File.Open\.\.\.
51 aunmenu File.Save-Exit
53 an <silent> 10.290 File.New\ Window <Nop>
54 an 10.295 File.New\ Tab :tabnew<CR>
55 an <silent> 10.310 File.Open\.\.\. <Nop>
56 an <silent> 10.325 File.Open\ Recent <Nop>
57 an 10.328 File.-SEP0- <Nop>
58 an <silent> 10.330 File.Close\ Window<Tab>:qa :conf qa<CR>
59 an <silent> 10.332 File.Close :conf q<CR>
60 an <silent> 10.341 File.Save\ All :browse conf wa<CR>
61 an 10.350 File.Save\ As\.\.\.<Tab>:sav :browse confirm saveas<CR>
66 " The following function is aken from menu.vim
68 " Fix text in nameless register to be used with :promptfind.
69 return substitute(@", "[\r\n]", '\\n', 'g')
73 aunmenu Edit.Find\ and\ Replace
75 an <silent> 20.410.10 Edit.Find.Find\.\.\. :promptfind<CR>
76 vunmenu Edit.Find.Find\.\.\.
77 vnoremenu <silent> Edit.Find.Find\.\.\. y:promptfind <C-R>=<SID>FixFText()<CR><CR>
78 an 20.410.20 Edit.Find.Find\ Next <Nop>
79 an 20.410.30 Edit.Find.Find\ Previous <Nop>
80 vmenu 20.410.35 Edit.Find.Use\ Selection\ for\ Find y:let @/=@"<CR>:<BS>
82 an 20.460 Edit.-SEP4- <Nop>
83 an 20.465.10 Edit.Font.Show\ Fonts <Nop>
84 an 20.465.20 Edit.Font.-SEP5- <Nop>
85 an 20.465.30 Edit.Font.Bigger <Nop>
86 an 20.465.40 Edit.Font.Smaller <Nop>
87 an 20.470 Edit.Special\ Characters\.\.\. <Nop>
90 " Window menu (should be next to Help so give it a high priority)
93 an <silent> 9900.300 Window.Minimize <Nop>
94 an <silent> 9900.301 Window.Minimize\ All <Nop>
95 an <silent> 9900.310 Window.Zoom <Nop>
96 an <silent> 9900.311 Window.Zoom\ All <Nop>
97 an <silent> 9900.320 Window.Toggle\ Full\ Screen\ Mode :set invfullscreen<CR>
98 an 9900.330 Window.-SEP1- <Nop>
99 " TODO! Grey out if no tabs are visible.
100 an <silent> 9900.340 Window.Select\ Next\ Tab :tabnext<CR>
101 an <silent> 9900.350 Window.Select\ Previous\ Tab :tabprevious<CR>
102 an 9900.360 Window.-SEP2- <Nop>
103 an <silent> 9900.370 Window.Bring\ All\ To\ Front <Nop>
107 an 9999.1 Help.MacVim\ Help :h gui_mac<CR>
108 an <silent> 9999.2 Help.MacVim\ Website <Nop>
109 an 9999.3 Help.-sep0- <Nop>
115 " These items are special ('*' means zero or more arbitrary characters):
116 " -space*- an empty space
117 " -flexspace*- a flexible space
118 " -*- a separator item
120 " Remove some items so that all items are visible at the default window size.
121 "aunmenu ToolBar.Undo
122 "aunmenu ToolBar.Redo
123 "aunmenu ToolBar.-sep2-
125 "aunmenu ToolBar.Copy
126 "aunmenu ToolBar.Paste
127 "aunmenu ToolBar.-sep3-
128 aunmenu ToolBar.Replace
129 aunmenu ToolBar.FindNext
130 aunmenu ToolBar.FindPrev
131 aunmenu ToolBar.-sep5-
132 aunmenu ToolBar.-sep6-
133 aunmenu ToolBar.RunCtags
134 aunmenu ToolBar.TagJump
135 "aunmenu ToolBar.-sep7-
136 aunmenu ToolBar.FindHelp
138 "an 1.295 ToolBar.-flexspace7- <Nop>
142 " This is so that HIG Cmd and Option movement mappings can be disabled by
144 " let macvim_skip_cmd_opt_movement = 1
147 if !exists("macvim_skip_cmd_opt_movement")
151 no! <M-Left> <C-Left>
155 no <M-Right> <C-Right>
156 no! <M-Right> <C-Right>
170 endif " !exists("macvim_skip_cmd_opt_movement")
173 " This is so that the HIG shift movement related settings can be enabled by
175 " let macvim_hig_shift_movement = 1
176 " to the user .vimrc (not .gvimrc!).
178 if exists("macvim_hig_shift_movement")
179 " Shift + special movement key (<S-Left>, etc.) and mouse starts insert mode
180 set selectmode=mouse,key
181 set keymodel=startsel,stopsel
183 " HIG related shift + special movement key mappings
184 nn <S-D-Left> <S-Home>
185 vn <S-D-Left> <S-Home>
186 ino <S-D-Left> <S-Home>
187 nn <S-M-Left> <S-C-Left>
188 vn <S-M-Left> <S-C-Left>
189 ino <S-M-Left> <S-C-Left>
191 nn <S-D-Right> <S-End>
192 vn <S-D-Right> <S-End>
193 ino <S-D-Right> <S-End>
194 nn <S-M-Right> <S-C-Right>
195 vn <S-M-Right> <S-C-Right>
196 ino <S-M-Right> <S-C-Right>
198 nn <S-D-Up> <S-C-Home>
199 vn <S-D-Up> <S-C-Home>
200 ino <S-D-Up> <S-C-Home>
202 nn <S-D-Down> <S-C-End>
203 vn <S-D-Down> <S-C-End>
204 ino <S-D-Down> <S-C-End>
205 endif " exists("macvim_hig_shift_movement")
210 " Set up menu key equivalents (these should always have the 'D' modifier set),
211 " action bindings, and alternate items.
213 " Note: menu items which should execute an action are bound to <Nop>; the
214 " action message is specified here via the :macmenu command.
217 macm File.New\ Window key=<D-n> action=newWindow:
218 macm File.New\ Tab key=<D-t>
219 macm File.Open\.\.\. key=<D-o> action=fileOpen:
220 macm File.Open\ Tab\.\.\. key=<D-T>
221 macm File.Open\ Recent action=recentFilesDummy:
222 macm File.Close\ Window key=<D-W>
223 macm File.Close key=<D-w> action=performClose:
224 macm File.Save key=<D-s>
225 macm File.Save\ All key=<D-M-s> alt=YES
226 macm File.Save\ As\.\.\. key=<D-S>
227 macm File.Print key=<D-p>
229 macm Edit.Undo key=<D-z> action=undo:
230 macm Edit.Redo key=<D-Z> action=redo:
231 macm Edit.Cut key=<D-x> action=cut:
232 macm Edit.Copy key=<D-c> action=copy:
233 macm Edit.Paste key=<D-v> action=paste:
234 macm Edit.Select\ All key=<D-a> action=selectAll:
235 macm Edit.Find.Find\.\.\. key=<D-f>
236 macm Edit.Find.Find\ Next key=<D-g> action=findNext:
237 macm Edit.Find.Find\ Previous key=<D-G> action=findPrevious:
238 macm Edit.Find.Use\ Selection\ for\ Find key=<D-e>
239 macm Edit.Special\ Characters\.\.\. key=<D-M-t>
240 macm Edit.Font.Show\ Fonts action=orderFrontFontPanel:
241 macm Edit.Font.Bigger key=<D-=> action=fontSizeUp:
242 macm Edit.Font.Smaller key=<D--> action=fontSizeDown:
243 macm Edit.Special\ Characters\.\.\. action=orderFrontCharacterPalette:
245 macm Tools.Spelling.To\ Next\ error key=<D-;>
246 macm Tools.Spelling.Suggest\ Corrections key=<D-:>
247 macm Tools.Make key=<D-b>
248 macm Tools.List\ Errors key=<D-l>
249 macm Tools.List\ Messages key=<D-L>
250 macm Tools.Next\ Error key=<D-C-Right>
251 macm Tools.Previous\ Error key=<D-C-Left>
252 macm Tools.Older\ List key=<D-C-Up>
253 macm Tools.Newer\ List key=<D-C-Down>
255 macm Window.Minimize key=<D-m> action=performMiniaturize:
256 macm Window.Minimize\ All key=<D-M-m> action=miniaturizeAll: alt=YES
257 macm Window.Zoom key=<D-C-z> action=performZoom:
258 macm Window.Zoom\ All key=<D-M-C-z> action=zoomAll: alt=YES
259 macm Window.Toggle\ Full\ Screen\ Mode key=<D-F>
260 macm Window.Select\ Next\ Tab key=<D-}>
261 macm Window.Select\ Previous\ Tab key=<D-{>
262 macm Window.Bring\ All\ To\ Front action=arrangeInFront:
264 macm Help.MacVim\ Help key=<D-?>
265 macm Help.MacVim\ Website action=openWebsite:
267 " Restore the previous value of 'cpoptions'.
268 let &cpo = s:cpo_save