From 487ada0e059a4faf3f89c409619d50c5cd0e7667 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Wed, 9 Dec 2020 03:57:41 +0300 Subject: .vimrc: disable "editing" directories --- %HOME%/.vimrc | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to '%HOME%') diff --git a/%HOME%/.vimrc b/%HOME%/.vimrc index 8dcd2a9..61fd9a6 100644 --- a/%HOME%/.vimrc +++ b/%HOME%/.vimrc @@ -83,3 +83,14 @@ set cursorline " Insert newline without entering insert mode. nmap O nmap o + +" Disable opening directories, netrw is too confusing. +" https://unix.stackexchange.com/q/297844 +for f in argv() + if isdirectory(f) + echomsg "Cowardly refusing to edit directory: " . f + quit + endif +endfor + +let loaded_netrwPlugin=1 -- cgit v1.2.3