enc: add option nvim-tree or neo-tree

This commit is contained in:
Pojok Code 2025-07-22 21:34:50 +07:00
parent c29942d4a7
commit 3f3e84aa49
7 changed files with 436 additions and 290 deletions

View file

@ -2,10 +2,10 @@
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
"LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" },
"alpha-nvim": { "branch": "main", "commit": "2b3cbcdd980cae1e022409289245053f62fb50f6" },
"auto-bufferline.nvim": { "branch": "main", "commit": "d15a71bb7c6d22dee18cedbcff0d9830f5485d06" },
"auto-bufferline.nvim": { "branch": "main", "commit": "6a69520dcb0dc615df3cf972f69027aae3f75c3e" },
"auto-conform.nvim": { "branch": "main", "commit": "5f0897235e84bf2f8ff9d634e81678d5bfa63ab8" },
"auto-lint.nvim": { "branch": "main", "commit": "aff13cb8eaa055e66e940d43b7d83166397e5413" },
"auto-lsp.nvim": { "branch": "main", "commit": "d766e720ead6f2ea5753837d44259fdbef5b4e51" },
"auto-lsp.nvim": { "branch": "main", "commit": "31c60d36379342ab6be398d95b99f3d333a38977" },
"auto-lualine.nvim": { "branch": "main", "commit": "201da916411a56d0b27905528a7cb49a320ee054" },
"breadcrumbs.nvim": { "branch": "master", "commit": "9f764278784ce2f10dbe2f555ba14be2451d36a0" },
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
@ -21,7 +21,7 @@
"dracula.nvim": { "branch": "main", "commit": "96c9d19ce81b26053055ad6f688277d655b3f7d2" },
"dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" },
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
"gitsigns.nvim": { "branch": "main", "commit": "0cb5a7753d3c4b8e9cfdc9d88d9110cb8d4b1544" },
"gitsigns.nvim": { "branch": "main", "commit": "93f882f7041a2e779addbd34943812ca66edef5a" },
"hlchunk.nvim": { "branch": "main", "commit": "474ec5d0f220158afa83aaefab32402e710d3032" },
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
"lsp_signature.nvim": { "branch": "master", "commit": "d9c39937e4e0977357530e988aa8940078bb231f" },
@ -34,18 +34,18 @@
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
"nvim-autopairs": { "branch": "master", "commit": "23320e75953ac82e559c610bec5a90d9c6dfa743" },
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
"nvim-lint": { "branch": "master", "commit": "52e603c4b66f2fb4f268916725076e6c3ae412fd" },
"nvim-lint": { "branch": "master", "commit": "9c6207559297b24f0b7c32829f8e45f7d65b991f" },
"nvim-lspconfig": { "branch": "master", "commit": "f47cd681d7cb6048876a2e908b6d8ba1e530d152" },
"nvim-material-icon": { "branch": "main", "commit": "c25a4e56be2f846dfdf8f30b980adc17f219d019" },
"nvim-navic": { "branch": "master", "commit": "f887d794a0f4594882814d7780980a949200a238" },
"nvim-notify": { "branch": "master", "commit": "a22f5d7ac511c2df2fd3290a9f04c48d5a822e2e" },
"nvim-tree.lua": { "branch": "master", "commit": "b0b49552c9462900a882fe772993b01d780445fe" },
"nvim-notify": { "branch": "master", "commit": "397c7c1184745fca649e5104de659e6392ef5a4d" },
"nvim-tree.lua": { "branch": "master", "commit": "543ed3cac212dc3993ef9f042f6c0812e34ddd43" },
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
"nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" },
"nvim-web-devicons": { "branch": "master", "commit": "0422a19d9aa3aad2c7e5cca167e5407b13407a9d" },
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
"rainbow-delimiters.nvim": { "branch": "master", "commit": "884350c4322c26b3c577397113fe856355c03101" },
"rainbow-delimiters.nvim": { "branch": "master", "commit": "49372aadaaf04d14a50efaa34150c51d5a8047e1" },
"smart-splits.nvim": { "branch": "master", "commit": "f59fddc055373ec0fe2bbe2a3e7d7df2ee314994" },
"telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" },
"toggleterm.nvim": { "branch": "main", "commit": "9a88eae817ef395952e08650b3283726786fb5fb" },

View file

