Fix few things
This commit is contained in:
@@ -1,8 +1,22 @@
|
||||
-- disable netrw at the very start of your init.lua
|
||||
--vim.g.loaded_netrw = 1
|
||||
--vim.g.loaded_netrwPlugin = 1
|
||||
local function my_on_attach(bufnr)
|
||||
local api = require "nvim-tree.api"
|
||||
|
||||
local function opts(desc)
|
||||
return { desc = "nvim-tree: " .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true }
|
||||
end
|
||||
|
||||
-- default mappings
|
||||
api.config.mappings.default_on_attach(bufnr)
|
||||
|
||||
-- custom mappings
|
||||
vim.keymap.set("n", "<C-$>", api.tree.change_root_to_node, opts('CD')) --cd
|
||||
end
|
||||
|
||||
-- empty setup using defaults
|
||||
require("nvim-tree").setup()
|
||||
require("nvim-tree").setup({on_attach = my_on_attach,})
|
||||
|
||||
vim.g.nvim_tree_respect_buf_cwd = 1
|
||||
|
||||
-- disable netrw at the very start of your init.lua
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
|
||||
Reference in New Issue
Block a user