mirror of
https://github.com/buckley310/nixos-config.git
synced 2024-11-09 18:47:02 +00:00
30 lines
803 B
Lua
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
|
|
},
|
|
})
|