vim 能够打开目录(然后在其中浏览)。
vim roles/webservices/tasks/
" ============================================================================
" Netrw Directory Listing (netrw v156)
" /home/gwagner/repos/automation_postgres/roles/webservices/tasks
" Sorted by name
" Sort sequence: [\/]$,\<core\%(\.\d\+\)\=\>,\.h$,\.c$,\.cpp$,\~\=\*$,*,\.o$,\.obj$,\.info$,\.swp$,\.bak$,\~$
" Quick Help: <F1>:help -:go up dir D:delete R:rename s:sort-by x:special
" ==============================================================================
../
./
download_file.yml
main.yml
post_data.yml
post_du.yml
~
现在,关闭文件时是否可以跳回到 vim 内的目录浏览器?
:wq
,,:q
将:x
你带回到你之前所在的 bash
答案1
该命令:Explore
将打开目录列表。
从:help :Explore
(vim 9.0
):
DIRECTORY EXPLORATION COMMANDS {{{2
:[N]Explore[!] [dir]... Explore directory of current file *:Explore*
:[N]Hexplore[!] [dir]... Horizontal Split & Explore *:Hexplore*
:[N]Lexplore[!] [dir]... Left Explorer Toggle *:Lexplore*
:[N]Sexplore[!] [dir]... Split&Explore current file's directory *:Sexplore*
:[N]Vexplore[!] [dir]... Vertical Split & Explore *:Vexplore*
:Texplore [dir]... Tab & Explore *:Texplore*
:Rexplore ... Return to/from Explorer *:Rexplore*
Used with :Explore **/pattern : (also see |netrw-starstar|)
:Nexplore............. go to next matching file *:Nexplore*
:Pexplore............. go to previous matching file *:Pexplore*
*netrw-:Explore*
:Explore will open the local-directory browser on the current file's
directory (or on directory [dir] if specified). The window will be
split only if the file has been modified and |'hidden'| is not set,
otherwise the browsing window will take over that window. Normally
the splitting is taken horizontally.
Also see: |netrw-:Rexplore|
:Explore! is like :Explore, but will use vertical splitting.