Create a free Team What is Teams? Learn more. How to switch to the directory listing from file view in vim? Ask Question. Asked 9 years, 2 months ago. Active 4 years, 1 month ago. Viewed 25k times. How to close the file to file navigation view? Improve this question. I didn't realise you could browse files from that folder view in vim. All solutions in How to go back to previous opened file in Vim? Add a comment.
There are aleady better answers, but if for some reason you wanted to use the shell to get the full path of the file this is more useful if you're going to perform some other operation on the file with the shell , on a Unix-like system you could run: :!
A realworld example might be if you're editing a config file, but don't have write permissions and don't want ot run Vim as root , you could edit the file, then run: :w! Sam Whited Sam Whited 5 5 bronze badges. To show the full path for all files, including resolved symlinks, use the following. The following will display the path relative to your current directory : :f[ile] That is :f or :file.
Simple and useful — Morteza Ziyae. Lua with nvim I wrote this function to get the full path of my current directory and then mapped it to the lualine any status line is the same.
Terrible name any suggestions? Dr Neo Dr Neo 3 3 bronze badges. Linux can try realpath command. Pegasus Pegasus 2 2 bronze badges. This only works for Linux. Welcome to Vi and Vim! Consider adding a caveat by edit ing your answer — D. This is actually a duplicate answer. Already mentioned in vi. Sign up or log in Sign up using Google. Sign up using Facebook.
Sign up using Email and Password. This is not what was asked, the question is how to open a long list of files. Well I googled exactly for this and landed here, so maybe the question is really ambiguous, but thanks for floating my boat. Luc Hermitte. Then see how many lines in the buffer 12 and run the macro like this: 12 o. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown.
The Overflow Blog. Podcast Helping communities build their own LTE networks. Podcast Making Agile work for data science. Featured on Meta. New post summary designs on greatest hits now, everywhere else eventually. Linked 0. Related Hot Network Questions. Question feed. Nothing more, nothing less. In particular, just hitting Enter will re-open the last opened file.
Assigning a shortcut to this is useful:. This saves few keystrokes compared to :browse oldfiles , q , 1 , Enter. These lines get netrw to sort files by those most recently modified.
Then one simply calls :e. There's a very handy plugin, ctrlp which allows you to use :CtrlPMRU , and you can quickly get what you looking for.
How are we doing? Please help us improve Stack Overflow. Take our short survey. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. View a list of recent documents in Vim Ask Question. Asked 13 years, 1 month ago. Active 22 days ago. Viewed 35k times. Zsolt Botykai Add a comment.
0コメント