Open
Description
Did you check docs and existing issues?
- I have read all the docs.
- I have searched the existing issues.
- I have searched the existing discussions.
Neovim Version (nvim -v)
NVIM v0.9.2
Operating System / Version
Centos 6
Describe the Bug
I am using the TAB key to preview the file, like NvimTree. Though it shows the file preview, it doesn't show the buffer title.
Also, I can go to the preview buffer and edit it. However, when I go to the previous/next buffer, the preview buffer is lost, which is unsaved.
Screenshots, Traceback
Steps to Reproduce
- Map TAB key to "preview"
- Press TAB on a file
Expected Behavior
It should show the preview of the file on the right side, with the buffer title (name of the file on the buffer line).
Your Configuration
-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)
-- install plugins
local plugins = {
"folke/tokyonight.nvim",
-- add any other plugins here
}
local neotree_config = {
"nvim-neo-tree/neo-tree.nvim",
dependencies = { "MunifTanjim/nui.nvim", "nvim-tree/nvim-web-devicons", "nvim-lua/plenary.nvim" },
cmd = { "Neotree" },
config = function()
require("neo-tree").setup({
window = {
mappings = {
["<TAB>"] = "preview"
}
},
source_selector = {
winbar = true,
statusline = false
}
})
end
}
table.insert(plugins, neotree_config)
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
vim.cmd.colorscheme("tokyonight")
-- add anything else here