Comments (2)
In future please use a https://github.com/nvim-tree/nvim-tree.lua/wiki/Troubleshooting#clean-room-replication instead of a complex setup with the (known problematic) lazy plugin manager.
Replicated:
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
vim.cmd([[set runtimepath=$VIMRUNTIME]])
vim.cmd([[set packpath=/tmp/nvt-min/site]])
local package_root = "/tmp/nvt-min/site/pack"
local install_path = package_root .. "/packer/start/packer.nvim"
local function load_plugins()
require("packer").startup({
{
"wbthomason/packer.nvim",
"nvim-tree/nvim-tree.lua",
"nvim-tree/nvim-web-devicons",
-- ADD PLUGINS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
},
config = {
package_root = package_root,
compile_path = install_path .. "/plugin/packer_compiled.lua",
display = { non_interactive = true },
},
})
end
if vim.fn.isdirectory(install_path) == 0 then
print("Installing nvim-tree and dependencies.")
vim.fn.system({ "git", "clone", "--depth=1", "https://github.com/wbthomason/packer.nvim", install_path })
end
load_plugins()
require("packer").sync()
vim.cmd([[autocmd User PackerComplete ++once echo "Ready!" | lua setup()]])
vim.opt.termguicolors = true
vim.opt.cursorline = true
local function on_attach(bufnr)
local api = require("nvim-tree.api")
-- This will make sure that newly created file get's open to edit
api.events.subscribe(api.events.Event.FileCreated, function(file)
vim.cmd("edit " .. file.fname)
end)
api.config.mappings.default_on_attach(bufnr)
end
-- MODIFY NVIM-TREE SETTINGS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
_G.setup = function()
require("nvim-tree").setup({
on_attach = on_attach,
view = {
float = {
enable = true,
},
},
})
end
The issue is that FileCreated event - it's editing the new file in the nvim-tree window.
from nvim-tree.lua.
I'll close this one down; please reopen or comment if you have further questions.
from nvim-tree.lua.
Related Issues (20)
- how to use one instance in different tab HOT 2
- Sticky nvim-tree and not using window_picker: How to remember the window where navigating into nvim-tree from?
- Quitting neovim takes a long time when toggling git ignore folders HOT 3
- Add winfixbuf to view options HOT 4
- Provide interface to customize the comparing function between two nodes HOT 1
- 0.10 luadoc and lsp integration
- Parent folder deleted when deleting a folder starting with $ HOT 4
- Make it easy to discover useful shortcuts HOT 2
- New File getting opened in floating window. HOT 5
- Module `nvim-tree.renderer.help` not found when install nvim-tree through Lazy HOT 1
- nvim-tree not respecting diagnostics update_in_insert value set by neovim HOT 8
- Float window for full filenames has wrong bg HOT 2
- Floating nvim-tree does not respect config on startup HOT 3
- Right aligned icons HOT 1
- web-devicons default not used HOT 4
- Can't create a file in neovim using nvim-tree.lua(fs_close bad argument #1) HOT 6
- [NvimTree] Could not start the fs_event watcher for path /xxxx/xxxx : ENOSPC HOT 4
- Is it not in the AUR?(Have been solved) HOT 2
- Opening a tree in a new tab messes up local statusline settings HOT 6
- Colors of NvimTree as floating window different as expected (configured) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nvim-tree.lua.