" " cream-menu-settings.vim " " 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. function! Cream_menu_settings() " functionalized so we can toggle texts based on state " remove menu and restore silent! unmenu &Settings silent! unmenu! &Settings " status check mark (GTK2) if has("gui_gtk2") && &encoding == "utf8" || &encoding == "utf-8" " try various chars, verifying they are one char width if strlen(substitute(strtrans(nr2char(0x2713)), ".", "x", "g")) == 1 let s:on = nr2char(0x2713) . '\ ' " ✓ let s:off = '\ \ \ ' elseif strlen(substitute(strtrans(nr2char(0x221a)), ".", "x", "g")) == 1 let s:on = nr2char(0x221a) . '\ ' " √ let s:off = '\ \ \ ' elseif strlen(substitute(strtrans(nr2char(0x2714)), ".", "x", "g")) == 1 let s:on = nr2char(0x2714) . '\ ' " ✔ let s:off = '\ \ \ ' endif endif " catch all platforms and GTK2 failures if !exists("s:on") "let s:on = nr2char(215) . '\ ' let s:on = '*\ ' let s:off = '\ \ \ ' endif " Main Menu {{{1 " invisibles function! Cream_menu_settings_invisibles() if exists("g:LIST") && g:LIST == 1 silent! execute 'iunmenu &Settings.' . s:off . '&Show/Hide\ InvisiblesF4' silent! execute 'vunmenu &Settings.' . s:off . '&Show/Hide\ InvisiblesF4' execute 'imenu 60.001 &Settings.' . s:on . '&Show/Hide\ InvisiblesF4 :call Cream_list_toggle("i")' execute 'vmenu 60.002 &Settings.' . s:on . '&Show/Hide\ InvisiblesF4 :call Cream_list_toggle("v")' elseif exists("g:LIST") && g:LIST == 0 silent! execute 'iunmenu &Settings.' . s:on . '&Show/Hide\ InvisiblesF4' silent! execute 'vunmenu &Settings.' . s:on . '&Show/Hide\ InvisiblesF4' execute 'imenu 60.001 &Settings.' . s:off . '&Show/Hide\ InvisiblesF4 :call Cream_list_toggle("i")' execute 'vmenu 60.002 &Settings.' . s:off . '&Show/Hide\ InvisiblesF4 :call Cream_list_toggle("v")' endif endfunction " line numbers function! Cream_menu_settings_linenumbers() if exists("g:CREAM_LINENUMBERS") && g:CREAM_LINENUMBERS == 1 silent! execute 'aunmenu &Settings.' . s:off . 'Line\ &Numbers' execute 'anoremenu 60.003 &Settings.' . s:on . 'Line\ &Numbers :call Cream_linenumbers_toggle()' elseif exists("g:CREAM_LINENUMBERS") && g:CREAM_LINENUMBERS == 0 silent! execute 'aunmenu &Settings.' . s:on . 'Line\ &Numbers' execute 'anoremenu 60.003 &Settings.' . s:off . 'Line\ &Numbers :call Cream_linenumbers_toggle()' endif endfunction anoremenu 60.004 &Settings.-Sep004- " word wrap function! Cream_menu_settings_wordwrap() if exists("g:CREAM_WRAP") && g:CREAM_WRAP == 1 silent! execute 'aunmenu &Settings.' . s:off . '&Word\ WrapCtrl+W' execute 'anoremenu 60.005 &Settings.' . s:on . '&Word\ WrapCtrl+W :call Cream_wrap("i")' elseif exists("g:CREAM_WRAP") && g:CREAM_WRAP == 0 silent! execute 'aunmenu &Settings.' . s:on . '&Word\ WrapCtrl+W' execute 'anoremenu 60.005 &Settings.' . s:off . '&Word\ WrapCtrl+W :call Cream_wrap("i")' endif endfunction " auto wrap function! Cream_menu_settings_autowrap() if exists("g:CREAM_AUTOWRAP") && g:CREAM_AUTOWRAP == 1 silent! execute 'aunmenu &Settings.' . s:off . 'A&uto\ WrapCtrl+E' execute 'anoremenu 60.006 &Settings.' . s:on . 'A&uto\ WrapCtrl+E :call Cream_autowrap("i")' elseif exists("g:CREAM_AUTOWRAP") && g:CREAM_AUTOWRAP == 0 silent! execute 'aunmenu &Settings.' . s:on . 'A&uto\ WrapCtrl+E' execute 'anoremenu 60.006 &Settings.' . s:off . 'A&uto\ WrapCtrl+E :call Cream_autowrap("i")' endif endfunction " wrap width anoremenu 60.007 &Settings.&Set\ Wrap\ Width\.\.\. :call Cream_autowrap_setwidth() " highlight wrap width function! Cream_menu_settings_highlightwrapwidth() if exists("b:cream_col_highlight") silent! execute 'aunmenu &Settings.' . s:off . '&Highlight\ Wrap\ Width' execute 'anoremenu 60.008 &Settings.' . s:on . '&Highlight\ Wrap\ Width :call Cream_highlight_columns(g:CREAM_AUTOWRAP_WIDTH)' else silent! execute 'aunmenu &Settings.' . s:on . '&Highlight\ Wrap\ Width' execute 'anoremenu 60.008 &Settings.' . s:off . '&Highlight\ Wrap\ Width :call Cream_highlight_columns(g:CREAM_AUTOWRAP_WIDTH)' endif endfunction " tabs anoremenu 60.010 &Settings.-Sep010- anoremenu 60.011 &Settings.&Tabstop\ Width\.\.\. :call Cream_tabstop() anoremenu 60.012 &Settings.Soft\ Ta&bstop\ Width\.\.\. :call Cream_softtabstop() " expand tab function! Cream_menu_settings_expandtab() if exists("g:CREAM_EXPANDTAB") && g:CREAM_EXPANDTAB == 1 silent! execute 'iunmenu &Settings.' . s:off . 'Tab\ &ExpansionCtrl+T' silent! execute 'vunmenu &Settings.' . s:off . 'Tab\ &ExpansionCtrl+T' execute 'imenu 60.014 &Settings.' . s:on . 'Tab\ &ExpansionCtrl+T :call Cream_expandtab_toggle("i")' execute 'vmenu 60.015 &Settings.' . s:on . 'Tab\ &ExpansionCtrl+T :call Cream_expandtab_toggle("v")' elseif exists("g:CREAM_EXPANDTAB") && g:CREAM_EXPANDTAB == 0 silent! execute 'iunmenu &Settings.' . s:on . 'Tab\ &ExpansionCtrl+T' silent! execute 'vunmenu &Settings.' . s:on . 'Tab\ &ExpansionCtrl+T' execute 'imenu 60.014 &Settings.' . s:off . 'Tab\ &ExpansionCtrl+T :call Cream_expandtab_toggle("i")' execute 'vmenu 60.015 &Settings.' . s:off . 'Tab\ &ExpansionCtrl+T :call Cream_expandtab_toggle("v")' endif endfunction " autoindent function! Cream_menu_settings_autoindent() if exists("g:CREAM_AUTOINDENT") && g:CREAM_AUTOINDENT == 1 silent! execute 'aunmenu &Settings.' . s:off . '&Auto-indent' execute 'anoremenu 60.016 &Settings.' . s:on . '&Auto-indent :call Cream_autoindent_toggle()' elseif exists("g:CREAM_AUTOINDENT") && g:CREAM_AUTOINDENT == 0 silent! execute 'aunmenu &Settings.' . s:on . '&Auto-indent' execute 'anoremenu 60.016 &Settings.' . s:off . '&Auto-indent :call Cream_autoindent_toggle()' endif endfunction anoremenu 60.020 &Settings.-Sep020- " highlight find function! Cream_menu_settings_highlightsearch() if exists("g:CREAM_SEARCH_HIGHLIGHT") && g:CREAM_SEARCH_HIGHLIGHT == 1 silent! execute 'aunmenu &Settings.' . s:off . 'Highlight\ Find' execute 'anoremenu 60.021 &Settings.' . s:on . 'Highlight\ Find :call Cream_search_highlight_toggle()' elseif exists("g:CREAM_SEARCH_HIGHLIGHT") && g:CREAM_SEARCH_HIGHLIGHT == 0 silent! execute 'aunmenu &Settings.' . s:on . 'Highlight\ Find' execute 'anoremenu 60.021 &Settings.' . s:off . 'Highlight\ Find :call Cream_search_highlight_toggle()' endif endfunction " clear find imenu 60.022 &Settings.Highlight\ Find\ &Clear :nohlsearch vmenu 60.022 &Settings.Highlight\ Find\ &Clear :nohlsearch anoremenu 60.024 &Settings.-Sep024- " highlight current line function! Cream_menu_settings_highlightcurrentline() if exists("g:CREAM_HIGHLIGHT_CURRENTLINE") silent! execute 'aunmenu &Settings.' . s:off . 'Highlight\ Current\ Line' execute 'anoremenu 60.025 &Settings.' . s:on . 'Highlight\ Current\ Line :call Cream_highlight_currentline_toggle()' else silent! execute 'aunmenu &Settings.' . s:on . 'Highlight\ Current\ Line' execute 'anoremenu 60.025 &Settings.' . s:off . 'Highlight\ Current\ Line :call Cream_highlight_currentline_toggle()' endif endfunction " syntax menu function! Cream_menu_settings_syntax() if exists("g:CREAM_SYNTAX") && g:CREAM_SYNTAX == 1 silent! execute 'iunmenu &Settings.' . s:off . 'Syntax\ Highlighting' silent! execute 'vunmenu &Settings.' . s:off . 'Syntax\ Highlighting' execute 'imenu 60.030 &Settings.' . s:on . 'Syntax\ Highlighting :call Cream_syntax_toggle("i")' execute 'vmenu 60.030 &Settings.' . s:on . 'Syntax\ Highlighting :call Cream_syntax_toggle("v")' elseif exists("g:CREAM_SYNTAX") && g:CREAM_SYNTAX == 0 silent! execute 'iunmenu &Settings.' . s:on . 'Syntax\ Highlighting' silent! execute 'vunmenu &Settings.' . s:on . 'Syntax\ Highlighting' execute 'imenu 60.030 &Settings.' . s:off . 'Syntax\ Highlighting :call Cream_syntax_toggle("i")' execute 'vmenu 60.030 &Settings.' . s:off . 'Syntax\ Highlighting :call Cream_syntax_toggle("v")' endif endfunction " Filetypes {{{1 """function! Cream_menu_settings_filetypes() """" *** called via VimEnter command on startup, so filetypes_list() is available *** """" "menu-izes" the aviable filetypes """ """ let idx = 200 """ execute "anoremenu \ 60." . idx . " &Settings.-Sep200- \" """ let idx = idx + 1 """ """ let myfiletypes = Cream_vim_syntax_list() . "\n" """ "let myfiletypes = Cream_get_filetypes() . "\n" """ " use destructive process, multvals too slow """ let i = 0 " itteration index """ while myfiletypes != "" """ let pos = stridx(myfiletypes, "\n") """ let myitem = strpart(myfiletypes, 0, pos) """ let myfiletypes = strpart(myfiletypes, pos + 1) """ """ let letters = "[" . toupper(myitem[0]) . "]" """ """ let command = "anoremenu \ 60." . (i + idx) . " &Settings.&Filetype." . letters . "." . myitem . " :call Cream_filetype(\"" . myitem . "\")\" """ """ execute command """ """ let i = i + 1 """ endwhile """ """endfunction " TODO: Experimentation with caching filetype menu and loading it " only when the user requests it. anoremenu 60.100 &Settings.-Sep100- function! Cream_menu_filetypes_init() " Initialize Filetypes submenu if cache exists. let myfile = g:cream_user . "menu-filetype.vim" " load if exists if filereadable(myfile) call Cream_source(myfile) anoremenu 60.101 &Settings.&Filetype.-Sep101- anoremenu 60.102 &Settings.&Filetype.Re-fresh\ Available\ Filetypes\.\.\. :call Cream_menu_filetypes("refresh") else anoremenu 60.101 &Settings.&Filetype.Menu\ the\ Available\ Filetypes\.\.\. :call Cream_menu_filetypes() endif endfunction call Cream_menu_filetypes_init() function! Cream_menu_filetypes(...) " Filetype submenu when user requests, either initially or to re-fresh. " " Notes: " o Called via VimEnter command on startup, so filetypes_list() is " available! (We parse autocmds.) " o This submenu optimized for speed. Parsing each " time is slow, so we cache it in g:cream_user / menu-filetype.vim. " The function below creates the cache if it doesn't exist and then " loads the menu from it. let myfile = g:cream_user . "menu-filetype.vim" " reasons to re-cache " 1. arg is "refresh" if a:0 > 0 && a:1 == "refresh" let flag = 1 endif " 2. every 10 times used let mytime = localtime() if mytime[9] == "9" let flag = 1 endif " delete cache if exists("flag") call delete(myfile) endif " cache if doesn't exist if !filereadable(myfile) call Cream_menu_filetypes_cache() endif " remove any existing submenu silent! unmenu &Settings.&Filetype silent! unmenu! &Settings.&Filetype " load anoremenu 60.105 &Settings.&Filetype.-Sep105- anoremenu 60.106 &Settings.&Filetype.Re-fresh\ Available\ Filetypes\.\.\. :call Cream_menu_filetypes("refresh") call Cream_source(myfile) endfunction function! Cream_menu_filetypes_cache() " Re/creates filetype menu cache, overwriting any existing. let @x = "" let i = 0 let idx = 110 let myfts = Cream_vim_syntax_list() . "\n" " use destructive process, multvals too slow while myfts != "" let pos = stridx(myfts, "\n") let myitem = strpart(myfts, 0, pos) let myfts = strpart(myfts, pos + 1) let letters = "[" . toupper(myitem[0]) . "]" let @x = @x . "anoremenu \ 60." . (i + idx) . " &Settings.&Filetype." . letters . "." . myitem . ' :call Cream_filetype("' . myitem . '")' . "\n" let i = i + 1 endwhile " TODO: Fix windowing mistakes inherant in this... " mark place let mypos = Cream_pos() " TODO: use Vim7 to write var to file. " open temp buffer silent! enew silent! put x " save as silent! execute "silent! write! " . g:cream_user . "menu-filetype.vim" " close buffer silent! bwipeout! " return execute mypos call confirm( \ "Settings > Filetype menu filled.\n" . \ "\n", "&Ok", 1, "Info") endfunction " Preferences {{{1 anoremenu 60.600 &Settings.-Sep600- function! Cream_menu_settings_preferences() " remove menu and restore silent! unmenu &Settings.P&references silent! unmenu! &Settings.P&references if has("gui") anoremenu 60.601 &Settings.P&references.Font\.\.\. :call Cream_font_set() endif " toolbar if exists("g:CREAM_TOOLBAR") && g:CREAM_TOOLBAR == 1 execute 'anoremenu 60.602 &Settings.P&references.' . s:on . 'Toolbar :call Cream_toolbar_toggle()' else execute 'anoremenu 60.602 &Settings.P&references.' . s:off . 'Toolbar :call Cream_toolbar_toggle()' endif " statusline if exists("g:CREAM_STATUSLINE") && g:CREAM_STATUSLINE == 1 execute 'anoremenu 60.604 &Settings.P&references.' . s:on . 'Statusline :call Cream_statusline_toggle()' else execute 'anoremenu 60.604 &Settings.P&references.' . s:off . 'Statusline :call Cream_statusline_toggle()' endif " tabpages if v:version >= 700 if exists("g:CREAM_TABPAGES") && g:CREAM_TABPAGES == 1 execute 'anoremenu 60.606 &Settings.P&references.' . s:on . 'Tabbed\ Documents :call Cream_tabpages_toggle()' else execute 'anoremenu 60.606 &Settings.P&references.' . s:off . 'Tabbed\ Documents :call Cream_tabpages_toggle()' endif endif " Preferences, Color {{{2 if has("gui") if exists("g:cream_dev") " color themes, selection anoremenu 60.610 &Settings.P&references.-Sep610- anoremenu 60.611 &Settings.P&references.&Color\ Themes.Selection.Reverse\ Black\ (default) :call Cream_colors_selection("reverseblack") anoremenu 60.612 &Settings.P&references.&Color\ Themes.Selection.Reverse\ Blue :call Cream_colors_selection("reverseblue") anoremenu 60.613 &Settings.P&references.&Color\ Themes.Selection.Terminal :call Cream_colors_selection("terminal") anoremenu 60.614 &Settings.P&references.&Color\ Themes.Selection.Navajo :call Cream_colors_selection("navajo") anoremenu 60.615 &Settings.P&references.&Color\ Themes.Selection.Navajo-Night :call Cream_colors_selection("navajo-night") anoremenu 60.616 &Settings.P&references.&Color\ Themes.Selection.Night :call Cream_colors_selection("night") anoremenu 60.617 &Settings.P&references.&Color\ Themes.Selection.Vim :call Cream_colors_selection("vim") anoremenu 60.618 &Settings.P&references.&Color\ Themes.Selection.Magenta :call Cream_colors_selection("magenta") " experimental anoremenu 60.620 &Settings.P&references.&Color\ Themes.Selection.-Sep620- anoremenu 60.621 &Settings.P&references.&Color\ Themes.Selection.(experimental\ below) anoremenu 60.622 &Settings.P&references.&Color\ Themes.Selection.-Sep622- anoremenu 60.623 &Settings.P&references.&Color\ Themes.Selection.Lt\.\ Magenta :call Cream_colors_selection("ltmagenta") anoremenu 60.624 &Settings.P&references.&Color\ Themes.Selection.Dk\.\ Magenta :call Cream_colors_selection("dkmagenta") anoremenu 60.625 &Settings.P&references.&Color\ Themes.Selection.Magenta :call Cream_colors_selection("magenta") anoremenu 60.626 &Settings.P&references.&Color\ Themes.Selection.Blue :call Cream_colors_selection("blue") anoremenu 60.627 &Settings.P&references.&Color\ Themes.Selection.Orange :call Cream_colors_selection("orange") anoremenu 60.628 &Settings.P&references.&Color\ Themes.Selection.Green :call Cream_colors_selection("green") anoremenu 60.629 &Settings.P&references.&Color\ Themes.Selection.Gold :call Cream_colors_selection("gold") anoremenu 60.630 &Settings.P&references.&Color\ Themes.Selection.Purple :call Cream_colors_selection("purple") anoremenu 60.631 &Settings.P&references.&Color\ Themes.Selection.Wheat :call Cream_colors_selection("wheat") anoremenu 60.632 &Settings.P&references.&Color\ Themes.-Sep632- endif " color schemes (Cream) if exists("g:CREAM_COLORS") && g:CREAM_COLORS == "cream" execute 'anoremenu 60.633 &Settings.P&references.&Color\ Themes.' . s:on . 'Cream\ (default) :call Cream_colors("cream")' else execute 'anoremenu 60.633 &Settings.P&references.&Color\ Themes.' . s:off . 'Cream\ (default) :call Cream_colors("cream")' endif if exists("g:CREAM_COLORS") && g:CREAM_COLORS == "blackwhite" execute 'anoremenu 60.634 &Settings.P&references.&Color\ Themes.' . s:on . 'Black\ and\ White :call Cream_colors("blackwhite")' else execute 'anoremenu 60.634 &Settings.P&references.&Color\ Themes.' . s:off . 'Black\ and\ White :call Cream_colors("blackwhite")' endif if exists("g:CREAM_COLORS") && g:CREAM_COLORS == "chocolateliquor" execute 'anoremenu 60.635 &Settings.P&references.&Color\ Themes.' . s:on . 'Chocolate\ Liquor :call Cream_colors("chocolateliquor")' else execute 'anoremenu 60.635 &Settings.P&references.&Color\ Themes.' . s:off . 'Chocolate\ Liquor :call Cream_colors("chocolateliquor")' endif if exists("g:CREAM_COLORS") && g:CREAM_COLORS == "dawn" execute 'anoremenu 60.636 &Settings.P&references.&Color\ Themes.' . s:on . 'Dawn :call Cream_colors("dawn")' else execute 'anoremenu 60.636 &Settings.P&references.&Color\ Themes.' . s:off . 'Dawn :call Cream_colors("dawn")' endif if exists("g:CREAM_COLORS") && g:CREAM_COLORS == "inkpot" execute 'anoremenu 60.637 &Settings.P&references.&Color\ Themes.' . s:on . 'Inkpot :call Cream_colors("inkpot")' else execute 'anoremenu 60.637 &Settings.P&references.&Color\ Themes.' . s:off . 'Inkpot :call Cream_colors("inkpot")' endif if exists("g:CREAM_COLORS") && g:CREAM_COLORS == "navajo" execute 'anoremenu 60.638 &Settings.P&references.&Color\ Themes.' . s:on . 'Navajo :call Cream_colors("navajo")' else execute 'anoremenu 60.638 &Settings.P&references.&Color\ Themes.' . s:off . 'Navajo :call Cream_colors("navajo")' endif if exists("g:CREAM_COLORS") && g:CREAM_COLORS == "navajo-night" execute 'anoremenu 60.639 &Settings.P&references.&Color\ Themes.' . s:on . 'Navajo-Night :call Cream_colors("navajo-night")' else execute 'anoremenu 60.639 &Settings.P&references.&Color\ Themes.' . s:off . 'Navajo-Night :call Cream_colors("navajo-night")' endif if exists("g:CREAM_COLORS") && g:CREAM_COLORS == "night" execute 'anoremenu 60.640 &Settings.P&references.&Color\ Themes.' . s:on . 'Night :call Cream_colors("night")' else execute 'anoremenu 60.640 &Settings.P&references.&Color\ Themes.' . s:off . 'Night :call Cream_colors("night")' endif if exists("g:CREAM_COLORS") && g:CREAM_COLORS == "oceandeep" execute 'anoremenu 60.641 &Settings.P&references.&Color\ Themes.' . s:on . 'Ocean\ Deep :call Cream_colors("oceandeep")' else execute 'anoremenu 60.641 &Settings.P&references.&Color\ Themes.' . s:off . 'Ocean\ Deep :call Cream_colors("oceandeep")' endif if exists("g:CREAM_COLORS") && g:CREAM_COLORS == "terminal" execute 'anoremenu 60.642 &Settings.P&references.&Color\ Themes.' . s:on . 'Terminal\ (reverse) :call Cream_colors("terminal")' else execute 'anoremenu 60.642 &Settings.P&references.&Color\ Themes.' . s:off . 'Terminal\ (reverse) :call Cream_colors("terminal")' endif if exists("g:CREAM_COLORS") && g:CREAM_COLORS == "zenburn" execute 'anoremenu 60.643 &Settings.P&references.&Color\ Themes.' . s:on . 'Zenburn :call Cream_colors("zenburn")' else execute 'anoremenu 60.643 &Settings.P&references.&Color\ Themes.' . s:off . 'Zenburn :call Cream_colors("zenburn")' endif function! Cream_menu_colors() " color schemes (Vim's only! Ours are specifically "menu-ized" ;) " * This function is called via VimEnter autocmd so multvals is available. " this should be dev-only! if !exists("g:cream_dev") return else anoremenu 60.650 &Settings.P&references.&Color\ Themes.-Sep650- "anoremenu 60.651 &Settings.P&references.&Color\ Themes.gVim\ themes\ (non-Cream): endif let mycolors = globpath(&runtimepath, "colors/*.vim") if strlen(mycolors) > 0 let mycolors = mycolors . "\n" endif " menu each item let idx = 652 let i = 0 while i < MvNumberOfElements(mycolors, "\n") let mycolor = MvElementAt(mycolors, "\n", i) " name doesn't have path let mycolor = substitute(mycolor, '.*[/\\:]\([^/\\:]*\)\.vim', '\1', '') execute "anoremenu 60." . idx . ' &Settings.P&references.&Color\ Themes.gVim\ themes\ (non-Cream).' . mycolor . " :colors " . mycolor . "\" let i = i + 1 endwhile endfunction "" load on re-sets, not startup (multvals isn't avialable) "call Cream_menu_colors() endif " 2}}} anoremenu 60.700 &Settings.P&references.-Sep700- " last file restore if !exists("g:CREAM_LAST_BUFFER_FORGET") "silent! execute 'aunmenu &Settings.P&references.' . s:off . 'Last\ File\ Restore' execute 'anoremenu 60.701 &Settings.P&references.' . s:on . 'Last\ File\ Restore :call Cream_last_buffer_toggle()' else "silent! execute 'aunmenu &Settings.P&references.' . s:on . 'Last\ File\ Restore' execute 'anoremenu 60.701 &Settings.P&references.' . s:off . 'Last\ File\ Restore :call Cream_last_buffer_toggle()' endif if exists("g:CREAM_SINGLESERVER") && g:CREAM_SINGLESERVER == 1 execute 'anoremenu 60.702 &Settings.P&references.' . s:on . '&Single-Session\ Mode :call Cream_singleserver_toggle()' else execute 'anoremenu 60.702 &Settings.P&references.' . s:off . '&Single-Session\ Mode :call Cream_singleserver_toggle()' endif if exists("g:CREAM_WINPOS") && g:CREAM_WINPOS == 1 execute 'anoremenu 60.703 &Settings.P&references.' . s:on . 'Remember\ Window\ Position :call Cream_winpos_toggle()' else execute 'anoremenu 60.703 &Settings.P&references.' . s:off . 'Remember\ Window\ Position :call Cream_winpos_toggle()' endif if exists("g:CREAM_MOUSE_XSTYLE") && g:CREAM_MOUSE_XSTYLE == 1 execute 'anoremenu 60.704 &Settings.P&references.' . s:on . '&Middle-Mouse\ Pastes :call Cream_mouse_middle_toggle()' else execute 'anoremenu 60.704 &Settings.P&references.' . s:off . '&Middle-Mouse\ Pastes :call Cream_mouse_middle_toggle()' endif if exists("g:CREAM_BRACKETMATCH") && g:CREAM_BRACKETMATCH == 1 execute 'anoremenu 60.705 &Settings.P&references.' . s:on . 'Bracket\ Flashing :call Cream_bracketmatch_toggle()' else execute 'anoremenu 60.705 &Settings.P&references.' . s:off . 'Bracket\ Flashing :call Cream_bracketmatch_toggle()' endif anoremenu 60.706 &Settings.P&references.-Sep706- anoremenu 60.707 &Settings.P&references.Info\ Pop\ Options\.\.\. :call Cream_pop_options() " language anoremenu 60.708 &Settings.P&references.-Sep708- anoremenu 60.709 &Settings.P&references.Language\.\.\.\ (Future) " Keymap {{{2 if has("keymap") " get vim's list let maps = Cream_getfilelist($VIMRUNTIME . "/keymap/*.vim") if maps != "" " none if exists("g:CREAM_KEYMAP") && g:CREAM_KEYMAP == "" execute 'anoremenu 60.799 &Settings.P&references.&Keymap.' . s:on . 'None :call Cream_keymap("")' else execute 'anoremenu 60.799 &Settings.P&references.&Keymap.' . s:off . 'None :call Cream_keymap("")' endif " other let cnt = MvNumberOfElements(maps, "\n") let i = 0 while i < cnt let mapp = MvElementAt(maps, "\n", i) let mapp = matchstr(mapp, 'keymap/\zs.*\ze\.vim') " cat string let idx = i while strlen(idx) < 2 let idx = "0" . idx endwhile if exists("g:CREAM_KEYMAP") && g:CREAM_KEYMAP == mapp " if this map is active execute 'anoremenu 60.8' . idx . ' &Settings.P&references.&Keymap.' . s:on . mapp . ' :call Cream_keymap("' . mapp . '")' else " if this map isn't execute 'anoremenu 60.8' . idx . ' &Settings.P&references.&Keymap.' . s:off . mapp . ' :call Cream_keymap("' . mapp . '")' endif let i = i + 1 endwhile endif endif " 2}}} anoremenu 60.900 &Settings.P&references.-Sep900- " Expert mode anoremenu 60.901 &Settings.P&references.&Expert\ Mode\.\.\. :call Cream_expertmode_toggle() " Behavior anoremenu 60.902 &Settings.P&references.&Behavior.&Cream\ (default) :call Cream_behave_cream() anoremenu 60.903 &Settings.P&references.&Behavior.&Cream\ Lite\.\.\. :call Cream_behave_creamlite() anoremenu 60.904 &Settings.P&references.&Behavior.&Vim\.\.\. :call Cream_behave_vim() anoremenu 60.905 &Settings.P&references.&Behavior.&Vi\.\.\. :call Cream_behave_vi() endfunction endfunction call Cream_menu_settings() " 1}}} " vim:foldmethod=marker