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
" ============================================================================
" Netrw Directory Listing (netrw v149)
" /Users/user/.vim/bundle
" Sorted by name
" Sort sequence: [\/]$,\<core\%(\.\d\+\)\=\>,\.h$,\.c$,\.cpp$,\~\=\*$,*,\.o$,\.obj$,\.info$,\.swp$,\.bak$,\~$
" Quick Help: <F1>:help -:go up dir D:delete R:rename s:sort-by x:exec
" ============================================================================
thing. I am in the beginning of my journey with VIM so I don't know what is new and right now I don't want to use it.
I am on OSX Mavericks with home-brew installed. Still, I cannot find where is this coming from and how to remove it.
Solution 1:
Look at the first few lines of $VIMRUNTIME/plugin/netrwPlugin.vim
:
" Load Once: {{{1
if &cp || exists("g:loaded_netrwPlugin")
finish
endif
If you want to disable it, just add
let loaded_netrwPlugin = 1
to your vimrc file.
Solution 2:
You can remove the commented section by adding let g:netrw_banner=0
to your .vimrc
Solution 3:
Since netrw's pages recommend removing older versions of netrw before updating it, I wound up finding a different way from the answers posted here. This might be especially useful for those of you looking to remove netrw (that is, uninstall netrw) before upgrading:
Download https://www.drchip.org/astronaut/vim/vbafiles/netrwclean.vba.gz, which can also be found under the netrw heading at https://www.drchip.org/astronaut./vim/index.html#NETRW
Open vim and do
:so netrwclean.vba.gz
, giving the full path to wherever you saved the file if necessary.:NetrwClean
to remove user-local copies or:NetrwClean!
to remove both user-local and centrally-installed copies of netrw. Note of course that you'll need the right system-privileges to touch the files that will be removed, so you may wish to start vim as root.(Optional) download the new version of the netrw vimball and
:so netrw.vba.gz
to update.