Vim:缓冲区 2 发生了什么?

Vim: what happened to buffer 2?

如果我打开 vim 的新实例,并且 :ls 打开缓冲区,我会看到:

1 %a   "[No Name]"                    line 1

然后当我打开一个文件时:

  1 %a   "Makefile"                     line 1

还有一个:

1 #h   "Makefile"                     line 1
3 %a   "start.sh"                     line 1

缓冲区 2 发生了什么?我在 linux 上使用 vim,但我确信我在 mac os 上也看到了相同的行为。我知道这并不重要,但它总是激起我的好奇心os。我用谷歌搜索了一下,什么也没找到,而且我不确定自己是否有足够的好奇心来阅读源代码,但如果有人知道答案,我很乐意听到!

$ vim --版本
VIM - Vi IMproved 7.4(2013 年 8 月 10 日,2015 年 1 月 14 日编译 20:15:22)
包含的补丁:1-580
由 Arch 编译 Linux
没有 GUI 的巨大版本。包含 (+) 或不包含 (-) 的功能:
+acl +farsi +mouse_netterm +语法
+阿拉伯语 +file_in_path +mouse_sgr +tag_binary
+autocmd +find_in_path -mouse_sysmouse +tag_old_static
-balloon_eval +浮动 +mouse_urxvt -tag_any_white
-浏览+折叠+mouse_xterm-tcl
++builtin_terms -页脚 +multi_byte +terminfo
+byte_offset +fork() +multi_lang +termresponse
+cindent +gettext -mzscheme +textobjects
-clientserver -hangul_input +netbeans_intg +title
-剪贴板+iconv +path_extra -工具栏
+cmdline_compl +insert_expand +perl +user_commands
+cmdline_hist +jumplist +persistent_undo +vertsplit
+cmdline_info +keymap +postscript +virtualedit
+评论 +langmap +打印机 +视觉
+隐藏 +libcall +配置文件 +visualextra
+cryptv +linebreak +python +viminfo
+cscope +lispindent -python3 +vreplace
+cursorbind +listcmds +quickfix +wildignore
+cursorshape +localmap +reltime +wildmenu
+dialog_con +lua +rightleft +windows
+diff +menu +ruby +writebackup
+digraphs +mksession +scrollbind -X11
-dnd +modify_fname +signs -xfontset
-ebcdic +mouse +smartindent -xim
+emacs_tags -mouseshape -sniff -xsmp
+eval +mouse_dec +startuptime -xterm_clipboard
+ex_extra +mouse_gpm +statusline -xterm_save
+extra_search -mouse_jsbterm -sun_workshop -xpm
   系统 vimrc 文件:“/etc/vimrc”
     用户 vimrc 文件:“$HOME/.vimrc”
 第二个用户 vimrc 文件:“~/.vim/vimrc”
      用户 exrc 文件:“$HOME/.exrc”
  $VIM 的回退:“/usr/share/vim”
编译:gcc -c -I。 -Iproto -DHAVE_CONFIG_H -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
链接:gcc -L。 -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,-E -Wl,-rpath,/usr/lib/perl5/core_perl/CORE -Wl,-O1,--sort-common,--as-needed,-z,relro -L/usr/local/lib -Wl,--as-needed -o vim -lm -lncurses -lelf -lnsl -lacl -lattr -lgpm -ldl -L/usr/lib -llua -Wl,-E -Wl,-rpath,/usr/lib/perl5/core_perl/CORE -Wl,-O1,--sort-common ,--根据需要,-z,relro -fstack-protector -L/usr/local/lib -L/usr/lib/perl5/core_perl/CORE -lperl -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc -L/usr/lib /python2.7/config -lpython2.7 -lpthread -ldl -lutil -lm -Xlinker -export-dynamic -lruby -lpthread -lgmp -ldl -lcrypt -lm -L/usr/lib

它仍然存在,但它是 unlisted-buffer。 用:buffers!看看吧

来自 :h unlisted :

                        *unlisted-buffer*
unlisted    The buffer is not in the buffer list.  It is not used for
        normal editing, but to show a help file, remember a file name
        or marks.  The ":bdelete" command will also set this option,
        thus it doesn't completely delete the buffer.