nixos-config/pkgs/bck-nvim/lua/1-nvimtree.lua
2024-10-26 02:27:35 -04:00

30 lines
803 B
Lua

vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
vim.opt.termguicolors = true
vim.cmd("colorscheme codedark")
vim.keymap.set('n', '<space>e', '<cmd>NvimTreeToggle<cr>')
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
api.config.mappings.default_on_attach(bufnr)
vim.keymap.set('n', 'l', api.node.open.edit, opts('Open'))
vim.keymap.set('n', 'h', api.node.navigate.parent_close, opts('Close Directory'))
end
require("nvim-tree").setup({
on_attach = my_on_attach,
disable_netrw = true,
hijack_netrw = true,
sync_root_with_cwd = true,
respect_buf_cwd = true,
update_focused_file = {
enable = true,
update_root = true
},
})