2022 Developer Survey is open! Take survey.

Hot answers tagged

47 votes
Accepted

Vim cannot find medical spell files

The "medical" spell file does not exist, it is just an example of a name that is longer than two characters. You would have to generate one yourself.
user avatar
25 votes
Accepted

How do I copy a file in netrw?

You cannot use y, p etc., to copy files in netrw - it comes with its own commands. See :h netrw-mc: MARKED FILES: COPYING netrw-mc {{{2 (See ...
user avatar
  • 23.7k
24 votes

Vim cannot find medical spell files

In response to Bram's answer, I have found, modified, and compiled a medical spell file that can be used with Vim. I've made the full instructions and the source code available under a GPL3 license ...
user avatar
  • 567
16 votes

Using :Explore without closing current buffer

In :help netrw-explore they mention several other commands to explore your files. Among them are :Texplore which opens the file explorer window in a new tab instead of using your current window. ...
user avatar
  • 6,416
16 votes

Navigating using SSH

Instead of pointing Vim/Netrw to a file: scp://host/path/file point it to a directory: scp://host/path/ This gives you the same listing and the same shortcuts as if you were browsing your machine.
user avatar
  • 32.6k
15 votes
Accepted

How can I make gx recognise full URLs in vim?

As @Carpetsmoker points out in his comment, g:netrw_gx determines what will be considered part of a URI. By default it is set to "<cfile>". From the docs (:help <cfile>): <cfile> ...
user avatar
14 votes
Accepted

Can :Explore be started from the terminal?

Alternatively (the passing of directory argument(s) as in @EvergreenTree's answer relies on the autocmds of the netrw plugin, and aren't a general solution), you can pass any Ex command to Vim on ...
user avatar
  • 16.6k
13 votes
Accepted

Cannot exit Vim even using q!

To solve this nuisance with netrw permanently, I added this to my .vimrc: " Per default, netrw leaves unmodified buffers open. This autocommand " deletes netrw's buffer once it's hidden (using ':q', ...
user avatar
13 votes

Open multiple files in tabs from Explore mode

From :h netrw-t: BROWSING WITH A NEW TAB netrw-t Normally one enters a file or directory using the <cr>. The "t" map allows one to open a new window holding the new directory ...
user avatar
  • 45.9k
12 votes
Accepted

How to make netrw start with dotfiles hidden?

gh works by modifying netrw_list_hide, rather than by toggling a separate flag. It appends or removes the regex \(^\|\s\s\)\zs\.\S\+. As far as I can tell, said regex matches "a dot followed by any ...
user avatar
  • 343
11 votes

Can :Explore be started from the terminal?

The "Explore Mode" you are talking about is netrw, a vim plugin which is provided by default. It should open in that "mode" if you just try to open a directory with vim, eg. vim foo/bar/baz/
user avatar
11 votes

How can I close the Netrw buffer?

The autocmd FileType netrw setl bufhidden=wipe still leaves one buffer open. I found this solution, which closes it after opening the file: let g:netrw_fastbrowse = 0 over at the discussion on https:...
user avatar
10 votes

How do I copy a file in netrw?

I would do this from the command line mode: Select the file you need in netrw Open command the line and type - :!mv <C-R><C-F> ../<C-R><C-F> Here <C-R><C-F> ...
user avatar
10 votes

Cannot exit Vim even using q!

This usually happens, if there are two or more buffers which are modified and Vim then usually toggles between them and shows the error message. So when :q! would abort the current buffer, it wouldn't ...
user avatar
10 votes

Toggle explorer window

I followed this script (https://www.reddit.com/r/vim/comments/6jcyfj/toggle_lexplore_properly/djdmsal/) and it works as expected. let g:NetrwIsOpen=0 function! ToggleNetrw() if g:NetrwIsOpen ...
user avatar
  • 101
9 votes
Accepted

How to return to netrw from a file

:E[xplore] does the same thing as :e %:h, and is shorter to type. If you look up :help :Explore, you can see that there are also variations to open the directory of the current file in a new tab or ...
user avatar
  • 136
9 votes
Accepted

Using :Explore without closing current buffer

I usually use a following flow when I want to open the file (while keeping the current file): Make a new vertical / horizontal split Open netrw from in the new split Select another file As mentioned ...
user avatar
8 votes
Accepted

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

The gx mapping is calling netrw#BrowseX(), so you could call that at the end of your function, passing in the l:site variable you've constructed: call netrw#BrowseX(l:site, netrw#CheckIfRemote()) I ...
user avatar
  • 7,140
8 votes
Accepted

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

There is a dedicated command for opening a netrw listing in a vertical split: :Vex[plore] There is a dedicated command for going back to the latest netrw listing: :Rex[plore] Netrw comes with a ...
user avatar
  • 32.6k
8 votes
Accepted

How to escape from file browsing mode?

You can use any of Vim's many buffer-switching commands to return to the file you were previously working on. Here's a few possibilities: Use the :buffer command to jump to the alternate buffer: :b #...
user avatar
  • 27.4k
8 votes

copy a file in netrw

According to following thread on the mailing list vim_use from 03.10.15 (https://groups.google.com/forum/#!topic/vim_use/6yqU3RX2CWA): How to copy and rename a file with netrw where the target and ...
user avatar
  • 3,960
7 votes

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

I set the following two options to ensure that Vim's current working directory is always the same as the current buffer's. set autochdir " Changes the cwd to the directory of the ...
user avatar
7 votes

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

Yes, vim has a :cd command, which either prints the current directory or changes the current directory. In the help is this - note the last lines: :cd[!] {path} Change the current ...
user avatar
  • 323
6 votes

Using :Explore without closing current buffer

If you have netrw v153 or later, you'll have :Lexplore available. This command opens a window on the side of the display, and <cr> will cause editing to occur in window#2 (by default). You can ...
user avatar
  • 746
6 votes

What does "toggle" mean in the context of Lexplore?

With :Vexplore, the current window is split in two and a netrw buffer is displayed in the new window. Repeating that command again and again will keep splitting the current window until the left half ...
user avatar
  • 32.6k
6 votes

Automatically close netrw after opening a file

I think your problem comes from the following line of your .vimrc: let g:netrw_browse_split = 4 From the doc :h g:netrw_browse_split you can read: *g:netrw_browse_split* when browsing, <cr&...
user avatar
  • 45.9k
5 votes

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

Netrw's documentation recommends putting your custom mappings in: ~/.vim/after/ftplugin/netrw.vim on unix-like systems %userprofile%\vimfiles\after\ftplugin\netrw.vim on Windows ...
user avatar
  • 32.6k
5 votes
Accepted

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

It is possible by setting the netrw configuration variable g:netrw_keepdir to 0 (default is 1). To make it permanent, add in the .vimrc file this line: let g:netrw_keepdir=0
user avatar
5 votes
Accepted

Disable vim-surround in a netrw buffer

The surround plugin defines global mappings. Unfortunately, you can only override those with buffer-local ones, but not :unmap them only in the buffer. Temporarily disabling and re-defining the global ...
user avatar
  • 16.6k

Only top scored, non community-wiki answers of a minimum length are eligible