@ -1,174 +1,321 @@
return {
"nvim-tree/nvim-tree.lua",
cmd = { "NvimTreeFindFileToggle", "NvimTree", "NvimTreeOpen", "NvimTreeToggle", "NvimTreeFocus", "NvimTreeClose" },
keys = {
{ "<leader>e", "<cmd>NvimTreeToggle<cr>", desc = "󰙅 Explorer" },
},
opts = function(_, opts)
local icons = require("pcode.user.icons")
opts.auto_reload_on_write = false
opts.disable_netrw = false
opts.hijack_cursor = false
opts.hijack_netrw = true
opts.hijack_unnamed_buffer_when_opening = false
opts.sync_root_with_cwd = true
opts.sort = {
sorter = "name",
folders_first = true,
files_first = false,
}
opts.root_dirs = {}
opts.prefer_startup_root = false
opts.sync_root_with_cwd = true
opts.reload_on_bufenter = false
opts.respect_buf_cwd = false
opts.on_attach = "default"
opts.select_prompts = false
opts.update_focused_file = {
enable = true,
update_root = false,
}
opts.view = {
adaptive_size = false,
centralize_selection = true,
width = 30,
side = "left",
preserve_window_proportions = false,
number = false,
relativenumber = false,
signcolumn = "yes",
float = {
enable = false,
quit_on_focus_loss = true,
open_win_config = {
relative = "editor",
border = "rounded",
width = 30,
height = 30,
row = 1,
col = 1,
},
},
}
opts.renderer = {
root_folder_label = false,
highlight_git = true,
indent_markers = { enable = true },
--[[ indent_markers = {
enable = true,
inline_arrows = true,
icons = {
corner = "",
edge = "",
item = "",
none = " ",
},
}, ]]
icons = {
webdev_colors = true,
git_placement = "before",
padding = " ",
symlink_arrow = "",
show = {
file = true,
folder = true,
folder_arrow = true,
git = true,
},
glyphs = {
default = icons.ui.Text,
symlink = icons.ui.FileSymlink,
bookmark = icons.ui.BookMark,
folder = {
arrow_closed = icons.ui.ChevronShortRight,
arrow_open = icons.ui.ChevronShortDown,
default = icons.ui.Folder,
open = icons.ui.FolderOpen,
empty = icons.ui.EmptyFolder,
empty_open = icons.ui.EmptyFolderOpen,
symlink = icons.ui.FolderSymlink,
symlink_open = icons.ui.FolderOpen,
},
git = {
unstaged = icons.git.FileUnstaged,
staged = icons.git.FileStaged,
unmerged = icons.git.FileUnmerged,
renamed = icons.git.FileRenamed,
untracked = icons.git.FileUntracked,
deleted = icons.git.FileDeleted,
ignored = icons.git.FileIgnored,
},
},
},
special_files = { "Cargo.toml", "Makefile", "README.md", "readme.md" },
symlink_destination = true,
}
opts.filters = {
dotfiles = false,
git_clean = false,
no_buffer = false,
custom = { "node_modules", "\\.cache", "\\.git" },
exclude = {
".gitignore",
".prettierignore",
},
}
opts.notify = {
threshold = vim.log.levels.INFO,
}
opts.git = {
enable = true,
ignore = false,
show_on_dirs = true,
show_on_open_dirs = true,
disable_for_dirs = {},
timeout = 400,
}
return opts
end,
config = function(_, opts)
if pcode.nvimtree_float then
-- set nvimtree float view (default left side)
local M = {}
if pcode.use_nvimtree then
-- for fix error last close buffer
vim.api.nvim_create_autocmd({ "QuitPre" }, {
callback = function()
vim.cmd("NvimTreeClose")
end,
})
M = {
"nvim-tree/nvim-tree.lua",
cmd = { "NvimTreeFindFileToggle", "NvimTree", "NvimTreeOpen", "NvimTreeToggle", "NvimTreeFocus", "NvimTreeClose" },
keys = {
{ "<leader>e", "<cmd>NvimTreeToggle<cr>", desc = "󰙅 Explorer" },
},
opts = function(_, opts)
local icons = require("pcode.user.icons")
opts.auto_reload_on_write = false
opts.disable_netrw = false
opts.hijack_cursor = false
opts.hijack_netrw = true
opts.hijack_unnamed_buffer_when_opening = false
opts.sync_root_with_cwd = true
opts.sort = {
sorter = "name",
folders_first = true,
files_first = false,
}
opts.root_dirs = {}
opts.prefer_startup_root = false
opts.sync_root_with_cwd = true
opts.reload_on_bufenter = false
opts.respect_buf_cwd = false
opts.on_attach = "default"
opts.select_prompts = false
opts.update_focused_file = {
enable = true,
update_root = false,
}
opts.view = {
adaptive_size = false,
centralize_selection = true,
width = 30,
side = "left",
preserve_window_proportions = false,
number = false,
relativenumber = false,
signcolumn = "yes",
float = {
enable = true,
open_win_config = function()
local screen_w = vim.opt.columns:get()
---@diagnostic disable-next-line: undefined-field
local screen_h = vim.opt.lines:get() - vim.opt.cmdheight:get()
local window_w = screen_w * 0.5
local window_h = screen_h * 0.9
local window_w_int = math.floor(window_w)
local window_h_int = math.floor(window_h)
local center_x = (screen_w - window_w) / 2
---@diagnostic disable-next-line: undefined-field
local center_y = ((vim.opt.lines:get() - window_h) / 2) - vim.opt.cmdheight:get()
return {
border = "rounded",
relative = "editor",
row = center_y,
col = center_x,
width = window_w_int,
height = window_h_int,
}
end,
enable = false,
quit_on_focus_loss = true,
open_win_config = {
relative = "editor",
border = "rounded",
width = 30,
height = 30,
row = 1,
col = 1,
},
},
width = function()
return math.floor(vim.opt.columns:get() * 0.5)
end,
}
end
require("nvim-tree").setup(opts)
local api = require("nvim-tree.api")
api.events.subscribe(api.events.Event.FileCreated, function(file)
vim.cmd("edit " .. file.fname)
end)
end,
}
opts.renderer = {
root_folder_label = false,
highlight_git = true,
indent_markers = { enable = true },
-- indent_markers = {
-- enable = true,
-- inline_arrows = true,
-- icons = {
-- corner = "└",
-- edge = "│",
-- item = "│",
-- none = " ",
-- },
-- },
icons = {
webdev_colors = true,
git_placement = "before",
padding = " ",
symlink_arrow = "",
show = {
file = true,
folder = true,
folder_arrow = true,
git = true,
},
glyphs = {
default = icons.ui.Text,
symlink = icons.ui.FileSymlink,
bookmark = icons.ui.BookMark,
folder = {
arrow_closed = icons.ui.ChevronShortRight,
arrow_open = icons.ui.ChevronShortDown,
default = icons.ui.Folder,
open = icons.ui.FolderOpen,
empty = icons.ui.EmptyFolder,
empty_open = icons.ui.EmptyFolderOpen,
symlink = icons.ui.FolderSymlink,
symlink_open = icons.ui.FolderOpen,
},
git = {
unstaged = icons.git.FileUnstaged,
staged = icons.git.FileStaged,
unmerged = icons.git.FileUnmerged,
renamed = icons.git.FileRenamed,
untracked = icons.git.FileUntracked,
deleted = icons.git.FileDeleted,
ignored = icons.git.FileIgnored,
},
},
},
special_files = { "Cargo.toml", "Makefile", "README.md", "readme.md" },
symlink_destination = true,
}
opts.filters = {
dotfiles = false,
git_clean = false,
no_buffer = false,
custom = { "node_modules", "\\.cache", "\\.git" },
exclude = {
".gitignore",
".prettierignore",
},
}
opts.notify = {
threshold = vim.log.levels.INFO,
}
opts.git = {
enable = true,
ignore = false,
show_on_dirs = true,
show_on_open_dirs = true,
disable_for_dirs = {},
timeout = 400,
}
return opts
end,
config = function(_, opts)
if pcode.nvimtree_float then
-- set nvimtree float view (default left side)
opts.view = {
adaptive_size = false,
centralize_selection = true,
side = "left",
preserve_window_proportions = false,
number = false,
relativenumber = false,
signcolumn = "yes",
float = {
enable = true,
open_win_config = function()
local screen_w = vim.opt.columns:get()
---@diagnostic disable-next-line: undefined-field
local screen_h = vim.opt.lines:get() - vim.opt.cmdheight:get()
local window_w = screen_w * 0.5
local window_h = screen_h * 0.9
local window_w_int = math.floor(window_w)
local window_h_int = math.floor(window_h)
local center_x = (screen_w - window_w) / 2
---@diagnostic disable-next-line: undefined-field
local center_y = ((vim.opt.lines:get() - window_h) / 2) - vim.opt.cmdheight:get()
return {
border = "rounded",
relative = "editor",
row = center_y,
col = center_x,
width = window_w_int,
height = window_h_int,
}
end,
},
width = function()
return math.floor(vim.opt.columns:get() * 0.5)
end,
}
end
require("nvim-tree").setup(opts)
local api = require("nvim-tree.api")
api.events.subscribe(api.events.Event.FileCreated, function(file)
vim.cmd("edit " .. file.fname)
end)
end,
}
else
local git_available = vim.fn.executable("git") == 1
M = {
"nvim-neo-tree/neo-tree.nvim",
branch = "v3.x",
event = { "BufRead", "BufNewFile" },
cmd = "Neotree",
dependencies = {
"nvim-lua/plenary.nvim",
"MunifTanjim/nui.nvim",
},
deactivate = function()
vim.cmd([[Neotree close]])
end,
keys = {
{
"<leader>e",
"<CMD>Neotree toggle<CR>",
desc = "Explorer",
},
},
init = function()
vim.api.nvim_create_autocmd("BufEnter", {
group = vim.api.nvim_create_augroup("Neotree_start_directory", { clear = true }),
desc = "Start Neo-tree with directory",
once = true,
callback = function()
if not package.loaded["neo-tree"] then
local stats = vim.uv.fs_stat(vim.fn.argv(0))
if stats and stats.type == "directory" then
require("neo-tree")
end
end
end,
})
end,
opts = {
popup_border_style = "rounded",
enable_git_status = git_available,
auto_clean_after_session_restore = true,
close_if_last_window = true,
sources = vim.tbl_filter(function(src)
return src ~= nil
end, {
"filesystem",
"buffers",
git_available and "git_status" or nil,
}),
source_selector = {
winbar = true,
content_layout = "center",
sources = {
{ source = "filesystem", display_name = " 󰉓 Files " },
{ source = "buffers", display_name = "  Buffers " },
{ source = "git_status", display_name = "  Git " },
},
},
window = {
position = "left",
width = 35,
},
default_component_configs = {
icon = {
folder_closed = "󰉋",
folder_open = "󰝰",
folder_empty = "󰉖",
},
git_status = {
symbols = {
unstaged = "󰄱",
staged = "󰱒",
added = "", -- or "✚", but this is redundant info if you use git_status_colors on the name
modified = "", -- or "", but this is redundant info if you use git_status_colors on the name
deleted = "", -- this can only be used in the git_status source
renamed = "󰁕", -- this can only be used in the git_status source
-- Status type
untracked = "",
ignored = "",
conflict = "",
},
},
},
filesystem = {
filtered_items = {
visible = false,
hide_dotfiles = false,
hide_gitignored = false,
hide_hidden = true,
hide_by_name = {
".git",
"node_modules",
},
},
},
buffers = {
follow_current_file = {
enabled = true,
leave_dirs_open = false,
},
group_empty_dirs = true,
show_unloaded = true,
},
},
config = function(_, opts)
require("neo-tree").setup(opts)
vim.api.nvim_create_autocmd("TermClose", {
pattern = "*lazygit*",
callback = function()
if package.loaded["neo-tree.sources.git_status"] then
require("neo-tree.sources.git_status").refresh()
end
end,
})
-- vim.cmd [[
-- highlight NeoTreeTabActive guifg=#ffffff guibg=#5f87af
-- highlight NeoTreeTabInactive guifg=#aaaaaa guibg=NONE
-- highlight NeoTreeTabSeparatorActive guifg=#5f87af guibg=NONE
-- highlight NeoTreeTabSeparatorInactive guifg=#3a3a3a guibg=NONE
-- ]]
end,
}
end
return M

