Vim默认情况下,当您输入:e
并按上箭头时,它会显示以前使用:e
命令打开的文件列表。是否有办法将我通过终端使用vim <filename>
打开的文件也添加到这个列表中?
Vim默认情况下,当您输入:e
并按上箭头时,它会显示以前使用:e
命令打开的文件列表。是否有办法将我通过终端使用vim <filename>
打开的文件也添加到这个列表中?
一个可能性:
au BufEnter * for f in argv() | call histadd( "cmd", "e " . f ) | endfor
解释:
au # Autocommand.
BufEnter # Run it after entering a buffer.
* # For any file matching.
for f in argv() # Select files in argument list.
call histadd( "cmd", "e " . f ) # Append to history of ex commands (beginning
# with colon) letter 'e' (of edit) with file name.
endfor # Repeat next loop.
vimrc
文件中并尝试执行。
:buffers
可能对你有用。此外,还有一些很好的插件可以帮助你查找文件,比如Command-T
。 - deviousdodohistory
值吗?在~/.vimrc
文件中添加类似于set history=1000
的内容。Vim 默认为20。 - Peter Rincker