Dotfiles/.config/nvim/lua/plugins/file_tree.lua

81 lines
2.3 KiB
Lua

return {
"nvim-neo-tree/neo-tree.nvim",
branch = "v3.x",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons",
"MunifTanjim/nui.nvim",
},
config = function()
-- Setup --
require("neo-tree").setup({
close_if_last_window = false,
enable_git_status = true,
enable_diagnostics = true,
name = {
trailing_slash = false,
use_git_status_colors = true,
highlight = "NeoTreeFileName",
},
git_status = {
symbols = {
-- Git Change type Icon --
added = "",
modified = "",
deleted = "",
renamed = "󰁕",
-- Git Status type Icon --
untracked = "",
ignored = "",
unstaged = "󰄱",
staged = "",
conflict = "",
},
},
symlink_target = {
enabled = false,
},
filesystem = {
hijack_netrw_behavior = "open_default",
},
-- Keybinding --
window = {
mappings = {
["<space>"] = "open",
},
},
})
-- Dignostic Icons --
vim.fn.sign_define("DiagnosticSignError", {
text = "",
texthl = "DiagnosticSignError",
})
vim.fn.sign_define("DiagnosticSignWarn", {
text = "",
texthl = "DiagnosticSignWarn",
})
vim.fn.sign_define("DiagnosticSignInfo", {
text = "",
texthl = "DiagnosticSignInfo",
})
vim.fn.sign_define("DiagnosticSignHint", {
text = "󰌵",
texthl = "DiagnosticSignHint",
})
-- Keybinding --
vim.keymap.set(
"n",
"<leader>ft",
":Neotree toggle reveal left<CR>",
{ desc = "Toggle File Tree" }
)
vim.keymap.set(
"n",
"<leader>fo",
":Neotree buffers reveal float<CR>",
{ desc = "Show Open Files" }
)
end,
}