Closed Praful closed 3 months ago
If the problem also happens with Neovide, the problem is in your config, not in Firenvim. Try to remove your plugins one by one until the problem stops happening. Please do report here if you figure out that it's really a Firenvim problem, but I doubt you will.
@glacambre thanks. The issue was the set viminfo
in my vimrc
file (shared between vim/neovim), which I've now updated to be:
if exists('g:started_by_firenvim') && g:started_by_firenvim
set viminfo='50,<50,s10,h
else
set viminfo='50,<50,s10,h,%
end
The %
saves and restores buffers.
On another note, the second autosave function on the home page didn't work. I got a syntax error from neovim. With the help of chatGPT (I don't know lua), I ended up with this version:
vim.api.nvim_create_autocmd({'TextChanged', 'TextChangedI'}, {
callback = function(event)
if not vim.g.started_by_firenvim or vim.g.timer_started then
return
end
vim.g.timer_started = true
vim.fn.timer_start(5000, function()
vim.g.timer_started = false
vim.cmd('silent write')
end)
end
})
I've used "silent write" because otherwise the vim message saying the file has been saved keeps appearing after each autosave.
Finally, in case anyone finds it useful, I removed "clutter" in the textview by removing the neovim left sign column and numbers to maximise the edit space once firenvim is invoked:
vim.api.nvim_create_autocmd({'UIEnter'}, {
callback = function(event)
if vim.g.started_by_firenvim then
vim.opt.laststatus = 0
vim.opt.number = false
vim.opt.signcolumn = "no"
end
end
})
The issue was the set viminfo in my vimrc
Huh, interesting, thanks for sharing. I didn't even know Neovim could do this!
On another note, the second autosave function on the home page didn't work
Thanks a lot for reporting this. I probably broke it when I converted the example from vimscript to lua. I fixed it in 992e57666c0d4c301c5a231354b8237d7bae0282 and took the liberty of marking you as the author of the fix, I hope that's okay :).
Thanks @glacambre :) For the function, you may want to include (or provide as comment):
if not vim.g.started_by_firenvim or vim.g.timer_started then
return
end
Otherwise the timed write will happen even when the user is in nvim/neovide as well as firenvim!
I've checked the troubleshooting guide.
What I tried to do
Use the firenvim browser plugin in firefox. This works fine.
What happened
When I open neovim, there are several buffers that have been created, I assume, by firenvim. Here are some of them, produced by
ls
:Is there a way to stop these buffers being persisted or opened in neovim? They also open in neovide.