View file

@ -27,6 +27,7 @@ return {
["@string.css"] = { fg = colors.pink },
["@punctuation.delimiter.lua"] = { fg = colors.orange },
NvimTreeFolderIcon = { fg = "#6776a7" },
NeoTreeDirectoryIcon = { fg = "#6776a7" },
CmpItemAbbr = { fg = "#ABB2BF" },
CmpItemKind = { fg = "#ABB2BF" },
CmpItemAbbrDeprecated = { fg = "#ABB2BF" },
@ -53,6 +54,10 @@ return {
WinBarNC = { fg = colors.fg, bg = colors.bg },
MasonBackdrop = { link = "NormalFloat" },
CodeiumSuggestion = { fg = "#94969c" },
NeoTreeTabInactive = { fg = "#6776a7", bg = colors.bg },
NeoTreeTabSeparatorActive = { fg = "#6776a7", bg = colors.bg },
NeoTreeTabSeparatorInactive = { fg = "#6776a7", bg = colors.bg },
NeoTreeTabActive = { fg = colors.fg, bg = colors.selection },
},
transparent_bg = false,
}

View file

@ -1,74 +1,74 @@
return {
"folke/which-key.nvim",
lazy = true,
keys = { "<leader>", '"', "'", "`", "c", "v" },
event = "VeryLazy",
opts = function()
return {
plugins = {
marks = true,
registers = true,
spelling = {
enabled = true,
suggestions = 20,
},
presets = {
operators = false,
motions = false,
text_objects = false,
windows = false,
nav = false,
z = false,
g = false,
},
},
icons = {
mappings = false,
},
win = {
row = -1,
border = "rounded", -- none, single, double, shadow
padding = { 1, 2 }, -- extra window padding [top/bottom, right/left]
title = true,
title_pos = "center",
zindex = 1000,
bo = {},
wo = {},
},
layout = {
height = { min = 4, max = 25 }, -- min and max height of the columns
width = { min = 20, max = 50 }, -- min and max width of the columns
spacing = 3, -- spacing between columns
align = "left", -- align columns left, center or right
},
show_help = true, -- show help message on the command line when the popup is visible
show_keys = true, -- show the currently pressed key and its label as a message in the command line
-- Disabled by default for Telescope
disable = {
buftypes = {},
filetypes = { "TelescopePrompt" },
},
---@type false | "classic" | "modern" | "helix"
preset = "classic",
mappings = {
{ "<leader>S", "", desc = " 󱑠 Plugins(Lazy)", mode = "n" },
{ "<leader>Si", "<cmd>Lazy install<cr>", desc = "Install", mode = "n" },
{ "<leader>Ss", "<cmd>Lazy sync<cr>", desc = "Sync", mode = "n" },
{ "<leader>SS", "<cmd>Lazy clear<cr>", desc = "Status", mode = "n" },
{ "<leader>Sc", "<cmd>Lazy clean<cr>", desc = "Clean", mode = "n" },
{ "<leader>Su", "<cmd>Lazy update<cr>", desc = "Update", mode = "n" },
{ "<leader>Sp", "<cmd>Lazy profile<cr>", desc = "Profile", mode = "n" },
{ "<leader>Sl", "<cmd>Lazy log<cr>", desc = "Log", mode = "n" },
{ "<leader>Sd", "<cmd>Lazy debug<cr>", desc = "Debug", mode = "n" },
{ "<leader>w", "<cmd>w!<CR>", desc = "󰆓 Save", mode = "n" },
{ "<leader>q", "<cmd>q!<CR>", desc = "󰿅 Quit", mode = "n" },
{ "<leader>h", "<cmd>nohlsearch<CR>", desc = "󱪿 No Highlight", mode = "n" },
},
}
end,
config = function(_, opts)
local which_key = require("which-key")
which_key.setup(opts)
which_key.add(opts.mappings)
end,
"folke/which-key.nvim",
lazy = true,
keys = { "<leader>", '"', "'", "`", "c", "v" },
event = "VeryLazy",
opts = function()
return {
plugins = {
marks = true,
registers = true,
spelling = {
enabled = true,
suggestions = 20,
},
presets = {
operators = false,
motions = false,
text_objects = false,
windows = false,
nav = false,
z = false,
g = false,
},
},
icons = {
mappings = false,
},
win = {
row = -1,
border = "rounded", -- none, single, double, shadow
padding = { 1, 2 }, -- extra window padding [top/bottom, right/left]
title = true,
title_pos = "center",
zindex = 1000,
bo = {},
wo = {},
},
layout = {
height = { min = 4, max = 25 }, -- min and max height of the columns
width = { min = 20, max = 50 }, -- min and max width of the columns
spacing = 3, -- spacing between columns
align = "left", -- align columns left, center or right
},
show_help = true, -- show help message on the command line when the popup is visible
show_keys = true, -- show the currently pressed key and its label as a message in the command line
-- Disabled by default for Telescope
disable = {
buftypes = {},
filetypes = { "TelescopePrompt" },
},
---@type false | "classic" | "modern" | "helix"
preset = "modern",
mappings = {
{ "<leader>S", "", desc = " 󱑠 Plugins(Lazy)", mode = "n" },
{ "<leader>Si", "<cmd>Lazy install<cr>", desc = "Install", mode = "n" },
{ "<leader>Ss", "<cmd>Lazy sync<cr>", desc = "Sync", mode = "n" },
{ "<leader>SS", "<cmd>Lazy clear<cr>", desc = "Status", mode = "n" },
{ "<leader>Sc", "<cmd>Lazy clean<cr>", desc = "Clean", mode = "n" },
{ "<leader>Su", "<cmd>Lazy update<cr>", desc = "Update", mode = "n" },
{ "<leader>Sp", "<cmd>Lazy profile<cr>", desc = "Profile", mode = "n" },
{ "<leader>Sl", "<cmd>Lazy log<cr>", desc = "Log", mode = "n" },
{ "<leader>Sd", "<cmd>Lazy debug<cr>", desc = "Debug", mode = "n" },
{ "<leader>w", "<cmd>w!<CR>", desc = "󰆓 Save", mode = "n" },
{ "<leader>q", "<cmd>q!<CR>", desc = "󰿅 Quit", mode = "n" },
{ "<leader>h", "<cmd>nohlsearch<CR>", desc = "󱪿 No Highlight", mode = "n" },
},
}
end,
config = function(_, opts)
local which_key = require("which-key")
which_key.setup(opts)
which_key.add(opts.mappings)
end,
}

