Closed
Description
Problem description
The gitignore settings are only taken into account for the files that existed when starting vim, not for files created afterwards.
Steps to reproduce
Setup a new repo for the tests:
mkdir test
cd test
touch a a~ b b~ c
git init
echo "*~" > .gitignore
Test 1
- Start vim
:set backup
(to make sure backup files get created in the same directory with~
appended to the end of the filename)- Open the file browser, observe that you can toggle with
Shift-I
whether the filesa~
andb~
are shown. - Open file
c
and save it while the file browser is open. Note thatc~
gets created and it gets shown in the browser, butShift+I
won't hide it like the rest of the backup files; it is always shown. NvimTreeRefresh
or opening/closing the browser doesn't help;c~
will be always shown.- Restart vim and open the file browser again. Now
c~
gets toggled correctly too withShift-I
.
Test 2
- Start vim
- Open the file browser, observe that you can toggle with
Shift-I
whether the filesa~
andb~
are shown. - Create a new file called
x~
from another shell while vim is open. - Press
Shift+R
in the file browser to refresh the view; note thatx~
is now shown. - Similarly to Test1,
Shift+I
will toggle the backup files that existed at startup, but notx~
.
Conclusion
Somehow the gitignore is taken into account only for the state of the filesystem at startup (?), but not for files created from vim.
Metadata
Metadata
Assignees
Labels
No labels