Questions tagged [netrw]

netrw is a network file editing plugin for the vim text editor.

123 questions
6
votes
5 answers

Create local backup when editing remote files via netrw in vim

I work with many files remotely using vim and the netrw plugin. I also keep timestamped backups by changing the &backupext (found in the documentation). While working in a remote file (scp://server//folder/file.txt), I noticed that when I save it, a…
matpie
  • 17,033
  • 9
  • 61
  • 82
6
votes
1 answer

How to change directory character in NetRW of Vim?

The default file explorer inside Vim is NetRW. It can be invoked, for example, by using :e .. In its tree view, it prefixes the directory name with pipe characters (|). For example: joe/ | Desktop/ | Documents/ | Downloads/ How can I replace the…
Ashwin Nanjappa
  • 76,204
  • 83
  • 211
  • 292
6
votes
3 answers

How to sort files like `sort` does using the vim's netrw file browser?

I would like to have my files sorted this way: abc.c Makefile readme.txt but the netrw file browser sorts them like this (using empty sort sequence): Makefile abc.c readme.txt How do I fix that? BTW, it would also be nice to jump to file/directory…
Egor Tensin
  • 576
  • 4
  • 17
5
votes
2 answers

Why does netrw open file in a small vertical split only on the first time explorer is opened?

Problem: Open Vim Type :Lex to open netrw file explorer and open a file in a vertical split using v As you can see in the image below, the space allocated to the split is tiny. This only happens on the first time netrw file explorer is opened. If I…
doctopus
  • 5,349
  • 8
  • 53
  • 105
5
votes
1 answer

Netrw modifying directories always complains

Whenever I make a new directory, copy, a file, etc. using netrw's mt mf mc commands (for example), or just d, my vim gets into a state where it will absolutely, by no means (known to me) be exited from. Even if I try to type q! from the netrw…
Daniel Thompson
  • 2,193
  • 4
  • 23
  • 37
5
votes
1 answer

Why does Vim create an empty directory named "~" when editing directories?

If I edit a directory (say 'foo') in Vim, then Vim always creates an empty directory named 'foo/~'. In my vimrc, I specify 'nobackup', 'nowritebackup', and 'backupdir=$TEMP/vim//'. With the backupdir setting, when I do enable backup files they go to…
Steve Hollasch
  • 2,011
  • 1
  • 20
  • 18
5
votes
1 answer

Go back and return to same location in file listing in Vim netrw?

When browsing a local directory using Vim and the built-in netrw file browsing support, I would like to open a file to view it and then return to the same location in the file listing where I was before opening the file. The way I usually browse…
Colin D Bennett
  • 11,294
  • 5
  • 49
  • 66
5
votes
5 answers

vim - how to remove netrw?

I was testing https://github.com/skwp/dotfiles) and unfortunately it did install a lot of things I do not want. For example, right now (with empty .vimrc) when I open vim I get "…
acid
  • 2,099
  • 4
  • 28
  • 41
5
votes
1 answer

How to use netrw-C?

I recently stubled upon a feature in netrw that's called netrw-C. From the docs: SETTING EDITING WINDOW *netrw-C* {{{2 One may select a netrw window for editing with the "C" mapping, or by setting g:netrw_chgwin to the selected…
Nikita
  • 1,053
  • 1
  • 10
  • 19
4
votes
0 answers

VIM netrw shows directories as files (tree view)

I am running VIM version 8.2.501 with netrw v168 and I have spotted the following issue. In some cases nested directories appear as files and not as directories. This happens in a few use cases but the following one is a way to reproduce it. Set…
George B.
  • 565
  • 7
  • 19
3
votes
1 answer

Can I use wildcards in netrw?

I may be doing everything wrong and I have the feeling that the question I am asking is really basic but I cannot seem to find the answer anywhere. When I browse a folder in order to open a file I do :e . and the current directory shows up. However…
thequerist
  • 1,774
  • 3
  • 19
  • 27
3
votes
3 answers

Close netrw explorer after opening a new file

I'd like the netrw explorer to automatically close after opening a file. For example: :Lex to open file explorer Open file Upon open, the file explorer automatically closes. I've tried setting: autocmd FileType netrw setl bufhidden=wipe But it…
doctopus
  • 5,349
  • 8
  • 53
  • 105
3
votes
1 answer

Jump to last position when using vim netrw to open a file

I am looking to jump automatically to the last position in any file that I open. I have in my ~/.vimrc file: autocmd BufReadPost * …
anti-destin
  • 799
  • 1
  • 8
  • 19
3
votes
2 answers

How to fold/expand treeview in vim (built-in netrw)?

I like to use vim's built-in netrw plugin to list files of project. Sometimes when I expand a folder to see its content I need to fold it back and go to the next folder. For example, at the right side of the screen I want to fold components folder…
Timur Fayzrakhmanov
  • 17,967
  • 20
  • 64
  • 95
3
votes
1 answer

Save the file explorer panel in vim session

When I have netrw and some files open in vim, only the file panels are displayed when I restore the session using .mksession. Is it possible to restore the netrw file browser panel from a saved session?
Bas Peeters
  • 3,269
  • 4
  • 33
  • 49
1
2
3
8 9