Questions tagged [netrw]

Questions about the Netrw plugin which adds directory listing to Vim, and allows you to open files over the network (ftp, http, scp, etc).

Filter by
Sorted by
Tagged with
24 votes
2 answers
4k views

How can I make gx recognise full URLs in vim?

By default, if a buffer in vim contains a URL such as http://www.google.com, gx in normal mode will open a browser with that URL. That's very handy. However, if the URL has URL parameters (e.g. http://...
Andrew Ferrier's user avatar
21 votes
3 answers
7k views

How to return to netrw from a file

Suppose that I'm editing a file, then I press :w to store it. And then I use :e. to navigate its containing folder in the netrw. Suppose its containing folder is ./A/B/. In netrw, I open a file with ...
user3813057's user avatar
  • 1,451
21 votes
4 answers
10k views

How can I close the Netrw buffer?

How can I close the Netrw buffer? I tried both :bd and :bw and neither work.
Tyler Durden's user avatar
  • 2,083
20 votes
3 answers
20k views

How do I copy a file in netrw?

The current working directory is ./A/B/. An empty document is opened when I type vim, and the netrw is opened with command :e. The window is split by vs., and I can navigate to the upper level ...
user3813057's user avatar
  • 1,451
20 votes
3 answers
15k views

Cannot exit Vim even using q!

I cannot exit vim even when I type :q!. I get the error E37: No write since last change (add ! to override) E162: No write since last change for buffer... I think the buffer is a NetrwTreeListing ...
Tyler Durden's user avatar
  • 2,083
18 votes
2 answers
4k views

Vim cannot find medical spell files

Problem specification I would love to have a medical spell dictionary in vim. Currently, I have a lot of medical terms in my own personal English dictionary right now. However, using an official ...
melvio's user avatar
  • 599
17 votes
6 answers
13k views

Using :Explore without closing current buffer

If I open the file explorer with :Explore and choose a file, it replaces the buffer I had open before and I have to open it again. How do I avoid this?
Andrew's user avatar
  • 173
14 votes
3 answers
5k views

Navigating using SSH

I know one can use vim scp://host/path/to/file to edit locally remote files then update the remote machine when saving (:w). However I would like to know if it's possible to navigate through ...
lesurp's user avatar
  • 251
10 votes
4 answers
1k views

Can :Explore be started from the terminal?

When using Vim you can use :Explore to browser through files and folders. Is there a simple way to start Vim in "Explore mode" from the terminal? Can I do this by just giving Vim some argument?
Gonçalo Ribeiro's user avatar
10 votes
2 answers
642 views

Is there a way to edit secure data in vim without accessing the filesystem?

I am interested in using vim to edit a "secure" file, one that is stored encrypted elsewhere (say, somewhere in the cloud), and should not be written as plaintext to the local disk. So the sequence of ...
Greg Hewgill's user avatar
9 votes
9 answers
10k views

Toggle explorer window

neovim 0.2-dev :Lexplore opens up explorer window and entering :Lexplore again toggles it. However, if I interact with the explorer window(i.e. expand a directory), then typing :Lexplore opens up ...
Sayem's user avatar
  • 199
9 votes
2 answers
4k views

How to make netrw start with dotfiles hidden?

netrw has a gh command that toggles dotfile hiding. It is off by default. I would like it to be on by default. How do I do that?
Andrew's user avatar
  • 373
9 votes
2 answers
3k views

copy a file in netrw

