vim-polyglot icon indicating copy to clipboard operation
vim-polyglot copied to clipboard

gitconfig ftdetect interferes with netrw

Open adrian5 opened this issue 4 years ago • 0 comments

Create directory

cd /tmp
mkdir gitconfig
vim .

Open in netrw

" Netrw Directory Listing                                        (netrw v171)
"   /tmp
"   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:special
" ==============================================================================
../
./
gitconfig/    ← open this

Result

Filetype in netrw changes from netrw to gitconfig, clearing the syntax highlighting.


This does not happen without vim-polyglot, so it's probably down to the more aggressive filetype detection, which I love 99% of the time.

This is a niche case, so if it's painful to fix then feel free to close this issue. I just wanted to share it, since it baffled me for a moment.

adrian5 avatar Oct 01 '21 21:10 adrian5