1
0
Fork 1
Dotfiles_nvim/lua/editor/file_tree.lua

84 lines
2.4 KiB
Lua
Raw Normal View History

2024-11-23 16:55:23 +00:00
local K = require('core.keymap')
2024-07-02 21:52:43 +00:00
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(
2024-11-23 16:55:23 +00:00
K.FILE_TREE.TOGGLE.mode,
K.FILE_TREE.TOGGLE.shortcut,
2024-07-02 21:52:43 +00:00
':Neotree toggle reveal left<CR>',
2024-11-23 16:55:23 +00:00
{ desc = K.FILE_TREE.TOGGLE.description }
2024-07-02 21:52:43 +00:00
)
vim.keymap.set(
2024-11-23 16:55:23 +00:00
K.FILE_TREE.SHOW_OPEN.mode,
K.FILE_TREE.SHOW_OPEN.shortcut,
2024-07-02 21:52:43 +00:00
':Neotree buffers reveal float<CR>',
2024-11-23 16:55:23 +00:00
{ desc = K.FILE_TREE.SHOW_OPEN.description }
2024-07-02 21:52:43 +00:00
)
end,
}