I often find the need to start a new file by making a copy of another similar file within the same directory. netrw has several commands for copying files from one directory to another (ie: :h netrw-...
user590028's user avatar
9 votes
1 answer
831 views

Can I pass a custom string to the 'gx' command?

I have a file like this: vi.stackexchange.com example.com duckduckgo.com I want to be able to open these sites with gx; this doesn't work because there's no protocol (http://) in front of these ...
Martin Tournoij's user avatar
8 votes
3 answers
2k views

Make :edit {file} use current directory during :Explore

I often use :Ex or :Sex to explore the filesystem from an opened file directory, or just invoke vim passing a directory to start exploring the filesystem and then opening a file. In any case, while ...
guido's user avatar
  • 1,747
8 votes
3 answers
14k views

how to use Netrw Directory Listing in VIM split window without exiting it when a file has been read

When using VIM, it is possible to get a file listing in one split window by doing this: :vsp :e. Then you have something that looks like this: However if you open a file then how can you get back ...
serup's user avatar
  • 201
7 votes
3 answers
9k views

Open multiple files in tabs from Explore mode

While navigating file system in :Explore mode, is it possible to select and open multiple files, each in a new tab? Edit: I ended up using a function proposed by Jair López, because it works pretty ...
Thunderbeef's user avatar
7 votes
2 answers
4k views

How to delete non-empty directories in netrw (Vim 8 or Neovim)?

I try to delete some non-empty folder in netrw by pressing Shift d and, after press y, I got this error: (netrw) unable to delete directory {path} I already put this variable in my .config/nvim/init....
Diego Somar's user avatar
7 votes
2 answers
422 views

au FileType netrw echom "ft is now netrw" does not show up in :messages

Entering in vim :au FileType netrw echom "ft is now netrw" Afterwards, I open a netrw window with :E . Now, I expect to have a message entry in :messages. However, no message is there. Why is there ...
Hotschke's user avatar
  • 4,640
7 votes
1 answer
2k views

Find and highlight current file in netrw

I want to use netrw as a project drawer. Not for opening/closing files or general file management, but only as a way to get a visual overview over the project structure. I open netrw automatically ...
Tobbe's user avatar
  • 171
7 votes
1 answer
916 views

vim 8.0 file explorer only allows specific locations

I'm running Vim 8.0 on a Windows 7 system and I'm having this issue whenever I open gvim (the one that runs in a window as opposed to running in cmd) the default path in :pwd is c:\users\"user". If I ...
jumpindonuts's user avatar
6 votes
3 answers
2k views

How can I move netrw's default keybindings to other keys?

Let's say I'm a terrible person and I'm thinking about remapping <CR> to do what : normally does (start command-line mode). Vim's built-in netrw plugin also remaps <CR> to open the ...
user avatar
6 votes
2 answers
827 views

No Vim, I don't want to save changes to a directory

I frequently use :e. to navigate folders and open files in gVim. But later, when I try to close the session with a :qall, I am asked by vim whether or not I want to save changes to the folder(s) I ...
Jeff's user avatar
  • 193
6 votes
1 answer
390 views

Disable vim-surround in a netrw buffer

Is there a way to disable a plugin (or a set of keymaps) on a specific filetype? vim-surround causes a delay in netrw when pressing d to create a new directory. I'm thinking that this might be ...
user avatar
6 votes
2 answers
2k views

If I split the screen and open a Netrw dir listing in one window, Vim won't let me focus that window

I'm using Vim 7.4. I have a buffer open and I type :vsplit. Vim splits the screen and I see my buffer in both windows. That's great. Just what I want. And at this point ctrl+W W switches the focus ...
Ethan's user avatar
  • 473
6 votes
1 answer
728 views

Lots of Explore issues [closed]

I've been using [Neo]vim for a few months now with a number of plugins. One I decided to use was the built in :Explore for my file-browsing needs. I am having some serious issues with Explore and ...
eduncan911's user avatar
6 votes
0 answers
99 views

Filetype changes when using :split and :Explore

Why does using :split and :Explore cause the filetype to change? For example, edit a file named text.man, and the filetype is set to man. Change the filetype to txt, then :split and :Explore in the ...
xn.'s user avatar
  • 161
5 votes
2 answers
494 views

How to escape from file browsing mode?

I just found out that we can use :e . to enter the browsing mode and then can choose file what we like. But I don't know how to get back to already opened file without choosing it again. I tried &...
Ashish Patel's user avatar
5 votes
1 answer
6k views

Automatically close netrw after opening a file

I would like to automatically close the netrw window when I open a file. I've found a similar question (NERDTree How to open a file and automatically close the explorer buffer), but it refers to ...
Gilad Novik's user avatar
5 votes
4 answers
2k views

Use netrw to change my bash working directory?

Could this be done? For example, I'm imagining that I would type vim . then navigate to a different directory within netrw, exit netrw, and find that bash has done a cd to that same directory.
user251764's user avatar
5 votes
2 answers
2k views

How to display file size in netrw in a human readable way?

When using netrw, (by :Vex or :Sex), the files can be displayed in different ways by pressing "i". And there is a view that the sizes of the files are displayed. However, the sizes are in bytes. Is ...
user3813057's user avatar
  • 1,451
5 votes
1 answer
681 views

gx doesn't open the url and complains: netrw --No Line In Buffer--

My issue happens with the key combination gx in normal mode. The problems happens in Vim, (I have also tried in NeoVim and it correctly opens the link in firefox directly). I have a test file /tmp/...
Stephane Rolland's user avatar
5 votes
3 answers
919 views

Is there a workaround for Vim's Netrw :bprev bug?

This didn't get much love on stackoverflow (https://stackoverflow.com/q/48269793/2512141), but I think it's important so I'm reposting here. I think this could be a major barrier to people using Vim's ...
BitPusher16's user avatar
5 votes
2 answers
1k views

How can I stop 'Obtaining <filename>'?

I am new to vim, and I use netrw as a file explorer. Frequently hit shift-P to open a file in a buffer. Sometimes I accidentally hit shift-O, and netrw will start obtaining the file. How do I ...
TMB's user avatar
  • 193
5 votes
1 answer
196 views

Cannot open an url (empty buffer)

I have some strange troubles with opening an url in vim. Judging from this answer, this should be pretty easy, but when I'm doing this: $ vim http://www.ietf.org/rfc/rfc7386.txt I getting a message ...
erthalion's user avatar
  • 151
5 votes
3 answers
621 views

how to stop vim suspending when using gx

When I press gx over a link in vim, it opens it in an external application, when it does this it also suspends Vim. How do I prevent it from suspending Vim, so that I can use Vim while browsing ...
Electronic Mail's user avatar
5 votes
2 answers
684 views

Why does gx call curl when the cursor is on a URL with trailing slash?

When my cursor is on a URL that ends with a trailing slash, for example : http://www.google.com/ ... if I type gx to open the link in my browser, curl is also called to download the webpage and the ...
saginaw's user avatar
  • 6,706
5 votes
1 answer
206 views

open salt://whatever as somedir/whatever [closed]

I like having netrw loaded for browsing directory contents when I open '.' and for downloading webpages when I split http://host/path, but it's really getting in the way of opening files with gF or ^...
jettero's user avatar
  • 109
4 votes
2 answers
1k views

How to Get Netrw to exclude certain files?

I have vim save my undo history in files named something like .filename.js.un~, but I don't want this cluttering up my list of file in vim (in Netrw). Is there a way to exclude all files with a ...
aharris88's user avatar
  • 1,837
4 votes
2 answers
2k views

How do I make netrw behave with respects to cycling through buffers with :bprevious/:bnext

I have my vim setup according to "Solution #1: Replicating Tabs with Buffers" on this site buffers-vs-tabs with the vim-airline plugin. If I open numerous files in buffer 'tabs' :bprevious/:bnext ...
jshort's user avatar
  • 241
4 votes
2 answers
4k views

Is there a way to search files with netrw similar to find command in linux?

Is there a way to search files with netrw similar to find command in linux? So in command line I can do find . -name "pattern" Is there something similar in netrw?
Neaţu Ovidiu Gabriel's user avatar
4 votes
1 answer
79 views

What does number+enter do in Explore?

as we know that we can use Vim to browse a directory. My question is what does number + Enter do on a file list? I thought it equivalent to number + j + Enter, however, after I enter into a file, ...
user3813057's user avatar
  • 1,451
4 votes
1 answer
894 views

How to mark multiple files in netrw?

I tried using MF *.h for example to select all the files in the current directory that end with .h but this doesnt work. What are good ways to mark multiple files using netrw?
mbl's user avatar
  • 319
4 votes
1 answer
855 views

Strange behavior between autochdir and netrw

This has been plaguing me for a while now, but I've only just recently been able to come up with an MCVE. The problem is that when autochdir is on and I use :Explore to open netrw sometimes it will ...
Tumbler41's user avatar
  • 7,696
4 votes
1 answer
414 views

How to display rwx permissions with netrw?

In vim, how can I display the rwx (i.e., permissions) of files and/or directories using netrw? For example, I'd like to do this: vim :Ex (see output like ls -l) The closest thing I know is, in step ...
mellow-yellow's user avatar
4 votes
1 answer
675 views

How could I preserve netrw :Lexplore in Vim sessions?

I use netrw :Lexplore as my file browser and I also use vim sessions. However, whenever I open a session file, :Lexplore is closed and I have to re-open. Is there a way to keep netrw :Lexplore open ...
JohnDoe's user avatar
  • 363
4 votes
1 answer
2k views

Buftype=nofile when switching buffers with :Vexplore

When I open up :Vexplore in a split and open a file in it, the file in the other split ends up with buftype=nofile set so I can't write in that file or anything. But the new buffer that was opened ...
Wednesday's user avatar
4 votes
0 answers
686 views

netrw bug? cannot copy marked file to target

When I try to do the following on Windows 10: go to a directory, set it as the target directory using mt go to a different directory, mark a file in that directory using mf use mc to copy the file to ...
mbl's user avatar
  • 319
4 votes
0 answers
259 views

Directory symlink browsing moves me to new location when autochdir is set

I have a symlinked directory as such: ~/nested Which points to this directory: ~/whatever/yetanother/andanother/nested When I launch gvim or command line vim (7.4, with the standard, built-in ...
user62177541's user avatar
3 votes
4 answers
3k views

Autocmd on directory to replace netrw

I use the ranger plugin wich I can trigger with a shortcut. But when I open a directory I would like to use the plugin instead of netrw. So I have found that the filetype of directories is netrw, ...
Nicolas Scotto Di Perto's user avatar