diff --git a/lua/config/nvim-tree.lua b/lua/config/nvim-tree.lua new file mode 100644 index 0000000..7375735 --- /dev/null +++ b/lua/config/nvim-tree.lua @@ -0,0 +1,62 @@ +local nvim_tree = require("nvim-tree") + +nvim_tree.setup({ + disable_netrw = true, + hijack_netrw = true, + open_on_setup = false, + ignore_ft_on_setup = {}, + auto_close = false, + open_on_tab = false, + hijack_cursor = false, + update_cwd = false, + update_to_buf_dir = { + enable = true, + auto_open = true, + }, + diagnostics = { + enable = false, + icons = { + hint = "", + info = "", + warning = "", + error = "", + }, + }, + update_focused_file = { + enable = false, + update_cwd = false, + ignore_list = {}, + }, + system_open = { + cmd = nil, + args = {}, + }, + filters = { + dotfiles = false, + custom = {}, + }, + git = { + enable = true, + ignore = true, + timeout = 500, + }, + view = { + width = 40, + height = 30, + hide_root_folder = false, + side = "left", + auto_resize = false, + mappings = { + custom_only = false, + list = {}, + }, + number = false, + relativenumber = false, + signcolumn = "yes", + }, + trash = { + cmd = "trash", + require_confirm = true, + }, +}) +vim.api.nvim_set_keymap("n", "s", "NvimTreeToggle", { noremap = true, silent = true }) diff --git a/lua/plugins.lua b/lua/plugins.lua index 686d818..ea439a6 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -354,6 +354,14 @@ require("packer").startup({ -- show and trim trailing whitespaces use {'jdhao/whitespace.nvim', event = 'VimEnter'} + + -- file explorer + use { + 'kyazdani42/nvim-tree.lua', + requires = { 'kyazdani42/nvim-web-devicons' }, + keys = {{'n', 's'}, }, + config = [[require('config.nvim-tree')]] + } end, config = { max_jobs = 16,