Questions tagged [netrw]

For questions about the plugin Netrw 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
22
votes
2answers
3k 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://...
19
votes
3answers
14k 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 ...
18
votes
2answers
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 ...
18
votes
3answers
12k 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 ...
17
votes
4answers
7k views

How can I close the Netrw buffer?

How can I close the Netrw buffer? I tried both :bd and :bw and neither work.
15
votes
6answers
10k 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?
14
votes
3answers
4k 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 ...
10
votes
3answers
4k 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 ...
9
votes
2answers
428 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 ...
8
votes
4answers
931 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?
8
votes
3answers
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 ...
7
votes
8answers
6k 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 ...
7
votes
3answers
6k 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 ...
7
votes
2answers
1k 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-...
7
votes
3answers
10k 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 ...
7
votes
1answer
643 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 ...
7
votes
2answers
339 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 ...
7
votes
1answer
859 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 ...
6
votes
2answers
658 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 ...
6
votes
1answer
853 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 ...
6
votes
2answers
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 ...
6
votes
1answer
637 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 ...
5
votes
2answers
2k 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?
5
votes
3answers
1k 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 ...
5
votes
4answers
1k 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.
5
votes
1answer
283 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 ...
5
votes
3answers
659 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 ...
5
votes
1answer
175 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 ...
5
votes
2answers
614 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 ...
5
votes
1answer
189 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 ^...
4
votes
2answers
337 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 &...
4
votes
1answer
4k 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 ...
4
votes
2answers
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 ...
4
votes
2answers
3k 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?
4
votes
2answers
1k 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 ...
4
votes
1answer
74 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, ...
4
votes
1answer
821 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 ...
4
votes
2answers
865 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 ...
4
votes
1answer
309 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/...
4
votes
3answers
508 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 ...
4
votes
1answer
184 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 ...
4
votes
1answer
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 ...
4
votes
1answer
594 views

How to delete non-empty directories in netrw (vim 8 or nvim)?

I will 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/...
3
votes
4answers
2k 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, ...
3
votes
2answers
752 views

How do I properly manage a directory listing within a buffer?

I use a mix of buffers and split panes to manage my workflow. Sometimes, I (perhaps accidentally) open a directory listing instead of a file. My buffers may look like this then: At this point, I can :...
3
votes
2answers
987 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 ...
3
votes
1answer
1k views

Update netrw to newer version [duplicate]

I use Vim from this ppa http://ppa.launchpad.net/jonathonf/vim/ubuntu which includes netrw v156 How can I update to a newer netrw --> Do I have to remove netrw installed --> Can I simply install a ...
3
votes
1answer
92 views

Where can I see netrw plugin revision history or changelog?

Is there a place where the netrw source code repository is hosted, so I can view its revision history? If not, is there at least a changelog somewhere? If I do git log on netrw.vim in the vim ...
3
votes
1answer
1k views

Netrw tree listing style opening files in other directories creates new empty files in current directory

When using netrw with the tree style listing (netrw_liststyle = 3), if I expand a directory, open a file in that directory, then try to open a file above that directory, it creates a new empty file in ...
3
votes
2answers
117 views

Is it possible to add a file to the argument list with in netrw?

I am a heavy user of the argument list and I always have the files which are important for my current task in it. Now I started to use netrw more often to search through the files system. But I can't ...