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
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 ...
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 ...
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
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 ...
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
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:...
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'...
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
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:...
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 ...
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, ...
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 ...
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
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 ...
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 ...
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....
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/...
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 ...
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 ...
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 ...
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 ...
1
vote
0
answers
150
views
How can I track the event of opening a file in netrw in an autocommand?
I'm trying to solve this problem by creating an autocommand which will track when a new buffer is opened through netrw, and will then immediately close netrw once the buffer is closed.
How can I track ...
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 ...
0
votes
0
answers
366
views
Setting ftdetect a given directory
I'm looking for a way to set filetype on load, a loading phase via ftdetect.
Right now I can open the files inside a given directory via some utility function that I wrote, and during the opening ...
0
votes
0
answers
82
views
Can I map a netrw command and its arguments to a key?
I have this map:
nmap <buffer> <F3> mX
So one I press <F3> it opens a prompt so I can type a command. Can I give the command also in the map above? something like:
nmap <buffer&...
0
votes
1
answer
537
views
How can I apply shell command on the selected files in netrw
I want to apply a shell command on two selected files, my command is:
convert +append image1.png image2.png output.png
How can I do that for two selected images in netrw?
However, to make the process ...
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, ...
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 (...
0
votes
0
answers
110
views
Strange cursorline behavior in Netrw
I'm running Vim 8.2 on macOS 10.14.6 (Mojave) on the native macOS Terminal program. I recently changed my terminal font to Courier 12, Regular weight, and discovered a strangely annoying issue which ...
3
votes
0
answers
174
views
While copying a file in netrw, why should I be in the directory where the file is located?
In netrw, I want to copy a file /dir/subdir1/file.txt to /dir/subdir2. For that, I do the following:
I mark the file /dir/subdir1/file.txt
I navigate up directory and mark /dir/subdir2/ as target
...
0
votes
1
answer
125
views
How can I go back from vimdiff to netrw?
I list files using vim ., which uses netrw. Then I select two files using md, and open them in diff mode using mf. Now how can I go back to the list of files?
I use :q to exit the second file, and :E ...
0
votes
0
answers
65
views
How to explore specifc files with wildcards in netrw?
I would like to list files starting with abc in the current directory with netrw.
if I use vim . it lists all files. I also could list them using vim -c "E" just I don't know how to filter ...
2
votes
1
answer
482
views
How to select multipe files for vimdif using netrw?
Suppose I have some files in a folder. I browse the folder using vim vim myfolder. It opens netrw with a list of the files in the directory. Now I want to select two or more files and then open them ...
1
vote
1
answer
397
views
Using vim-vinegar or trying to use :e . will crash nvim [closed]
I have recently transitioned from vim8.X to nvim0.4.4 and so far I've been extremely impressed with the development experience.
One feature I'm really missing is using vim-vinegar to exit the current ...
2
votes
1
answer
330
views
How do I enable mouse in netrw only (terminal vim)?
I would like to be able to use my mouse to scroll and click on directories to expand them in netrw. I don't want the mouse to be on for any other filetype/buffertype, so that I can still highlight/...
1
vote
1
answer
1k
views
Why isn't netrw (:Explore) loaded, when starting vim using `vim -u NONE`?
I wonder why netrw (:Explore) is not loaded after starting vim using vim -u NONE.
Inspecting my runtimepath yields:
/Users/shuz/.vim,/usr/share/vim/vimfiles,/usr/share/vim/vim82,/usr/share/vim/...
0
votes
0
answers
79
views
Why don't <s-up> and <s-down> work in :Explore (netrw) for going to previous/next match?
After executing :Explore **/*.py to match *.py under the current directory tree, I cannot execute :Pexplore and :Nexplore using <s-up> an <s-down>.
I have tried both SHIFT+<up> and s+...