1"
2" Filename: cream-keys
3"
4" Cream -- An easy-to-use configuration of the famous Vim text editor
5" [ http://cream.sourceforge.net ] Copyright (C) 2001-2011 Steve Hall
6"
7" License:
8" This program is free software; you can redistribute it and/or modify
9" it under the terms of the GNU General Public License as published by
10" the Free Software Foundation; either version 3 of the License, or
11" (at your option) any later version.
12" [ http://www.gnu.org/licenses/gpl.html ]
13"
14" This program is distributed in the hope that it will be useful, but
15" WITHOUT ANY WARRANTY; without even the implied warranty of
16" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17" General Public License for more details.
18"
19" You should have received a copy of the GNU General Public License
20" along with this program; if not, write to the Free Software
21" Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
22" 02111-1307, USA.
23"
24" Notes:
25" * Search on "non-function" to find all mappings which don't
26"   completely rely on functions.
27
28" KEY TO UNIVERSE: **************************************** {{{1
29"
30"         Remap Ctrl+o to Ctrl+b
31"
32" o Frees <C-b> to be used for File.Open mapping
33" o Avoids over-writing mappings for non-english characters (like
34"   any Alt+___ would.
35" o Maintains the non-lossy position of <C-b> (absent in <C-\><C-n> ).
36"
37inoremap <C-b>  <C-o>
38"
39" PROBLEMS:
40" o Ruins i18n keyboard entries.
41" o Scattered bugs that we couldn't track down.
42"
43"********************************************************************** 1}}}
44" Core
45" Apple/Mac {{{1
46
47" In gvim on OS X the usual OS keymappings are defined in macmap.vim
48" and Command - f <D-f> is a mapping for / in normal mode.  Source the
49" macmap file as a quick fix.
50if has("mac")
51	source $VIMRUNTIME/macmap.vim
52endif
53
54" Mouse {{{1
55"imap <silent> <RightMouse> <LeftMouse><C-b>:call Cream_menu_popup()<CR>
56inoremap <silent> <RightMouse> <LeftMouse><C-\><C-n>:call Cream_menu_popup()<CR>a<RightMouse>
57
58" Note: see
59" Cream_mouse_middle_init() for middle mouse control
60
61" Motion {{{1
62
63" Home -- toggles position between first non-white char and first
64" char. (Functions with or without screen wrap.)
65imap <silent> <Home> <C-b>:call Cream_motion_home()<CR>
66vmap <silent> <Home> :call Cream_motion_home()<CR>
67
68" End -- toggles position between last screen line char and last line
69" char. (Functions with/without screen wrap.)
70imap <silent> <End> <C-b>:call Cream_map_end()<CR>
71"vmap <silent> <End> g$
72
73" Up/Down -- move through line breaks maintaining line position with wrap on.
74" * Need to accommodate all the mappings that use [Up] or [Down] ?
75imap <silent> <Down>  <C-b>:call Cream_down("i")<CR>
76vmap <silent> <Down>  :<C-u>call Cream_down("v")<CR>
77vmap <silent> <Right> :<C-u>call Cream_down("v")<CR>
78
79imap <silent> <Up>   <C-b>:call Cream_up("i")<CR>
80vmap <silent> <Up>   :<C-u>call Cream_up("v")<CR>
81vmap <silent> <Left> :<C-u>call Cream_up("v")<CR>
82
83" [Ctrl]+[Arrow Up/Down] scroll up/down by line
84imap <silent> <C-Down> <C-b>:call Cream_scroll_down()<CR>
85vmap <silent> <C-Down> :<C-u>call Cream_scroll_down("v")<CR>
86
87imap <silent> <C-Up> <C-b>:call Cream_scroll_up()<CR>
88vmap <silent> <C-Up> :<C-u>call Cream_scroll_up("v")<CR>
89
90" hmmm....
91"imap <silent> <C-Left> <C-\><C-n>vh
92"vmap <silent> <C-Left>       h
93
94
95" Ctrl+Home Top of document
96imap <silent> <C-Home> <C-b>:call Cream_motion_doctop()<CR>
97vmap <silent> <C-Home> :<C-u>call Cream_motion_doctop()<CR>
98
99" Ctrl+End Bottom of document
100imap <silent> <C-End> <C-b>:call Cream_motion_docbottom()<CR>
101vmap <silent> <C-End> :<C-u>call Cream_motion_docbottom()<CR>
102
103
104" PageUp -- ensure motion to top if in first page
105imap <silent> <PageUp> <C-b>:call Cream_pageup()<CR>
106vmap <silent> <PageUp> :<C-u>call Cream_pageup()<CR>
107
108" PageDown
109imap <silent> <PageDown> <C-b>:call Cream_pagedown()<CR>
110vmap <silent> <PageDown> :<C-u>call Cream_pagedown()<CR>
111
112
113" * necessary only for GTK
114" Go to top of current page
115imap <silent> <C-PageUp> <C-b>:call Cream_motion_windowtop()<CR>
116vmap <silent> <C-PageUp> :<C-u>call Cream_motion_windowtop()<CR>
117" Go to bottom of current page
118imap <silent> <C-PageDown> <C-b>:call Cream_motion_windowbottom()<CR>
119vmap <silent> <C-PageDown> :<C-u>call Cream_motion_windowbottom()<CR>
120" Go to middle of current page
121imap <silent> <C-M-PageUp>   <C-b>:call Cream_motion_windowmiddle()<CR>
122vmap <silent> <C-M-PageUp>   :<C-u>call Cream_motion_windowmiddle()<CR>
123imap <silent> <C-M-PageDown> <C-b>:call Cream_motion_windowmiddle()<CR>
124vmap <silent> <C-M-PageDown> :<C-u>call Cream_motion_windowmiddle()<CR>
125
126" <BS> delete in Visual mode
127vmap <silent> <BS> :<C-u>call Cream_delete_v()<CR>
128
129" Shift+Backspace deletes word (see help for difference between "word" and "WORD")
130imap <silent> <S-BS> <C-b>:call Cream_map_key_backspace()<CR>
131" Ctrl+Backspace deletes WORD
132imap <silent> <C-BS> <C-b>:call Cream_map_key_backspace("WORD")<CR>
133
134" Selection {{{1
135
136" Shift+Home
137" * Select from cursor to screen line beginning, with either wrap on or off.
138" * Toggle selection between first column and first character
139imap <silent> <S-Home> <C-b>:call Cream_map_shift_home("i")<CR>
140vmap <silent> <S-Home>      :<C-u>call Cream_map_shift_home("v")<CR>
141
142" Shift+End -- select to end of screen line, not end of line
143imap <silent> <S-End> <C-b>:call Cream_map_shift_end()<CR>
144"*** Don't remap for visual mode *** (imap does the job)
145"vmap <silent> <S-End> :call Cream_map_shift_end()<CR>
146
147" Shift+Up -- select up one line (w/ or w/o wrap on) and maintain line pos
148imap <silent> <S-Up> <C-b>:call Cream_map_shift_up("i")<CR>
149vmap <silent> <S-Up>      :<C-u>call Cream_map_shift_up("v")<CR>
150" Shift+Down -- select down one line (w/ or w/o wrap on) and maintain line pos
151imap <silent> <S-Down> <C-b>:call Cream_map_shift_down("i")<CR>
152vmap <silent> <S-Down>      :<C-u>call Cream_map_shift_down("v")<CR>
153
154" Shift+PageUp -- select to top of screen, then up one screen length
155imap <silent> <S-PageUp> <C-b>:call Cream_map_shift_pageup("i")<CR>
156vmap <silent> <S-PageUp>      :<C-u>call Cream_map_shift_pageup("v")<CR>
157" Shift+PageDown -- select to bottom of screen, then down one screen length
158imap <silent> <S-PageDown> <C-b>:call Cream_map_shift_pagedown("i")<CR>
159vmap <silent> <S-PageDown>      :<C-u>call Cream_map_shift_pagedown("v")<CR>
160
161" Selection -- go to end specified
162vmap <silent> <C-S-Up>   :<C-u>call Cream_visual_swappos("up")<CR>
163vmap <silent> <C-S-Down> :<C-u>call Cream_visual_swappos("dn")<CR>
164
165" Mouse -- drag
166"*** Broken: This mapping breaks GTK2 (other?) dialogs, causing Vim
167"            crash.
168"vmap <silent> <S-LeftDrag> <LeftDrag>
169"vmap <silent> <M-S-LeftDrag> <LeftDrag>
170"***
171
172" Ctrl+A -- select all
173imap <silent> <C-a> <C-b>:call Cream_select_all()<CR>
174vmap <silent> <C-a>      :<C-u>call Cream_select_all()<CR>
175
176" Replace mode (Insert) {{{1
177
178" <Insert> goes to gR not gr
179" NOTE: This is one of the rare situations where we can't have a clean
180"       mapping to a single function because we want the key to change
181"       modes, but a function always returns to insertmode.
182"imap <silent> <Insert> <C-r>=Cream_replacemode()<CR>
183imap <silent> <Insert> <C-b>:call Cream_replacemode_remap()<CR><C-b>gR
184
185" Folding {{{1
186imap <silent> <F9>     <C-b>:call Cream_fold("down")<CR>
187imap <silent> <S-F9>   <C-b>:call Cream_fold("up")<CR>
188
189vmap <silent> <F9>          :<C-u>call Cream_fold_set("v")<CR>
190
191imap <silent> <C-F9>   <C-b>:call Cream_fold_openall()<CR>
192imap <silent> <C-S-F9> <C-b>:call Cream_fold_closeall()<CR>
193imap <silent> <M-F9>   <C-b>:call Cream_fold_delete()<CR>
194imap <silent> <M-S-F9> <C-b>:call Cream_fold_deleteall()<CR>
195
196" Wrap {{{1
197
198" Word wrap toggle
199imap <silent> <C-w> <C-b>:call Cream_wrap("i")<CR>
200vmap <silent> <C-w>      :<C-u>call Cream_wrap("v")<CR>
201
202" Auto wrap toggle
203imap <silent> <C-e> <C-b>:call Cream_autowrap("i")<CR>
204vmap <silent> <C-e>      :<C-u>call Cream_autowrap("v")<CR>
205
206" Quick Wrap
207imap <silent> <C-q> <C-b>:call Cream_quickwrap("i")<CR>
208vmap <silent> <C-q>      :<C-u>call Cream_quickwrap("v")<CR>
209
210" Quick UnWrap
211imap <silent> <M-q>q     <C-b>:call Cream_quickunwrap("i")<CR>
212imap <silent> <M-Q>Q     <C-b>:call Cream_quickunwrap("i")<CR>
213imap <silent> <M-q><M-q> <C-b>:call Cream_quickunwrap("i")<CR>
214imap <silent> <M-Q><M-Q> <C-b>:call Cream_quickunwrap("i")<CR>
215vmap <silent> <M-q>q          :<C-u>call Cream_quickunwrap("v")<CR>
216vmap <silent> <M-Q>Q          :<C-u>call Cream_quickunwrap("v")<CR>
217vmap <silent> <M-q><M-q>      :<C-u>call Cream_quickunwrap("v")<CR>
218vmap <silent> <M-Q><M-Q>      :<C-u>call Cream_quickunwrap("v")<CR>
219
220" Indent/Unindent
221vmap <silent> <Tab>        :<C-u>call Cream_indent("v")<CR>
222
223imap <silent> <S-Tab> <C-b>:call Cream_unindent("i")<CR>
224vmap <silent> <S-Tab>      :<C-u>call Cream_unindent("v")<CR>
225
226" 1}}}
227" General Mappings
228" Help {{{1
229
230" general help
231imap <silent> <F1>   <C-b>:call Cream_help()<CR>
232vmap <silent> <F1>   :<C-u>call Cream_help()<CR>
233
234" go to specific topic
235imap <silent> <C-F1> <C-b>:call Cream_help_find()<CR>
236" list possible matches
237imap <silent> <M-F1> <C-b>:call Cream_help_listtopics()<CR>
238
239" File {{{1
240
241" Open (with dialog)
242"**********************************************************************
243" Note: This is only possible due to Key to Universe map at beginning!
244"       Normally, <C-b> is a special Vim mapping.
245imap <silent> <C-o> <C-b>:call Cream_file_open()<CR>
246"**********************************************************************
247
248" Open file under cursor
249imap <silent> <S-CR> <C-b>:call Cream_file_open_undercursor("i")<CR>
250vmap <silent> <S-CR> :<C-u>call Cream_file_open_undercursor("v")<CR>
251
252" Save (only when changes)
253imap <silent> <C-s> <C-b>:call Cream_update("i")<CR>
254vmap <silent> <C-s> :<C-u>call Cream_update("v")<CR>
255
256" New
257imap <silent> <C-n> <C-b>:call Cream_file_new()<CR>
258
259" Close
260" Note: We kill this in gVim (see Terminal elsewhere) because we
261" assume the Window Manager will intercept. If it doesn't, or if the
262" user cancels (thereby returning to Vim) we don't want anything to
263" happen.
264imap <silent> <M-F4> <C-b>:call Cream_exit()<CR>
265vmap <silent> <M-F4> <C-b>:call Cream_exit()<CR>
266
267imap <silent> <C-F4> <C-b>:call Cream_close()<CR>
268vmap <silent> <C-F4> :<C-u>call Cream_close()<CR>
269
270" Cut/Copy/Paste {{{1
271
272" Cut (two mappings)
273"imap <silent> <C-x>   <Nop>
274imap <silent> <S-Del> <Nop>
275vmap <silent> <C-x>   :<C-u>call Cream_cut("v")<CR>
276vmap <silent> <S-Del> :<C-u>call Cream_cut("v")<CR>
277
278" Copy (two mappings)
279imap <silent> <C-c>      <Nop>
280imap <silent> <C-Insert> <Nop>
281vmap <silent> <C-c>      :<C-u>call Cream_copy("v")<CR>
282vmap <silent> <C-Insert> :<C-u>call Cream_copy("v")<CR>
283
284" Paste
285imap <silent> <C-v>      x<BS><C-b>:call Cream_paste("i")<CR>
286imap <silent> <S-Insert> x<BS><C-b>:call Cream_paste("i")<CR>
287vmap <silent> <C-v>           :<C-u>call Cream_paste("v")<CR>
288vmap <silent> <S-Insert>      :<C-u>call Cream_paste("v")<CR>
289
290" Undo/Redo {{{1
291
292"	Undo
293imap <silent> <C-z> <C-b>:call Cream_undo("i")<CR>
294vmap <silent> <C-z> :<C-u>call Cream_undo("v")<CR>
295
296"	Redo
297"*** broken: fails (conflicts with <C-z>)
298"imap <silent> <C-S-Z> <C-b>:call Cream_redo("i")<CR>
299"vmap <silent> <C-S-Z> :<C-u>call Cream_redo("v")<CR>
300"***
301" also
302imap <silent> <C-y> <C-b>:call Cream_redo("i")<CR>
303vmap <silent> <C-y> :<C-u>call Cream_redo("v")<CR>
304
305
306" Space exits insertmode. This allows undo to remember each word
307" rather than an entire insert.
308"inoremap <silent> <Space> <Space><C-b><C-\><C-n>i
309
310" Show Invisibles (list) {{{1
311
312imap <silent> <F4> <C-b>:call Cream_list_toggle("i")<CR>
313vmap <silent> <F4> :<C-u>call Cream_list_toggle("v")<CR>
314
315" Window/Buffer/Document select {{{1
316
317" Window/Buffer Next/Previous -- Switch between windows unless only
318" one open; then alternate between multiple buffers if existing
319imap <silent> <C-Tab>   <C-b>:call Cream_nextwindow()<CR>
320vmap <silent> <C-Tab>   :<C-u>call Cream_nextwindow()<CR>
321
322imap <silent> <C-S-Tab> <C-b>:call Cream_prevwindow()<CR>
323vmap <silent> <C-S-Tab> :<C-u>call Cream_prevwindow()<CR>
324
325" Printing {{{1
326
327imap <silent> <C-p> <C-b>:call Cream_print("i")<CR>
328vmap <silent> <C-p> :<C-u>call Cream_print("v")<CR>
329
330" Find and Replace {{{1
331
332"imap <silent> <C-f> <C-b>:call Cream_find()<CR>
333"imap <silent> <C-h> <C-b>:call Cream_replace()<CR>
334" Notes:
335" 1. Avoid calling wrapper functions, it breaks the dialog's
336"    multi-modal behavior.
337" 2. Mac currently can't use the dialogs
338if !has("mac")
339	imap <silent> <C-f> <C-b>:promptfind<CR>
340	imap <silent> <C-h> <C-b>:promptrepl<CR>
341endif
342
343" Find, under cursor
344" * DO NOT use the 'g' option preceeding the search, because it will
345"   only yield a match for the single letter under the cursor!
346" forward
347imap <silent> <F3> <C-b>:call Cream_findunder("i")<CR>
348vmap <silent> <F3> :<C-u>call Cream_findunder("v")<CR>
349
350" backward
351imap <silent> <S-F3> <C-b>:call Cream_findunder_reverse("i")<CR>
352vmap <silent> <S-F3> :<C-u>call Cream_findunder_reverse("v")<CR>
353
354" forward, case sensitive
355imap <silent> <M-F3> <C-b>:call Cream_findunder_case("i")<CR>
356vmap <silent> <M-F3> :<C-u>call Cream_findunder_case("v")<CR>
357
358" backward, case sensitive
359imap <silent> <M-S-F3> <C-b>:call Cream_findunder_case_reverse("i")<CR>
360vmap <silent> <M-S-F3> :<C-u>call Cream_findunder_case_reverse("v")<CR>
361
362
363" 1}}}
364" Misc
365" Completion, Word, Omni, Template {{{1
366
367inoremap <silent> <C-Space>   <C-r>=Cream_complete_forward()<CR>
368inoremap <silent> <C-S-Space> <C-r>=Cream_complete_backward()<CR>
369
370inoremap <silent> <C-Enter>   <C-r>=Cream_complete_omni_forward()<CR>
371inoremap <silent> <C-S-Enter> <C-r>=Cream_complete_omni_backward()<CR>
372
373"imap <silent> <M-Space>          <C-r>=ProcessImapLeader()<cr>
374"inoremap <silent> <S-Space><S-Space> <C-r>=Cream_template_expand()<cr>
375inoremap <silent> <Esc><Space> <C-r>=Cream_template_expand()<cr>
376
377" Tags, Goto {{{1
378
379" web-like Forward/Back (good for help pages)
380imap <silent> <M-Left>  <C-b>:call Cream_tag_backward()<CR>
381imap <silent> <M-Right> <C-b>:call Cream_tag_forward()<CR>
382imap <silent> <M-Up>    <C-b>:call Cream_tag_backclose()<CR>
383" go to tag under cursor
384imap <silent> <M-Down>  <C-b>:call Cream_tag_goto()<CR>
385
386" tag list
387imap <silent> <C-M-Down> <C-b>:call Cream_Tlist_toggle()<CR>
388
389" Goto Line {{{1
390imap <silent> <C-g> <C-b>:call Cream_goto()<CR>
391
392" Pop {{{1
393
394" pop
395imap <silent> <M-9> <C-b>:call Cream_pop_paren_map()<CR>
396imap <silent> <M-(> <C-b>:call Cream_pop_paren_map()<CR>
397
398" auto-pop initialized and controled via autocmd and option preference
399
400" Expandtab {{{1
401
402imap <silent> <C-T> <C-b>:call Cream_expandtab_toggle("i")<CR>
403vmap <silent> <C-T> :<C-u>call Cream_expandtab_toggle("v")<CR>
404
405" Insert, Character Lines {{{1
406
407" type first character entered after mapping textwidth number of times
408imap <silent> <S-F4>		<C-b>:call Cream_charline()<CR>
409imap <silent> <S-F4><S-F4>	<C-b>:call Cream_charline_lineabove()<CR>
410imap <silent> <S-F4><F4>	<C-b>:call Cream_charline_lineabove()<CR>
411
412" Insert, Character by value, digraph {{{1
413
414" decimal insert
415"inoremap <silent> <M-,> <C-q>
416imap <silent> <M-,> <C-b>:call Cream_insert_char()<CR>
417vmap <silent> <M-,> :<C-u>call Cream_insert_char()<CR>
418
419imap <silent> <M-,><M-,> <C-b>:call Cream_allchars_list()<CR>
420
421imap <silent> <M-.> <C-b>:call Cream_char_codes("i")<CR>
422vmap <silent> <M-.> :<C-u>call Cream_char_codes("v")<CR>
423
424" diagraph
425" (Ctrl+K insertion is a Vim keystroke)
426imap <silent> <C-K><C-K> <C-b>:call Cream_digraph_list()<CR>
427
428
429" Spell Check {{{1
430
431if v:version >= 700
432
433	imap <silent> <F7> <C-b>:call Cream_spellcheck()<CR>
434	vmap <silent> <F7> :<C-u>call Cream_spellcheck("v")<CR>
435	" TODO: broken
436	imap <silent> <M-F7> <C-b>:call Cream_spell_altword()<CR>
437	vmap <silent> <M-F7> :<C-u>call Cream_spell_altword("v")<CR>
438
439	"imap <silent> <M-F7> <C-\><C-n>z=
440
441else
442	" toggle error highlighting on/off
443	imap <silent> <M-F7> <C-b>:call Cream_spellcheck()<CR>
444	" Next word (and turn on if not on)
445	imap <silent> <F7>   <C-b>:call Cream_spell_next()<CR>
446	" Previous word (and turn on if not on)
447	imap <silent> <S-F7> <C-b>:call Cream_spell_prev()<CR>
448	" Save word to dictionary
449	imap <silent> <C-F7> <C-b>:call Cream_spell_saveword()<CR>
450	"*** non-function
451	vmap <silent> <C-F7>   "xy:call Cream_spell_saveword_v()<CR>
452endif
453
454" Block comments (Enhanced Commentify) {{{1
455
456imap <silent> <F6>   <C-b>:call Cream_commentify("i")<CR>
457vmap <silent> <F6>   :<C-u>call Cream_commentify("v")<CR>
458
459imap <silent> <S-F6> <C-b>:call Cream_decommentify("i")<CR>
460vmap <silent> <S-F6> :<C-u>call Cream_decommentify("v")<CR>
461
462imap <silent> <M-F6> <C-b>:call Cream_commentify_noindent("i")<CR>
463vmap <silent> <M-F6> :<C-u>call Cream_commentify_noindent("v")<CR>
464imap <silent> <C-F6> <C-b>:call Cream_commentify_noindent("i")<CR>
465vmap <silent> <C-F6> :<C-u>call Cream_commentify_noindent("v")<CR>
466
467
468" Macros {{{1
469
470imap <silent> <S-F8> <C-b>:call Cream_macro_record("q")<CR>
471" Note: Trailing backspace deletes the errant added newline. (Not
472" able to be done within the function.)
473imap <silent> <F8>   <C-b>:call Cream_macro_play("q")<CR>
474
475
476" Bookmarking {{{1
477" Jump forward/backward and toggle 'anonymous' marks for lines (by using marks a-z)
478imap <silent> <F2>     <C-b>:call Cream_WOK_mark_next()<CR>
479imap <silent> <S-F2>   <C-b>:call Cream_WOK_mark_prev()<CR>
480imap <silent> <M-F2>   <C-b>:call Cream_WOK_mark_toggle()<CR>
481imap <silent> <M-S-F2> <C-b>:call Cream_WOK_mark_killall()<CR>
482"imap <silent> <C-F2>   <C-b>:call Cream_ShowMarksToggle()<CR>
483
484
485" Calendar {{{1
486imap <silent> <C-F11> <C-b>:call Cream_calendar()<CR>
487vmap <silent> <C-F11>           :call Cream_calendar()<CR>
488
489" Date/Time {{{1
490
491" dialog
492imap <silent> <F11> <C-b>:call Cream_insert_datetime(1)<CR>
493vmap <silent> <F11> :<C-u>call Cream_insert_datetime(1)<CR>
494" last used
495imap <silent> <F11><F11> <C-b>:call Cream_insert_datetime()<CR>
496vmap <silent> <F11><F11> :<C-u>call Cream_insert_datetime()<CR>
497
498" Capitalization {{{1
499
500" Title Case
501imap <silent> <F5>   <C-b>:call Cream_case_title("i")<CR>
502vmap <silent> <F5>   :<C-u>call Cream_case_title("v")<CR>
503" UPPERCASE
504imap <silent> <S-F5> <C-b>:call Cream_case_upper("i")<CR>
505vmap <silent> <S-F5> :<C-u>call Cream_case_upper("v")<CR>
506" lowercase
507imap <silent> <M-F5> <C-b>:call Cream_case_lower("i")<CR>
508vmap <silent> <M-F5> :<C-u>call Cream_case_lower("v")<CR>
509"" rEVERSE CASE
510"imap <silent> <C-F5> <C-b>:call Cream_case_reverse("i")<CR>
511"vmap <silent> <C-F5> :<C-u>call Cream_case_reverse("v")<CR>
512
513" Column Mode {{{1
514"*** DEPRECATED:
515imap <silent> <M-c>c     <C-b>:call Cream_columns()<CR>
516imap <silent> <M-c><M-c> <C-b>:call Cream_columns()<CR>
517imap <silent> <M-C>C     <C-b>:call Cream_columns()<CR>
518imap <silent> <M-C><M-C> <C-b>:call Cream_columns()<CR>
519"***
520
521imap <silent> <M-S-Up>       <C-b>:call Cream_columns()<CR><S-Up>
522imap <silent> <M-S-Down>     <C-b>:call Cream_columns()<CR><S-Down>
523imap <silent> <M-S-Left>     <C-b>:call Cream_columns()<CR><S-Left>
524imap <silent> <M-S-Right>    <C-b>:call Cream_columns()<CR><S-Right>
525imap <silent> <M-S-Home>     <C-b>:call Cream_columns()<CR><S-Home>
526imap <silent> <M-S-End>      <C-b>:call Cream_columns()<CR><S-End>
527imap <silent> <M-S-PageUp>   <C-b>:call Cream_columns()<CR><S-PageUp>
528imap <silent> <M-S-PageDown> <C-b>:call Cream_columns()<CR><S-PageDown>
529
530vmap <silent> <M-S-Up>       <S-Up>
531vmap <silent> <M-S-Down>     <S-Down>
532vmap <silent> <M-S-Left>     <S-Left>
533vmap <silent> <M-S-Right>    <S-Right>
534vmap <silent> <M-Home>       <S-Home>
535vmap <silent> <M-S-End>      <S-End>
536vmap <silent> <M-S-PageUp>   <S-PageUp>
537vmap <silent> <M-S-PageDown> <S-PageDown>
538" drag
539vmap <silent> <M-S-LeftDrag>     <S-LeftDrag>
540vmap <silent> <M-S-RightDrag>    <S-RightDrag>
541
542imap <silent> <M-S-LeftMouse> <C-b>:call Cream_columns()<CR><S-LeftMouse>
543vmap <silent> <M-S-LeftMouse>                               <S-LeftMouse>
544"*** BROKEN: Can't map mouse in visual-mode for some reason
545"vmap <LeftMouse> <C-\><S-LeftMouse><Esc>
546"***
547
548" 1}}}
549" Terminal Spoofing
550"{{{1
551
552if !has("gui_running")
553
554	" console menus
555	imap <silent> <F12> <C-\><C-n>:emenu <C-z>
556	vmap <silent> <F12> :<C-u>emenu <C-z>
557
558	" Quit
559	"imap <silent> <C-F4> <C-b>:call Cream_exit()<CR>
560	"vmap <silent> <C-F4> :<C-u>call Cream_exit()<CR>
561
562	" File
563	imap <silent> <M-f> <C-\><C-n>:emenu <C-z>
564	vmap <silent> <M-f> :<C-u>emenu <C-z>
565
566	" File.Save
567	imap <silent> <M-f><M-s> <C-\><C-n>:w<CR>a
568	vmap <silent> <M-f><M-s> <C-\><C-n>:w<CR>gv
569
570	" File.SaveAs
571	imap <silent> <M-f><M-a> <C-\><C-n>:browse confirm saveas<CR>i
572	vmap <silent> <M-f><M-a> <C-\><C-n>:browse confirm saveas<CR>gv
573
574	" File.Exit
575	imap <silent> <M-f><M-x> <Esc>:q<CR>
576	vmap <silent> <M-f><M-x> <Esc>:q<CR>gv
577
578endif
579
580" 1}}}
581" vim:foldmethod=marker
582