1 " System gvimrc file for MacVim
3 " Maintainer: Bjorn Winckler <bjorn.winckler@gmail.com>
4 " Last Change: Sun Oct 04 2008
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
31 " Send print jobs to Preview.app. This does not delete the temporary ps file
32 " that is generated by :hardcopy.
33 set printexpr=system('open\ -a\ Preview\ '.v:fname_in)\ +\ v:shell_error
44 aunmenu File.Open\.\.\.
48 aunmenu File.Save-Exit
50 an <silent> 10.290 File.New\ Window <Nop>
51 an 10.295 File.New\ Tab :tabnew<CR>
52 an <silent> 10.310 File.Open\.\.\. <Nop>
53 an <silent> 10.325 File.Open\ Recent <Nop>
54 an 10.328 File.-SEP0- <Nop>
55 an <silent> 10.330 File.Close\ Window<Tab>:qa :conf qa<CR>
56 an <silent> 10.332 File.Close :conf q<CR>
57 an <silent> 10.341 File.Save\ All :browse conf wa<CR>
58 an 10.350 File.Save\ As\.\.\.<Tab>:sav :browse confirm saveas<CR>
63 " The following function is aken from menu.vim
65 " Fix text in nameless register to be used with :promptfind.
66 return substitute(@", "[\r\n]", '\\n', 'g')
70 aunmenu Edit.Find\ and\ Replace
72 an <silent> 20.410.10 Edit.Find.Find\.\.\. :promptfind<CR>
73 vunmenu Edit.Find.Find\.\.\.
74 vnoremenu <silent> Edit.Find.Find\.\.\. y:promptfind <C-R>=<SID>FixFText()<CR><CR>
75 an 20.410.20 Edit.Find.Find\ Next <Nop>
76 an 20.410.30 Edit.Find.Find\ Previous <Nop>
77 vmenu 20.410.35 Edit.Find.Use\ Selection\ for\ Find y:let @/=@"<CR>:<BS>
79 an 20.460 Edit.-SEP4- <Nop>
80 an 20.465.10 Edit.Font.Show\ Fonts <Nop>
81 an 20.465.20 Edit.Font.-SEP5- <Nop>
82 an 20.465.30 Edit.Font.Bigger <Nop>
83 an 20.465.40 Edit.Font.Smaller <Nop>
84 an 20.470 Edit.Special\ Characters\.\.\. <Nop>
87 " Window menu (should be next to Help so give it a high priority)
90 an <silent> 9900.300 Window.Minimize <Nop>
91 an <silent> 9900.301 Window.Minimize\ All <Nop>
92 an <silent> 9900.310 Window.Zoom <Nop>
93 an <silent> 9900.311 Window.Zoom\ All <Nop>
94 an <silent> 9900.320 Window.Toggle\ Full\ Screen\ Mode :set invfullscreen<CR>
95 an 9900.330 Window.-SEP1- <Nop>
96 " TODO! Grey out if no tabs are visible.
97 an <silent> 9900.340 Window.Previous\ Tab :tabprevious<CR>
98 an <silent> 9900.350 Window.Next\ Tab :tabnext<CR>
99 an 9900.360 Window.-SEP2- <Nop>
100 an <silent> 9900.370 Window.Bring\ All\ To\ Front <Nop>
104 an 9999.1 Help.MacVim\ Help :h gui_mac<CR>
105 an <silent> 9999.2 Help.MacVim\ Website <Nop>
106 an 9999.3 Help.-sep0- <Nop>
112 " These items are special ('*' means zero or more arbitrary characters):
113 " -space*- an empty space
114 " -flexspace*- a flexible space
115 " -*- a separator item
117 " Remove some items so that all items are visible at the default window size.
118 "aunmenu ToolBar.Undo
119 "aunmenu ToolBar.Redo
120 "aunmenu ToolBar.-sep2-
122 "aunmenu ToolBar.Copy
123 "aunmenu ToolBar.Paste
124 "aunmenu ToolBar.-sep3-
125 aunmenu ToolBar.Replace
126 aunmenu ToolBar.FindNext
127 aunmenu ToolBar.FindPrev
128 aunmenu ToolBar.-sep5-
129 aunmenu ToolBar.-sep6-
130 aunmenu ToolBar.RunCtags
131 aunmenu ToolBar.TagJump
132 "aunmenu ToolBar.-sep7-
133 aunmenu ToolBar.FindHelp
135 "an 1.295 ToolBar.-flexspace7- <Nop>
139 " This is so that HIG Cmd and Option movement mappings can be disabled by
141 " let macvim_skip_cmd_opt_movement = 1
144 if !exists("macvim_skip_cmd_opt_movement")
148 no! <M-Left> <C-Left>
152 no <M-Right> <C-Right>
153 no! <M-Right> <C-Right>
164 endif " !exists("macvim_skip_cmd_opt_movement")
167 " This is so that the HIG shift movement related settings can be enabled by
169 " let macvim_hig_shift_movement = 1
170 " to the user .vimrc (not .gvimrc!).
172 if exists("macvim_hig_shift_movement")
173 " Shift + special movement key (<S-Left>, etc.) and mouse starts insert mode
174 set selectmode=mouse,key
175 set keymodel=startsel,stopsel
177 " HIG related shift + special movement key mappings
178 nn <S-D-Left> <S-Home>
179 vn <S-D-Left> <S-Home>
180 ino <S-D-Left> <S-Home>
181 nn <S-M-Left> <S-C-Left>
182 vn <S-M-Left> <S-C-Left>
183 ino <S-M-Left> <S-C-Left>
185 nn <S-D-Right> <S-End>
186 vn <S-D-Right> <S-End>
187 ino <S-D-Right> <S-End>
188 nn <S-M-Right> <S-C-Right>
189 vn <S-M-Right> <S-C-Right>
190 ino <S-M-Right> <S-C-Right>
192 nn <S-D-Up> <S-C-Home>
193 vn <S-D-Up> <S-C-Home>
194 ino <S-D-Up> <S-C-Home>
196 nn <S-D-Down> <S-C-End>
197 vn <S-D-Down> <S-C-End>
198 ino <S-D-Down> <S-C-End>
199 endif " exists("macvim_hig_shift_movement")
204 " Set up menu key equivalents (these should always have the 'D' modifier set),
205 " action bindings, and alternate items.
207 " Note: menu items which should execute an action are bound to <Nop>; the
208 " action message is specified here via the :macmenu command.
211 macm File.New\ Window key=<D-n> action=newWindow:
212 macm File.New\ Tab key=<D-t>
213 macm File.Open\.\.\. key=<D-o> action=fileOpen:
214 macm File.Open\ Tab\.\.\. key=<D-T>
215 macm File.Open\ Recent action=recentFilesDummy:
216 macm File.Close\ Window key=<D-W>
217 macm File.Close key=<D-w> action=performClose:
218 macm File.Save key=<D-s>
219 macm File.Save\ All key=<D-M-s> alt=YES
220 macm File.Save\ As\.\.\. key=<D-S>
221 macm File.Print key=<D-p>
223 macm Edit.Undo key=<D-z> action=undo:
224 macm Edit.Redo key=<D-Z> action=redo:
225 macm Edit.Cut key=<D-x> action=cut:
226 macm Edit.Copy key=<D-c> action=copy:
227 macm Edit.Paste key=<D-v> action=paste:
228 macm Edit.Select\ All key=<D-a> action=selectAll:
229 macm Edit.Find.Find\.\.\. key=<D-f>
230 macm Edit.Find.Find\ Next key=<D-g> action=findNext:
231 macm Edit.Find.Find\ Previous key=<D-G> action=findPrevious:
232 macm Edit.Find.Use\ Selection\ for\ Find key=<D-e>
233 macm Edit.Special\ Characters\.\.\. key=<D-M-t>
234 macm Edit.Font.Show\ Fonts action=orderFrontFontPanel:
235 macm Edit.Font.Bigger key=<D-=> action=fontSizeUp:
236 macm Edit.Font.Smaller key=<D--> action=fontSizeDown:
237 macm Edit.Special\ Characters\.\.\. action=orderFrontCharacterPalette:
239 macm Tools.Spelling.To\ Next\ error key=<D-;>
240 macm Tools.Spelling.Suggest\ Corrections key=<D-:>
241 macm Tools.Make key=<D-b>
242 macm Tools.List\ Errors key=<D-l>
243 macm Tools.List\ Messages key=<D-L>
244 macm Tools.Next\ Error key=<D-C-Right>
245 macm Tools.Previous\ Error key=<D-C-Left>
246 macm Tools.Older\ List key=<D-C-Up>
247 macm Tools.Newer\ List key=<D-C-Down>
249 macm Window.Minimize key=<D-m> action=performMiniaturize:
250 macm Window.Minimize\ All key=<D-M-m> action=miniaturizeAll: alt=YES
251 macm Window.Zoom key=<D-C-z> action=performZoom:
252 macm Window.Zoom\ All key=<D-M-C-z> action=zoomAll: alt=YES
253 macm Window.Toggle\ Full\ Screen\ Mode key=<D-F>
254 macm Window.Previous\ Tab key=<D-{>
255 macm Window.Next\ Tab key=<D-}>
256 macm Window.Bring\ All\ To\ Front action=arrangeInFront:
258 macm Help.MacVim\ Help key=<D-?>
259 macm Help.MacVim\ Website action=openWebsite:
261 " Restore the previous value of 'cpoptions'.
262 let &cpo = s:cpo_save