From 56556a10b09f5c120bcede44d576e5715026c63c Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Thu, 16 Nov 2023 23:06:48 +0100 Subject: nvim: Move netrw config to its own file --- .config/nvim/after/plugin/netrw.vim | 13 +++++++++++++ .config/nvim/lua/mango/set.lua | 7 ------- 2 files changed, 13 insertions(+), 7 deletions(-) create mode 100644 .config/nvim/after/plugin/netrw.vim (limited to '.config') diff --git a/.config/nvim/after/plugin/netrw.vim b/.config/nvim/after/plugin/netrw.vim new file mode 100644 index 0000000..f9e0f9a --- /dev/null +++ b/.config/nvim/after/plugin/netrw.vim @@ -0,0 +1,13 @@ +function! s:gitignore_files() + silent! !git rev-parse --is-inside-work-tree + if v:shell_error == 0 + return netrw_gitignore#Hide() + endif + return '^$' " Shouldn’t match anything +endfunction + +let g:netrw_banner = 0 +let g:netrw_bufsettings = 'noma nomod nu nobl nowrap ro' " Enables line-numbers +let g:netrw_list_hide = s:gitignore_files() + \ .. ',^\(\.\|\.\.\)/\?$' + \ .. ',.*\.o$' diff --git a/.config/nvim/lua/mango/set.lua b/.config/nvim/lua/mango/set.lua index 2dfe53b..7d024a6 100644 --- a/.config/nvim/lua/mango/set.lua +++ b/.config/nvim/lua/mango/set.lua @@ -59,14 +59,7 @@ vim.cmd([[ endfunction ]]) --- This has to be done to enable linenumbers in netrw -g.netrw_bufsettings = 'noma nomod nu nobl nowrap ro' - -- Allow for jumping between these pairs with % o.matchpairs:append('<:>') o.matchpairs:append('‘:’') o.matchpairs:append('“:”') - --- Disable the netrw banner -g.netrw_banner = 0 -g.netrw_list_hide = [[^\(\.\|\.\.\)/\?$]] -- cgit v1.2.3