View file

@ -72,13 +72,6 @@ api.nvim_create_autocmd("BufWritePre", {
end,
})
-- for fix error last close buffer
vim.api.nvim_create_autocmd({ "QuitPre" }, {
callback = function()
vim.cmd("NvimTreeClose")
end,
})
local autocmd = vim.api.nvim_create_autocmd
autocmd("VimEnter", {
pattern = "*",

View file

@ -18,7 +18,7 @@ return {
opts = {
-- for more options check out https://github.com/pojokcodeid/auto-lualine.nvim
setColor = "auto",
setOption = "roundedall",
setOption = "parallelogram",
setMode = 5,
},
},
@ -102,44 +102,44 @@ return {
end,
},
-- custem nvimtree
{
"nvim-tree/nvim-tree.lua",
opts = function(_, opts)
-- set nvimtree float view (default left side)
-- opts.view = {
-- adaptive_size = false,
-- centralize_selection = true,
-- side = "left",
-- preserve_window_proportions = false,
-- number = false,
-- relativenumber = false,
-- signcolumn = "yes",
-- float = {
-- enable = true,
-- open_win_config = function()
-- local screen_w = vim.opt.columns:get()
-- local screen_h = vim.opt.lines:get() - vim.opt.cmdheight:get()
-- local window_w = screen_w * 0.5
-- local window_h = screen_h * 0.9
-- local window_w_int = math.floor(window_w)
-- local window_h_int = math.floor(window_h)
-- local center_x = (screen_w - window_w) / 2
-- local center_y = ((vim.opt.lines:get() - window_h) / 2) - vim.opt.cmdheight:get()
-- return {
-- border = "rounded",
-- relative = "editor",
-- row = center_y,
-- col = center_x,
-- width = window_w_int,
-- height = window_h_int,
-- }
-- end,
-- },
-- width = function()
-- return math.floor(vim.opt.columns:get() * 0.5)
-- end,
-- }
return opts
end,
},
-- {
-- "nvim-tree/nvim-tree.lua",
-- opts = function(_, opts)
-- set nvimtree float view (default left side)
-- opts.view = {
-- adaptive_size = false,
-- centralize_selection = true,
-- side = "left",
-- preserve_window_proportions = false,
-- number = false,
-- relativenumber = false,
-- signcolumn = "yes",
-- float = {
-- enable = true,
-- open_win_config = function()
-- local screen_w = vim.opt.columns:get()
-- local screen_h = vim.opt.lines:get() - vim.opt.cmdheight:get()
-- local window_w = screen_w * 0.5
-- local window_h = screen_h * 0.9
-- local window_w_int = math.floor(window_w)
-- local window_h_int = math.floor(window_h)
-- local center_x = (screen_w - window_w) / 2
-- local center_y = ((vim.opt.lines:get() - window_h) / 2) - vim.opt.cmdheight:get()
-- return {
-- border = "rounded",
-- relative = "editor",
-- row = center_y,
-- col = center_x,
-- width = window_w_int,
-- height = window_h_int,
-- }
-- end,
-- },
-- width = function()
-- return math.floor(vim.opt.columns:get() * 0.5)
-- end,
-- }
-- return opts
-- end,
-- },
}

View file

@ -101,4 +101,5 @@ pcode.themes = {
pcode.transparent = false
pcode.localcode = true
pcode.snippets_path = vim.fn.stdpath("config") .. "/mysnippets"
pcode.use_nvimtree = true
pcode.nvimtree_float = false