Description
Self-Diagnosis
Before creating an issue, take some time to search these resources for an answer. It's possible that someone else has already seen and solved your issue.
- old NERDTree issues
- NERDTree documentation -
:h NERDTree
- NERDTree Wiki
- Other resources: https://stackoverflow.com, https://vi.stackexchange.com, etc.
Environment
- Operating System: Ubuntu 24.04 LTS
- Vim/Neovim version
:version
: NVIM v0.9.5
Build type: Release
LuaJIT 2.1.1703358377 - NERDTree version, found on first line of quickhelp
?
: 7.1.2 - Are you using any of these NERDTree-dependent plugins?
- Provide a minimal init.lua file that will reproduce the issue.
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
-- Install plugins --------------------------------------------------------------------------------
require("lazy").setup({
-- used to be able to use icons everywhere
"ryanoasis/vim-devicons",
-- nerd tree stuff
"tiagofumo/vim-nerdtree-syntax-highlight",
"preservim/nerdtree",
"Xuyuanp/nerdtree-git-plugin",
-- fuzzy!!
{ 'junegunn/fzf', run = function() vim.fn['fzf#install']() end, },
'junegunn/fzf.vim',
}
vim.keymap.set('n', '<leader>fd', ':FZFFolders<CR>', {noremap = true, silent = true})
function FZFFolders()
vim.fn['fzf#run']({
source = 'find . -type d -print',
sink = 'e',
options = '--preview "tree -C {} | head -100"'
})
end
vim.api.nvim_create_user_command('FZFFolders', function()
FZFFolders()
end, {})
Steps to Reproduce the Issue
- Open a file using nvim
- type :NERDTree to open the tree on the left side of the window
- navigate to it using
- use the provided fd shortcut to look for directories. Open some directory.
- Now that the nerdTree shows the newly opened directory press "i" on a file to open it in a split
- profit
Current Behavior (Include screenshots where appropriate.)
I receive the following error in the terminal below:
Error detected while processing function nerdtree#ui_glue#invokeKeyMap[1]..76[18]..75[3]..23_openVSplit[1]..105[1]..121[3]..177[6]..178[9]..172[3]..176[16]..218[1]..228[2]..function ner
dtree#ui_glue#invokeKeyMap[1]..76[18]..75[3]..23_openVSplit[1]..105[1]..121[3]..177[6]..178[9]..172[3]..176[16]..218[1]..228:
line 2:
E605: Exception not caught: NERDTree.TreeNotOpen
and after I press enter the same window that I had opened previously opens in another split window
and if I try to use "o" instead, it just replaces the nerdtree itself instead of the file next to it
Expected Result
open the chosen file in the tree in a split above the currently opened buffer.
or when using "o", replaces the currently opened file with the chosen on in the tree
Aditional stuff
I also found issue #1374 which seemed to have a similar problem, and had a solution provided, but it didn't work for me.