在我的 macOS High Sierra 10.13.6 上,我启动了 vim
在终端中并在 Vim 中输入以下命令。
:e foo.txt
:e bar.txt
现在,如果我按 Ctrl+6,它不会返回到备用文件
foo.txt
.Ctrl+Shift+6 工作正常并返回到备用文件
foo.txt
.我使用过的所有其他 Vim、MacVim 或 GVim 都会在按 Ctrl+6 时返回到备用文件。为什么它不适用于
vim
macOS 的?这是我的 vim 版本详细信息:
$ which vim
/usr/bin/vim
$ vim --version
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Nov 29 2017 18:37:46)
Included patches: 1-503, 505-680, 682-1283
Compiled by root@apple.com
Normal version without GUI. Features included (+) or not (-):
+acl +file_in_path -mouse_sgr +tag_old_static
-arabic +find_in_path -mouse_sysmouse -tag_any_white
+autocmd +float -mouse_urxvt -tcl
-balloon_eval +folding +mouse_xterm -termguicolors
-browse -footer +multi_byte -terminal
+builtin_terms +fork() +multi_lang +terminfo
+byte_offset -gettext -mzscheme +termresponse
+channel -hangul_input +netbeans_intg +textobjects
+cindent +iconv +num64 +timers
-clientserver +insert_expand +packages +title
-clipboard +job +path_extra -toolbar
+cmdline_compl +jumplist -perl +user_commands
+cmdline_hist -keymap +persistent_undo +vertsplit
+cmdline_info +lambda +postscript +virtualedit
+comments -langmap +printer +visual
-conceal +libcall -profile +visualextra
+cryptv +linebreak +python/dyn +viminfo
+cscope +lispindent -python3 +vreplace
+cursorbind +listcmds +quickfix +wildignore
+cursorshape +localmap +reltime +wildmenu
+dialog_con -lua -rightleft +windows
+diff +menu +ruby/dyn +writebackup
+digraphs +mksession +scrollbind -X11
-dnd +modify_fname +signs -xfontset
-ebcdic +mouse +smartindent -xim
-emacs_tags -mouseshape +startuptime -xpm
+eval -mouse_dec +statusline -xsmp
+ex_extra -mouse_gpm -sun_workshop -xterm_clipboard
+extra_search -mouse_jsbterm +syntax -xterm_save
-farsi -mouse_netterm +tag_binary
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
defaults file: "$VIMRUNTIME/defaults.vim"
fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DMACOS_X_UNIX -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -L/usr/local/lib -o vim -lm -lncurses -liconv -framework Cocoa
最佳答案
似乎 vim 实际上映射了 <C-^>
这是大多数终端在您按 <C-6>
时发送的信息. mac终端不发送<C-^>
但没什么。 <c-s-6>
最有可能工作,因为 <s-6>
是 ^
.
关于macos - Ctrl+6 不编辑在 macOS 终端中运行的 Vim 中的备用缓冲区,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53762740/