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).
187
questions
0
votes
1
answer
847
views
Neovim fail to open file via scp - Undefined variable: b:netrw_method
I am opening a remote file with this command:
[n]vim scp://user@host/relative_file
Vim (8.2) opens the file correctly, but Neovim (v0.5.0-dev+1186-g8665a96b9) just shows a blank file and a blank ...
3
votes
1
answer
63
views
Vim syntax highlighting: conceal does not work when opening files from netrw
I use Vim version 8.2.4919 without 3rd party plug-ins on Ubuntu 22.04.2 LTS running via WSL2.
I want to have italic syntax highlighting for words encapsulated in underscores in comments of my cpp ...
2
votes
2
answers
3k
views
How to display line numbers in netrw v125 (vim7.0)?
I added let g:netrw_bufsettings = 'noma nomod nu nobl nowrap ro' and set nu to my vimrc on my Ubuntu machine. It can display line numbers in netrw (V149).
When I use the same vimrc on a remote server ...
1
vote
2
answers
39
views
How to detect netrw directory listing from autocommand?
I want to detect from a BufEnter autocommand whether the buffer is a netrw directory listing.
It seems that when the autocommand is fired, the filetype is empty and there are no netrw-related buffer ...
3
votes
1
answer
3k
views
Open files with "whitespace names" from within Vim with gx
I have a file, e.g. ~/abc def.mp3 that I want to open from within a Vim buffer that already contains these lines.
If there were no whitespaces in the filename, I could simply open the file with the ...
1
vote
2
answers
1k
views
How to make Vim open empty buffer with CWD set when opening a folder?
At the moment when I run nvim path/to/folder/ it opens up the netrw window for it (more accurately, the Dirvish window for it), I'd like this to not be the case.
Ideal behaviour is that:
when I do ...
1
vote
1
answer
674
views
netrw not open correctly, just open blank with noperm message
I am Neovim user and have serious problem with netrw
I find netrw has a bug
when trying to open the file, at first it only shows an empty buffer(1st picture), and right bottom corner, you can see [...
0
votes
0
answers
26
views
Issue after using netrw in normal mode
I'm not sure what's causing this, but on MacOS 13.5/vim 9.0, after entering netrw via :Ex, :Sex, or :Vex and switching between files, upon entering the file, I'm unable to press shift+o or o to insert ...
0
votes
2
answers
162
views
netrw :Sex and :Vex clear the current buffer
If I open a file in Vim and then run :Vex (or :Sex) it opens netrw in both the new split and the existing split. This happens even if I have unsaved changes, meaning the changes are lost.
The ...
0
votes
0
answers
29
views
Why does `Ex` apply to both splits? [duplicate]
I noticed that when I split multiple times in combination with Ex, for example I run the following commands
:Sexplore
:q
:Sexplore
It will open netrw in both splits. I expected it to only open in the ...
0
votes
0
answers
175
views
Making vim-fugitive compatible with file explorers
I have the vim-fugitive plugin and use :G a lot. If I have NERDTree as a plug or netrw enabled then :G will open either a NERDTree file or a netrw file instead of the usual fugitive file with the ...
3
votes
0
answers
311
views
Netrw problem - 'mt' open new tab instead of marking as target folder
I was playing with netrw and was amazed by the possibility.
I'd like to mark some files with 'mf' and move it to a folder using 'mt'. However, when I press 't', vim seems to interprets it as "open a ...
0
votes
0
answers
32
views
Hiding multiple netrw files not working
I am trying to hide all dotfiles and all .jsx files from netrw
When I update the variable g:netrw_list_hide, nothing happens.
let ghregex = '\(^\|\s\s\)\zs\.\S\+'
let jsxregex = '.*\.jsx$'
let g:...
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....
2
votes
1
answer
258
views
Open netrw view of directory with Ctrl-P
Is it possible to use Ctrl-P to search for directories in addition to searching for files? I want to be able to search for directories in my project in whatever mode (CtrlP, CtrlPMRU, or other) and ...
0
votes
0
answers
31
views
When alt-tabbing, subfolders in Netrw change appearance and opens in preview window
I'm on macOS Ventura 13.2, using macVim and terminal vim. When I toggle Netrw, open a folder with a subfolder, and then cmd-tab away from vim and back again, that subfolder changes appearance and ...
0
votes
0
answers
23
views
Vim: Netrw used to equate "%" to the folder being examined
When I used previous versions of Netrw, I could issue Bash commands like :!mkdir %/NewSubFolder. The % would translate into the folder being examined by Netrw, which isn't necessarily the same as the ...
0
votes
0
answers
40
views
Vim 8.2 says unwritten changes if I change netrw display views
I recently upgraded to Vim 8.2 (I don't recall what the last version was). When I open a buffer to display the contents of a folder, it uses netrw, which I've enjoyed for years. Now, if I use netrw'...
0
votes
2
answers
474
views
How to get path in NetRW?
I want to override NetRW's response to <CR>. When I hit enter, I want to:
get the path of the file or directory of the line with the cursor in the :Lex window
test if path is a file
if the ...
1
vote
1
answer
259
views
Vim file explorer - jump to file by letter
In windows file explorer, if you hit a letter like R, you get to a file/folder beginning with R.
Especially in directories with many files this is super convenient.
Does one of the Vim file explorers ...
2
votes
1
answer
947
views
Changing working directory to current in netrw
My working directory is /a and I open up netrw with :tabe /b. I now want to change my working directory to /b. I read that :cd<CR> should work but it just does the same thing as typing cd in a ...
2
votes
1
answer
130
views
Open JIRA issues from inside Vim based on JIRA tag
I just learned about the gx command to open URLs from Vim. Is there a way to do the same thing based on the highlighting. For example, I have this match rule to hightlight JIRA issues:
syn match ...
1
vote
1
answer
284
views
How to open netrw at each vim session but have the cursor on the code (and not on the tree) when opening
I found the following chunk of command on this blog to have a file browser open by starting vim that I added to my .vimrc. It splits the window into 2 panes: a file browser and the text editor. The ...
1
vote
1
answer
317
views
How can I open netrw in a split when opening a directory?
I have figured out how to open a file browser in a split, using the following in vimrc:
let g:netrw_liststyle = 3
let g:netrw_banner = 0
let g:netrw_browse_split = 4
let g:netrw_winsize = 25
let g:...
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 ...
1
vote
1
answer
529
views
vim netrw problems on Windows 10
The weird behaviour I was seeing included:
:Ex might open an empty window
Use of - as a shortcut to go up to the parent directory in netrw, would make the entire shell non-responsive (or at least, ...
1
vote
0
answers
134
views
"netrw" mishandling long filenames
I see an odd problem with netrw for file names that are long enough to run into the next column (which is for the file size). When I press "Return" or "o" to view the file, it ...
1
vote
3
answers
921
views
Netrw-R Renaming multiple Files with vim
After going through the renaming guides from the doc folder in vim I found a way to replace text with the input :%s/frompattern/topattern/g.
Reaching the renaming files with the file browser tutorial/...
2
votes
1
answer
106
views
How to have netrw ignore executables?
When I use netrw with the :Explore command I see that binary/executable files are highlighted in orange and have a little * start next to them, so I guess it can recognize them without having to rely ...
0
votes
1
answer
247
views
How can I get netrw to not move the cursor when I return to it
When I open a directory in netrw by opening vim like vim ., it will show me a list of files in the current directory. If I find a file then press t it will open that file in a new tab, when I'm done, ...
3
votes
1
answer
506
views
Netrw - Lexplore is not an editor command
I was trying to configure vim to have a file explorer on the side with no plugins. I found the following script:
function! ToggleNetrw()
if g:NetrwIsOpen
let i = bufnr("$")
while (...
2
votes
1
answer
299
views
Vim hides files inside directories with brackets in the name
I've been dealing with a huge problem of NeoVim for weeks (also applies to Vim a GVim) and I failed to find the solution on my own. What's happening is that NERDTree is hiding the content of any ...
1
vote
0
answers
96
views
Trouble remapping netrw
I'm using a bépo keyboard, kind of like a dvorak keyboard but for french. One of the most important aspect of using a bépo layout with vim is that I have to hjkl <-> ctsr. To do so I have this ...
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/...
1
vote
1
answer
66
views
how to overwrite netwr default file handler keybinding and still use it?
I'd like to overwrite netrw plugin's default file handler keybinding gx
but still be able to use it:
" should remap netrw's gx to gX
xnoremap gX gx
" map gx to something else
xmap gx :...
1
vote
1
answer
52
views
Unexpected TabNew behavior
I want to create a netrw sidebar whenever I open a new tab. I tried this:
au TabNew,VimEnter *
\ | :Vex
\ | :vert res 40
but this makes a layout like this when I :tabe file2:
tab1: ...
1
vote
0
answers
105
views
Selecting the directory underneath cursor in netrw
Let's say I am exploring a directory in netrw with many subdirectories:
" ============================================================================
" Netrw Directory Listing ...
2
votes
0
answers
261
views
What's the cleanest way to open directories using FZF instead of netrw?
I have a dirty implementation of using FZF instead of netrw to open directories:
" netrw
let g:loaded_netrw = 1
let g:loaded_netrwPlugin = 1
" Directories
function! MaybeOpenFzfForDir(...
3
votes
1
answer
56
views
Netrw doesn't recognize "~/"
I installed ubuntu-20.04.3-desktop-amd64.iso on VirtualBox 6.1.28. It is my first foray into virtual machines and Linux.
I installed Vim 8.1 according to this page.
The command :e ~/tmp/tmp.txt opens ...
3
votes
0
answers
134
views
Showing different directories in multiple netrw instances
I was hoping that I could have splits or tabs in which I would use different netrw instances to see different folders or to use separate hide lists. Unfortunately any change in split/tab A affects ...
1
vote
0
answers
166
views
How do I regain control of my Vim session when it hangs while saving a file via netrw?
I edit a lot of files using netrw in gvim. Sometimes, when I mash C-s to save, it will hang my vim session. I'm not sure if this is because of a network error, or because I also sometimes hit C-z at ...
0
votes
1
answer
114
views
how to install this? NerdTree visual selection
I've been trying to install this package called nerdTree-visual-selection. It is a package that 'defines key mappings that will work on nodes contained in a Visual selection in NERDTree'.
It was weird ...
1
vote
1
answer
240
views
Change behavior of `gx` key
I used to use chromium before and then, I could press gx on an url and vim would open it in a new tab if a chromium instance was already running, otherwise create a new window.
But in firefox, when I ...
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 ...
0
votes
1
answer
138
views
Automatically getting diff between netrw preview window and fixed file
Say I am in a directory with the filetree below, where gold.txt is a file I would like to compare each of the other .txt files against, one at a time.
.
├── gold.txt
└── to-compare
├── compare1....
3
votes
0
answers
440
views
How can I use let `g:netrw_keepdir = 0` for folders and `autochdir` for files?
Normally I want to use autochdir to
change to the directory containing the file which was opened or selected
However, in netrw, there's a warning
However, the autochdir option:
:set acd
is ...
2
votes
3
answers
1k
views
Copying absolute filepath of selected file in Netrw
Is it possible to copy the absolute filepath of the file under the cursor in Netrw?
1
vote
1
answer
439
views
Explore command not working in Terminal normal mode
In vim, I open a terminal using :term and enter the normal mode using <C-w> <N>. Then, :Explore does not open the vim's file navigation view, but creates a another split window of the ...
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 ...
0
votes
0
answers
138
views
netrw freezes for seconds when entering window for a folder on network drive with many zip files
I have split windows on Vim/Gvim, one of which is opened to a folder rather than an text file. When the folder is on a network drive, Vim/Gvim freezes for 5-10 seconds whenever I change focus to that ...