" " Filename: cream-keys " " Cream -- An easy-to-use configuration of the famous Vim text editor " [ http://cream.sourceforge.net ] Copyright (C) 2001-2007 Steve Hall " " License: " This program is free software; you can redistribute it and/or modify " it under the terms of the GNU General Public License as published by " the Free Software Foundation; either version 2 of the License, or " (at your option) any later version. " [ http://www.gnu.org/licenses/gpl.html ] " " This program is distributed in the hope that it will be useful, but " WITHOUT ANY WARRANTY; without even the implied warranty of " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU " General Public License for more details. " " You should have received a copy of the GNU General Public License " along with this program; if not, write to the Free Software " Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA " 02111-1307, USA. " " Notes: " * Search on "non-function" to find all mappings which don't " completely rely on functions. " KEY TO UNIVERSE: (Abandoned) **************************************** {{{1 " " Remap to " " * Frees to be used for File.Open mapping " * Avoids over-writing mappings for non-english characters (like " a single would). " * Still slightly intuitive for long-time Vim users. " * Maintains the non-lossy position of (absent in ). " "inoremap "inoremap o "********************************************************************** 1}}} " Core " Mouse {{{1 "imap :call Cream_menu_popup() inoremap :call Cream_menu_popup()a " Note: see " Cream_mouse_middle_init() for middle mouse control " Motion {{{1 " Home -- toggles position between first non-white char and first " char. (Functions with or without screen wrap.) imap :call Cream_motion_home() vmap :call Cream_motion_home() " End -- toggles position between last screen line char and last line " char. (Functions with/without screen wrap.) imap :call Cream_map_end() "vmap g$ " Up/Down -- move through line breaks maintaining line position with wrap on. " * Need to accommodate all the mappings that use [Up] or [Down] ? imap :call Cream_down("i") vmap :call Cream_down("v") vmap :call Cream_down("v") imap :call Cream_up("i") vmap :call Cream_up("v") vmap :call Cream_up("v") " [Ctrl]+[Arrow Up/Down] scroll up/down by line imap :call Cream_scroll_down() vmap :call Cream_scroll_down("v") imap :call Cream_scroll_up() vmap :call Cream_scroll_up("v") " hmmm.... "imap vh "vmap h " Ctrl+Home Top of document imap :call Cream_motion_doctop() vmap :call Cream_motion_doctop() " Ctrl+End Bottom of document imap :call Cream_motion_docbottom() vmap :call Cream_motion_docbottom() " PageUp -- ensure motion to top if in first page imap :call Cream_pageup() vmap :call Cream_pageup() " PageDown imap :call Cream_pagedown() vmap :call Cream_pagedown() " * necessary only for GTK " Go to top of current page imap :call Cream_motion_windowtop() vmap :call Cream_motion_windowtop() " Go to bottom of current page imap :call Cream_motion_windowbottom() vmap :call Cream_motion_windowbottom() " Go to middle of current page imap :call Cream_motion_windowmiddle() vmap :call Cream_motion_windowmiddle() imap :call Cream_motion_windowmiddle() vmap :call Cream_motion_windowmiddle() " delete in Visual mode vmap :call Cream_delete_v() " Shift+Backspace deletes word (see help for difference between "word" and "WORD") imap :call Cream_map_key_backspace() " Ctrl+Backspace deletes WORD imap :call Cream_map_key_backspace("WORD") inoremap :call Cream_highlight_currentline() "*** BUGGED: "vmap "*** " Selection {{{1 " Shift+Home " * Select from cursor to screen line beginning, with either wrap on or off. " * Toggle selection between first column and first character imap :call Cream_map_shift_home("i") vmap :call Cream_map_shift_home("v") " Shift+End -- select to end of screen line, not end of line imap :call Cream_map_shift_end() "*** Don't remap for visual mode *** (imap does the job) "vmap :call Cream_map_shift_end() " Shift+Up -- select up one line (w/ or w/o wrap on) and maintain line pos imap :call Cream_map_shift_up("i") vmap :call Cream_map_shift_up("v") " Shift+Down -- select down one line (w/ or w/o wrap on) and maintain line pos imap :call Cream_map_shift_down("i") vmap :call Cream_map_shift_down("v") " Shift+PageUp -- select to top of screen, then up one screen length imap :call Cream_map_shift_pageup("i") vmap :call Cream_map_shift_pageup("v") " Shift+PageDown -- select to bottom of screen, then down one screen length imap :call Cream_map_shift_pagedown("i") vmap :call Cream_map_shift_pagedown("v") " Selection -- go to end specified vmap :call Cream_visual_swappos("up") vmap :call Cream_visual_swappos("dn") " Mouse -- drag "*** Broken: This mapping breaks GTK2 (other?) dialogs, causing Vim " crash. "vmap "vmap "*** " Ctrl+A -- select all imap :call Cream_select_all() vmap :call Cream_select_all() " Replace mode (Insert) {{{1 " goes to gR not gr imap =Cream_replacemode() " Folding {{{1 imap :call Cream_fold("down") imap :call Cream_fold("up") vmap :call Cream_fold_set("v") imap :call Cream_fold_openall() imap :call Cream_fold_closeall() imap :call Cream_fold_delete() imap :call Cream_fold_deleteall() " Wrap {{{1 " Word wrap toggle imap :call Cream_wrap("i") vmap :call Cream_wrap("v") " Auto wrap toggle imap :call Cream_autowrap("i") vmap :call Cream_autowrap("v") " Quick Wrap imap :call Cream_quickwrap("i") vmap :call Cream_quickwrap("v") " Quick UnWrap imap q :call Cream_quickunwrap("i") imap Q :call Cream_quickunwrap("i") imap :call Cream_quickunwrap("i") imap :call Cream_quickunwrap("i") vmap q :call Cream_quickunwrap("v") vmap Q :call Cream_quickunwrap("v") vmap :call Cream_quickunwrap("v") vmap :call Cream_quickunwrap("v") " Indent/Unindent vmap :call Cream_indent("v") imap :call Cream_unindent("i") vmap :call Cream_unindent("v") " 1}}} " General Mappings " Help {{{1 " general help imap :call Cream_help() vmap :call Cream_help() " go to specific topic imap :call Cream_help_find() " list possible matches imap :call Cream_help_listtopics() " File {{{1 "*** ABANDONED: Alt+O(x2) ruined by encodings, Ctrl+O back to Vim std. " Open (with dialog) "********************************************************************** " Note: This is only possible due to Key to Universe map at beginning! " Normally, is a special Vim mapping. "imap :call Cream_file_open() "********************************************************************** "*** " Open file under cursor imap :call Cream_file_open_undercursor("i") vmap :call Cream_file_open_undercursor("v") " Save (only when changes) imap :call Cream_update("i") vmap :call Cream_update("v") " New imap :call Cream_file_new() " Close " Note: We kill this in gVim (see Terminal elsewhere) because we " assume the Window Manager will intercept. If it doesn't, or if the " user cancels (thereby returning to Vim) we don't want anything to " happen. imap vmap imap :call Cream_exit() vmap :call Cream_exit() " Cut/Copy/Paste {{{1 " Cut (two mappings) imap imap vmap :call Cream_cut("v") vmap :call Cream_cut("v") " Copy (two mappings) imap imap vmap :call Cream_copy("v") vmap :call Cream_copy("v") " Paste imap x:call Cream_paste("i") imap x:call Cream_paste("i") vmap :call Cream_paste("v") vmap :call Cream_paste("v") " Undo/Redo {{{1 " Undo imap :call Cream_undo("i") vmap :call Cream_undo("v") " Redo "*** broken: fails (conflicts with ) "imap :call Cream_redo("i") "vmap :call Cream_redo("v") "*** " also imap :call Cream_redo("i") vmap :call Cream_redo("v") " Space exits insertmode. This allows undo to remember each word " rather than an entire insert. "inoremap i " Show Invisibles (list) {{{1 imap :call Cream_list_toggle("i") vmap :call Cream_list_toggle("v") " Window/Buffer/Document select {{{1 " Window/Buffer Next/Previous -- Switch between windows unless only " one open; then alternate between multiple buffers if existing imap :call Cream_nextwindow() vmap :call Cream_nextwindow() imap :call Cream_prevwindow() vmap :call Cream_prevwindow() " Printing {{{1 imap :call Cream_print("i") vmap :call Cream_print("v") " Find and Replace {{{1 "imap :call Cream_find() "imap :call Cream_replace() " Note: Avoid calling wrapper functions, it breaks the dialog's " multi-modal behavior. imap :promptfind imap :promptrepl " Find, under cursor " * DO NOT use the 'g' option preceeding the search, because it will " only yield a match for the single letter under the cursor! " forward imap :call Cream_findunder("i") vmap :call Cream_findunder("v") " backward imap :call Cream_findunder_reverse("i") vmap :call Cream_findunder_reverse("v") " forward, case sensitive imap :call Cream_findunder_case("i") vmap :call Cream_findunder_case("v") " backward, case sensitive imap :call Cream_findunder_case_reverse("i") vmap :call Cream_findunder_case_reverse("v") " 1}}} " Misc " Completion, Word {{{1 inoremap =Cream_complete_backward() inoremap =Cream_complete_forward() " Completion, Template (imaps) {{{1 "imap =ProcessImapLeader() "inoremap =Cream_template_expand() inoremap =Cream_template_expand() " Tags, Goto {{{1 " web-like Forward/Back (good for help pages) imap :call Cream_tag_backward() imap :call Cream_tag_forward() imap :call Cream_tag_backclose() " go to tag under cursor imap :call Cream_tag_goto() " tag list imap :call Cream_Tlist_toggle() " Goto Line {{{1 imap :call Cream_goto() " Pop {{{1 " pop imap :call Cream_pop_paren_map() imap :call Cream_pop_paren_map() " auto-pop initialized and controled via autocmd and option preference " Expandtab {{{1 imap :call Cream_expandtab_toggle("i") vmap :call Cream_expandtab_toggle("v") " Insert, Character Lines {{{1 " type first character entered after mapping textwidth number of times imap :call Cream_charline() imap :call Cream_charline_lineabove() imap :call Cream_charline_lineabove() " Insert, Character by value, digraph {{{1 " decimal insert "inoremap imap :call Cream_insert_char() vmap :call Cream_insert_char() imap :call Cream_allchars_list() imap :call Cream_char_codes("i") vmap :call Cream_char_codes("v") " diagraph " (Ctrl+K insertion is a Vim keystroke) imap :call Cream_digraph_list() " Spell Check {{{1 if v:version >= 700 imap :call Cream_spellcheck() vmap :call Cream_spellcheck("v") " TODO: broken imap :call Cream_spell_altword() vmap :call Cream_spell_altword("v") "imap z= else " toggle error highlighting on/off imap :call Cream_spellcheck() " Next word (and turn on if not on) imap :call Cream_spell_next() " Previous word (and turn on if not on) imap :call Cream_spell_prev() " Save word to dictionary imap :call Cream_spell_saveword() "*** non-function vmap "xy:call Cream_spell_saveword_v() endif " Block comments (Enhanced Commentify) {{{1 imap :call Cream_commentify("i") vmap :call Cream_commentify("v") imap :call Cream_decommentify("i") vmap :call Cream_decommentify("v") imap :call Cream_commentify_noindent("i") vmap :call Cream_commentify_noindent("v") imap :call Cream_commentify_noindent("i") vmap :call Cream_commentify_noindent("v") " Macros {{{1 imap :call Cream_macro_record("q") " Note: Trailing backspace deletes the errant added newline. (Not " able to be done within the function.) imap :call Cream_macro_play("q") " Bookmarking {{{1 " Jump forward/backward and toggle 'anonymous' marks for lines (by using marks a-z) imap :call Cream_WOK_mark_next() imap :call Cream_WOK_mark_prev() imap :call Cream_WOK_mark_toggle() imap :call Cream_WOK_mark_killall() "imap :call Cream_ShowMarksToggle() " Calendar {{{1 imap :call Cream_calendar() vmap :call Cream_calendar() " Date/Time {{{1 " dialog imap :call Cream_insert_datetime(1) vmap :call Cream_insert_datetime(1) " last used imap :call Cream_insert_datetime() vmap :call Cream_insert_datetime() " Capitalization {{{1 " Title Case imap :call Cream_case_title("i") vmap :call Cream_case_title("v") " UPPERCASE imap :call Cream_case_upper("i") vmap :call Cream_case_upper("v") " lowercase imap :call Cream_case_lower("i") vmap :call Cream_case_lower("v") "" rEVERSE CASE "imap :call Cream_case_reverse("i") "vmap :call Cream_case_reverse("v") " Column Mode {{{1 "*** DEPRECATED: imap c :call Cream_columns() imap :call Cream_columns() imap C :call Cream_columns() imap :call Cream_columns() "*** imap :call Cream_columns() imap :call Cream_columns() imap :call Cream_columns() imap :call Cream_columns() imap :call Cream_columns() imap :call Cream_columns() imap :call Cream_columns() imap :call Cream_columns() vmap vmap vmap vmap vmap vmap vmap vmap " drag vmap vmap imap :call Cream_columns() vmap "*** BROKEN: Can't map mouse in visual-mode for some reason "vmap "*** " 1}}} " Terminal Spoofing "{{{1 if !has("gui_running") " console menus imap :emenu vmap :emenu " Quit "imap :call Cream_exit() "vmap :call Cream_exit() " File imap :emenu vmap :emenu " File.Save imap :wa vmap :wgv " File.SaveAs imap :browse confirm saveasi vmap :browse confirm saveasgv " File.Exit imap :q vmap :qgv endif " 1}}} " vim:foldmethod=marker