Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我希望Netrw( :e) 在我当前正在查看的文件的同一文件夹中打开。例如,
Netrw
:e
A ...B ...file1.txt ...file2.txt
如果我:e在文件夹内运行A,导航到文件夹B,打开file1.txt,然后:e再次运行,我希望 NetrwB作为目录打开,而不是A.
A
B
file1.txt
在这个Vimcast中找到了我的答案。:Explore或:E将在当前文件的目录中打开 Netrw。ambiguous use of user-defined command起初我尝试使用时遇到错误:E,但这个SO 答案帮助解决了这个问题。我只需要将此命令添加到我的.vimrc, command! -nargs=* -bar -bang -count=0 -complete=dir E Explore <args>。:E仅在没有其他可能的以 . 开头的命令时才有效:E。
:Explore
:E
ambiguous use of user-defined command
.vimrc
command! -nargs=* -bar -bang -count=0 -complete=dir E Explore <args>
试试set autochdir你的 .vimrc
set autochdir