Override <Del> in netrw and delete its history
authorSergey Matveev <stargrave@stargrave.org>
Mon, 13 Apr 2020 13:19:43 +0000 (16:19 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Mon, 13 Apr 2020 13:19:43 +0000 (16:19 +0300)
vim/.vim/plugin/netrw.vim [new file with mode: 0644]
vim/.vimrc

diff --git a/vim/.vim/plugin/netrw.vim b/vim/.vim/plugin/netrw.vim
new file mode 100644 (file)
index 0000000..457edab
--- /dev/null
@@ -0,0 +1,9 @@
+let g:netrw_banner = 0
+let g:netrw_bufsettings = "noma nomod nowrap ro nobl"
+
+function! WinClose(islocal)
+    close
+endfunction
+let g:Netrw_UserMaps = [["<Del>", "WinClose"]]
+
+autocmd VimLeave * call delete("~/secure/vim/.netrwhist")
index 65870e15898dbb90e865f205f409cbd3e267f61d..e18c78558840691171fc28b62a997aafdfda984a 100644 (file)
@@ -123,11 +123,6 @@ set spelllang=ru,en_gb
 highlight SpellBad cterm=inverse ctermfg=red ctermbg=black
 " }}}
 
-" Netrw {{{
-let g:netrw_banner = 0
-let g:netrw_bufsettings = "noma nomod nowrap ro nobl"
-" }}}
-
 " Unimpaired-like textwidth switching {{{
 nmap [ob :set textwidth=72<CR>
 nmap ]ob :set textwidth=0<CR>