From a7c8c008547aadf1c5dec20963a67f6d617069e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Vantomme?= Date: Tue, 21 Jun 2016 09:45:08 +0200 Subject: [PATCH] File hiding supports g:netrw_liststyle Long and wide listings may display more than a filename per line. With this new regex, file hiding works with this kind of listing too. Closes #49 --- plugin/vinegar.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugin/vinegar.vim b/plugin/vinegar.vim index f471141..5d3df60 100644 --- a/plugin/vinegar.vim +++ b/plugin/vinegar.vim @@ -18,8 +18,10 @@ let s:dotfiles = '\(^\|\s\s\)\zs\.\S\+' let g:netrw_sort_sequence = '[\/]$,*,\%(' . join(map(split(&suffixes, ','), 'escape(v:val, ".*$~")'), '\|') . '\)[*@]\=$' let s:escape = 'substitute(escape(v:val, ".$~"), "*", ".*", "g")' +let s:bol = '"\\(^\\|\\s\\)".' +let s:eol = '."\\($\\|\\s\\)"' let g:netrw_list_hide = - \ join(map(split(&wildignore, ','), '"^".' . s:escape . '. "$"'), ',') . ',^\.\.\=/\=$' . + \ join(map(split(&wildignore, ','), s:bol . s:escape . s:eol), ',') . ',^\.\.\=/\=$' . \ (get(g:, 'netrw_list_hide', '')[-strlen(s:dotfiles)-1:-1] ==# s:dotfiles ? ','.s:dotfiles : '') if !exists("g:netrw_banner") let g:netrw_banner = 0