macos - Ctrl+6 不编辑在 macOS 终端中运行的 Vim 中的备用缓冲区

标签 macos vim terminal

在我的 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/

相关文章:

cocoa - 如何将 NSImage 保存为新文件

java - 自动化 UML2 类图

vim 在每行末尾显示空 block

linux - 如何将多行 bash 代码粘贴到终端并一次运行?

java - 当程序错误退出时如何在终端中重新启动程序?

Xcode 设置 : architecture vs valid architecture

macos - 防止点击 NSWindow/NSView 时激活应用程序

vim函数生成标签,输出后如何居中光标位置

在 vim 中搜索一行中只有 1 个匹配项

python - $ python -c "script"中的反斜杠