Neovim loses filetype when file is closed then reopened
See original GitHub issueBasically, when you close then reopen a file, filetype
is not set. I have only tried this on WSL.
Reproduction steps:
- Set up environment:
mkdir test
cd test
touch foo.py
code .
- Click on
foo.py
in the project tree to open the file - Run
set ft?
and observe outputfiletype=python
- Close the current tab you’re using to view
foo.py
- Click on
foo.py
in the project tree to open the file again - Run
set ft?
and observe outputfiletype=
Expected behavior:
set ft?
still outputs filetype=python
after closing and reopening the file.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Focused buffer randomly loses syntax highlighting #17237
Randomly, when I switch OS focus to NeoVim/Tmux/Alacritty, the current buffer (only) has lost syntax highlighting. It's is infrequent. Maybe 4 ...
Read more >How to revert to "close file when buffer closes" behavior in ...
The "old" Vim behavior was to close the file when all associated buffers are closed. With the newest version of Neovim, it appears...
Read more >If I accidentally closed a buffer in Vim, how can I reopen it ...
I'm assuming you meant setting stuff like the number of lines or the syntax colouring etc. Go to your command shell and type:...
Read more >How to reopen last closed tab? : r/neovim - Reddit
The file is still loaded as a buffer in vim when its window is closed, so I never lose any unsaved work.
Read more >In neovim, how do I get a file to open at the same line number I ...
Show activity on this post. This code is valid in vim. It is the syntax of vimscript. It can also work in neovim's...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Oh I wasn’t aware. Fixed on my machine!
@jpear1 you don’t need to install from source. 0.0.76 is the latest master