enc: backup nvim-tree config

This commit is contained in:
Pojok Code 2024-10-11 20:36:00 +07:00
parent ceb786c9cc
commit cfbb38f75e

View file

@ -1,221 +1,222 @@
local icons = pcode.icons -- local icons = pcode.icons
local set_view = {} -- local set_view = {}
if pcode.nvimtree_isfloat == 1 then -- if pcode.nvimtree_isfloat == 1 then
set_view = require("user.utils.nvimtree").float -- set_view = require("user.utils.nvimtree").float
else -- else
set_view = require("user.utils.nvimtree").normal -- set_view = require("user.utils.nvimtree").normal
end -- end
return { -- return {
"kyazdani42/nvim-tree.lua", -- "kyazdani42/nvim-tree.lua",
lazy = true, -- lazy = true,
cmd = { "NvimTreeFindFileToggle", "NvimTree", "NvimTreeOpen", "NvimTreeToggle", "NvimTreeFocus", "NvimTreeClose" }, -- cmd = { "NvimTreeFindFileToggle", "NvimTree", "NvimTreeOpen", "NvimTreeToggle", "NvimTreeFocus", "NvimTreeClose" },
opts = { -- opts = {
auto_reload_on_write = false, -- auto_reload_on_write = false,
disable_netrw = false, -- disable_netrw = false,
hijack_cursor = false, -- hijack_cursor = false,
hijack_netrw = true, -- hijack_netrw = true,
hijack_unnamed_buffer_when_opening = false, -- hijack_unnamed_buffer_when_opening = false,
sort_by = "name", -- sort_by = "name",
root_dirs = {}, -- root_dirs = {},
prefer_startup_root = false, -- prefer_startup_root = false,
sync_root_with_cwd = true, -- sync_root_with_cwd = true,
reload_on_bufenter = false, -- reload_on_bufenter = false,
respect_buf_cwd = false, -- respect_buf_cwd = false,
on_attach = "default", -- on_attach = "default",
select_prompts = false, -- select_prompts = false,
view = set_view, -- view = set_view,
renderer = { -- renderer = {
add_trailing = false, -- add_trailing = false,
group_empty = false, -- group_empty = false,
highlight_git = true, -- highlight_git = true,
full_name = false, -- full_name = false,
highlight_opened_files = "none", -- highlight_opened_files = "none",
-- root_folder_label = ":t", -- -- root_folder_label = ":t",
root_folder_label = false, -- root_folder_label = false,
indent_width = 2, -- indent_width = 2,
indent_markers = { -- indent_markers = {
enable = true, -- enable = true,
inline_arrows = true, -- inline_arrows = true,
icons = { -- icons = {
corner = "", -- corner = "└",
edge = "", -- edge = "│",
item = "", -- item = "│",
none = " ", -- none = " ",
}, -- },
}, -- },
icons = { -- icons = {
webdev_colors = true, -- webdev_colors = true,
git_placement = "before", -- git_placement = "before",
padding = " ", -- padding = " ",
symlink_arrow = "", -- symlink_arrow = " ➛ ",
show = { -- show = {
file = true, -- file = true,
folder = true, -- folder = true,
folder_arrow = true, -- folder_arrow = true,
git = true, -- git = true,
}, -- },
glyphs = { -- glyphs = {
default = icons.ui.Text, -- default = icons.ui.Text,
symlink = icons.ui.FileSymlink, -- symlink = icons.ui.FileSymlink,
bookmark = icons.ui.BookMark, -- bookmark = icons.ui.BookMark,
folder = { -- folder = {
-- arrow_closed = icons.ui.TriangleShortArrowRight, -- -- arrow_closed = icons.ui.TriangleShortArrowRight,
arrow_closed = icons.ui.ChevronShortRight, -- arrow_closed = icons.ui.ChevronShortRight,
-- arrow_open = icons.ui.TriangleShortArrowDown, -- -- arrow_open = icons.ui.TriangleShortArrowDown,
arrow_open = icons.ui.ChevronShortDown, -- arrow_open = icons.ui.ChevronShortDown,
default = icons.ui.Folder, -- default = icons.ui.Folder,
open = icons.ui.FolderOpen, -- open = icons.ui.FolderOpen,
empty = icons.ui.EmptyFolder, -- empty = icons.ui.EmptyFolder,
empty_open = icons.ui.EmptyFolderOpen, -- empty_open = icons.ui.EmptyFolderOpen,
symlink = icons.ui.FolderSymlink, -- symlink = icons.ui.FolderSymlink,
symlink_open = icons.ui.FolderOpen, -- symlink_open = icons.ui.FolderOpen,
}, -- },
git = { -- git = {
unstaged = icons.git.FileUnstaged, -- unstaged = icons.git.FileUnstaged,
staged = icons.git.FileStaged, -- staged = icons.git.FileStaged,
unmerged = icons.git.FileUnmerged, -- unmerged = icons.git.FileUnmerged,
renamed = icons.git.FileRenamed, -- renamed = icons.git.FileRenamed,
untracked = icons.git.FileUntracked, -- untracked = icons.git.FileUntracked,
deleted = icons.git.FileDeleted, -- deleted = icons.git.FileDeleted,
ignored = icons.git.FileIgnored, -- ignored = icons.git.FileIgnored,
}, -- },
}, -- },
}, -- },
special_files = { "Cargo.toml", "Makefile", "README.md", "readme.md" }, -- special_files = { "Cargo.toml", "Makefile", "README.md", "readme.md" },
symlink_destination = true, -- symlink_destination = true,
}, -- },
hijack_directories = { -- hijack_directories = {
enable = false, -- enable = false,
auto_open = true, -- auto_open = true,
}, -- },
update_focused_file = { -- update_focused_file = {
enable = true, -- enable = true,
debounce_delay = 15, -- debounce_delay = 15,
update_root = true, -- update_root = true,
ignore_list = {}, -- ignore_list = {},
}, -- },
diagnostics = { -- diagnostics = {
enable = true, -- enable = true,
show_on_dirs = false, -- show_on_dirs = false,
show_on_open_dirs = true, -- show_on_open_dirs = true,
debounce_delay = 50, -- debounce_delay = 50,
severity = { -- severity = {
min = vim.diagnostic.severity.HINT, -- min = vim.diagnostic.severity.HINT,
max = vim.diagnostic.severity.ERROR, -- max = vim.diagnostic.severity.ERROR,
}, -- },
icons = { -- icons = {
hint = icons.diagnostics.BoldHint, -- hint = icons.diagnostics.BoldHint,
info = icons.diagnostics.BoldInformation, -- info = icons.diagnostics.BoldInformation,
warning = icons.diagnostics.BoldWarning, -- warning = icons.diagnostics.BoldWarning,
error = icons.diagnostics.BoldError, -- error = icons.diagnostics.BoldError,
}, -- },
}, -- },
filters = { -- filters = {
dotfiles = false, -- dotfiles = false,
git_clean = false, -- git_clean = false,
no_buffer = false, -- no_buffer = false,
custom = { "node_modules", "\\.cache", "\\.git" }, -- custom = { "node_modules", "\\.cache", "\\.git" },
exclude = { -- exclude = {
".gitignore", -- ".gitignore",
".prettierignore", -- ".prettierignore",
}, -- },
}, -- },
filesystem_watchers = { -- filesystem_watchers = {
enable = true, -- enable = true,
debounce_delay = 50, -- debounce_delay = 50,
ignore_dirs = {}, -- ignore_dirs = {},
}, -- },
git = { -- git = {
enable = true, -- enable = true,
ignore = false, -- ignore = false,
show_on_dirs = true, -- show_on_dirs = true,
show_on_open_dirs = true, -- show_on_open_dirs = true,
disable_for_dirs = {}, -- disable_for_dirs = {},
timeout = 400, -- timeout = 400,
}, -- },
actions = { -- actions = {
use_system_clipboard = true, -- use_system_clipboard = true,
change_dir = { -- change_dir = {
enable = true, -- enable = true,
global = false, -- global = false,
restrict_above_cwd = false, -- restrict_above_cwd = false,
}, -- },
expand_all = { -- expand_all = {
max_folder_discovery = 300, -- max_folder_discovery = 300,
exclude = {}, -- exclude = {},
}, -- },
file_popup = { -- file_popup = {
open_win_config = { -- open_win_config = {
col = 1, -- col = 1,
row = 1, -- row = 1,
relative = "cursor", -- relative = "cursor",
border = "shadow", -- border = "shadow",
style = "minimal", -- style = "minimal",
}, -- },
}, -- },
open_file = { -- open_file = {
quit_on_open = false, -- quit_on_open = false,
resize_window = false, -- resize_window = false,
window_picker = { -- window_picker = {
enable = true, -- enable = true,
picker = "default", -- picker = "default",
chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890", -- chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",
exclude = { -- exclude = {
filetype = { "notify", "lazy", "qf", "diff", "fugitive", "fugitiveblame" }, -- filetype = { "notify", "lazy", "qf", "diff", "fugitive", "fugitiveblame" },
buftype = { "nofile", "terminal", "help" }, -- buftype = { "nofile", "terminal", "help" },
}, -- },
}, -- },
}, -- },
remove_file = { -- remove_file = {
close_window = true, -- close_window = true,
}, -- },
}, -- },
trash = { -- trash = {
cmd = "trash", -- cmd = "trash",
require_confirm = true, -- require_confirm = true,
}, -- },
live_filter = { -- live_filter = {
prefix = "[FILTER]: ", -- prefix = "[FILTER]: ",
always_show_folders = true, -- always_show_folders = true,
}, -- },
tab = { -- tab = {
sync = { -- sync = {
open = false, -- open = false,
close = false, -- close = false,
ignore = {}, -- ignore = {},
}, -- },
}, -- },
notify = { -- notify = {
-- threshold = vim.log.levels.INFO, -- -- threshold = vim.log.levels.INFO,
threshold = vim.log.levels.ERROR, -- threshold = vim.log.levels.ERROR,
}, -- },
log = { -- log = {
enable = false, -- enable = false,
truncate = false, -- truncate = false,
types = { -- types = {
all = false, -- all = false,
config = false, -- config = false,
copy_paste = false, -- copy_paste = false,
dev = false, -- dev = false,
diagnostics = false, -- diagnostics = false,
git = false, -- git = false,
profile = false, -- profile = false,
watcher = false, -- watcher = false,
}, -- },
}, -- },
system_open = { -- system_open = {
cmd = nil, -- cmd = nil,
args = {}, -- args = {},
}, -- },
}, -- },
keys = { -- keys = {
{ "<leader>e", "<cmd>NvimTreeToggle<cr>", desc = "󰙅 Explorer" }, -- { "<leader>e", "<cmd>NvimTreeToggle<cr>", desc = "󰙅 Explorer" },
}, -- },
config = function(_, opts) -- config = function(_, opts)
require("nvim-tree").setup(opts) -- require("nvim-tree").setup(opts)
local api = require("nvim-tree.api") -- local api = require("nvim-tree.api")
api.events.subscribe(api.events.Event.FileCreated, function(file) -- api.events.subscribe(api.events.Event.FileCreated, function(file)
vim.cmd("edit " .. file.fname) -- vim.cmd("edit " .. file.fname)
end) -- end)
end, -- end,
} -- }
return {}