Re: [Fwd: Ctrl-^]
- Stephen Riehm wrote:
> Strangely though, the following map provides a "close alternative".You inspired me to test this map:
> map <S-C-6> <ESC>:w!<CR>:e#<CR>
> Good luck though - maybe things have changed enough on the mac platform
> to allow ctrl-6 again.
:map <c-6> :e #<CR>
On my version of Vim, this works for mapping ctrl-6 to edit the previous
buffer (and it also makes ctrl-^ work as well). When I unmap <c-6>,
neither ctrl-6 nor ctrl-^ switches to the previous buffer; instead, they
both accumulate 6's as the numeric argument (e.g., `ctrl-6 k` moves 6
So for me, at least, this is a good work-around pending a fix in the
code base. I tested this on Vim 7.206, compiled as below:
VIM - Vi IMproved 7.0 (2006 May 7, compiled Mar 3 2007 15:21:47)
MacOS X (unix) version
Included patches: 1-206
Compiled by mike@mac
Huge version with Carbon GUI. Features included (+) or not (-):
+arabic +autocmd -balloon_eval +browse ++builtin_terms +byte_offset +cindent
-clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info
+cryptv -cscope +cursorshape +dialog_con_gui +diff +digraphs -dnd -ebcdic
+emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path
+folding -footer +fork() -gettext -hangul_input +iconv +insert_expand
+keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap +menu
+mksession +modify_fname +mouse -mouseshape +mouse_dec -mouse_gpm
-mouse_jsbterm +mouse_netterm +mouse_xterm +multi_byte +multi_lang -mzscheme
-netbeans_intg -osfiletype +path_extra -perl +postscript +printer +profile
-python +quickfix +reltime +rightleft -ruby +scrollbind +signs +smartindent
-sniff +statusline -sun_workshop +syntax +tag_binary +tag_old_static
-tag_any_white -tcl +terminfo +termresponse +textobjects +title -toolbar
+user_commands +vertsplit +virtualedit +visual +visualextra +viminfo
+wildignore +wildmenu +windows +writebackup -X11 -xfontset -xim -xsmp
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
user exrc file: "$HOME/.exrc"
system gvimrc file: "$VIM/gvimrc"
user gvimrc file: "$HOME/.gvimrc"
system menu file: "$VIMRUNTIME/menu.vim"
fall-back for $VIM: "/Applications/Vim.app/Contents/Resources/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MAC
cal-strings -Wall -Wno-unknown-pragmas -mdynamic-no-pic -pipe -I.
S_X_UNIX -no-cpp-precomp -I/Developer/Headers/FlatCarbon -g -O
gcc -L/usr/local/lib -o Vim -framework Carbon -lncurses -liconv
> Many years ago, when I was the maintainer of the Win32 ports ofthe attached patch converts Ctrl-6 to Ctrl-HAT and Ctrl-2 to Ctrl-AT
> Vim, I made Vim accept Ctrl-6 as a synonym for Ctrl-^ (Ctrl+Shift+6
> on US keyboards). This behavior must have been propagated into the
> gtk version of gvim at some point. Now it's deep in my muscle
> memory and I get frustrated at having to type ":b #" or ":e #"
(this is done in most other guis as well). With it, Ctrl-V Ctrl-6 at
least outputs ^^, which seems sensible. Can you try if this patch
does what you want?
ps: The list probably strips the patch (why oh why does it always do
this?), so I've also uploaded it to http://wiki.macvim.org/wiki/
VimPatches/Ctrl6 if someone else wants to test it.