mirror of
https://github.com/pnx/dotfiles
synced 2026-06-16 03:14:55 +02:00
adding nvim/lua/user/plugins/ui/nvimtree.lua
This commit is contained in:
parent
d076a6f49f
commit
3b236f6ab4
5 changed files with 128 additions and 4 deletions
|
|
@ -155,8 +155,18 @@ return {
|
|||
modified = iconset.circle,
|
||||
readonly = iconset.lock,
|
||||
hidden = iconset.eye_disabled,
|
||||
bookmarked = iconset.star,
|
||||
},
|
||||
folder = {
|
||||
arrow_closed = iconset.caret.right,
|
||||
arrow_open = iconset.caret.down,
|
||||
closed = iconset.folder.closed,
|
||||
open = iconset.folder.open,
|
||||
empty = iconset.folder.empty,
|
||||
empty_open = iconset.folder.empty_open,
|
||||
symlink = iconset.folder.symlink,
|
||||
symlink_open = iconset.folder.symlink_open,
|
||||
},
|
||||
folder = iconset.folder,
|
||||
diff = {
|
||||
added = iconset.plus,
|
||||
modified = iconset.square,
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ vim.keymap.set('n', "<leader>ts", "<cmd>Neotest summary<cr>", { desc = "Toggle t
|
|||
--
|
||||
-- File explorer
|
||||
--
|
||||
vim.keymap.set('n', "<leader>.", "<cmd>Neotree toggle<cr>", { desc = "Toggle Neotree" })
|
||||
vim.keymap.set('n', "<leader>.", "<cmd>NvimTreeFocus<cr>", { desc = "Toggle Nvimtree" })
|
||||
|
||||
--
|
||||
-- Git
|
||||
|
|
|
|||
|
|
@ -11,7 +11,8 @@ return {
|
|||
{ import = "user.plugins.ui.statuscolumn" },
|
||||
{ import = "user.plugins.ui.gitsigns" },
|
||||
-- File explorer
|
||||
{ import = "user.plugins.ui.neotree" },
|
||||
-- { import = "user.plugins.ui.neotree" },
|
||||
{ import = "user.plugins.ui.nvimtree" },
|
||||
|
||||
{ "folke/which-key.nvim", event = "VeryLazy" },
|
||||
|
||||
|
|
|
|||
112
nvim/lua/user/plugins/ui/nvimtree.lua
Normal file
112
nvim/lua/user/plugins/ui/nvimtree.lua
Normal file
|
|
@ -0,0 +1,112 @@
|
|||
local icons = require('user.icons')
|
||||
|
||||
local options = {
|
||||
hijack_cursor = true,
|
||||
select_prompts = true,
|
||||
update_focused_file = {
|
||||
enable = true,
|
||||
},
|
||||
view = {
|
||||
number = false,
|
||||
relativenumber = false,
|
||||
signcolumn = "yes",
|
||||
width = 40,
|
||||
},
|
||||
filters = {
|
||||
dotfiles = true,
|
||||
exclude = {
|
||||
".env",
|
||||
}
|
||||
},
|
||||
diagnostics = {
|
||||
enable = true,
|
||||
icons = {
|
||||
hint = icons.diagnostics.hint,
|
||||
info = icons.diagnostics.info,
|
||||
warning = icons.diagnostics.warn,
|
||||
error = icons.diagnostics.error
|
||||
}
|
||||
},
|
||||
modified = {
|
||||
enable = true,
|
||||
},
|
||||
renderer = {
|
||||
root_folder_label = ":t",
|
||||
hidden_display = "simple",
|
||||
highlight_opened_files = "name",
|
||||
highlight_hidden = "name",
|
||||
special_files = { "Cargo.toml", "Makefile", "README.md", "readme.md", "composer.json" },
|
||||
icons = {
|
||||
git_placement = "signcolumn",
|
||||
diagnostics_placement = "right_align",
|
||||
modified_placement = "right_align",
|
||||
show = {
|
||||
-- folder_arrow = false
|
||||
},
|
||||
glyphs = {
|
||||
default = icons.files.default,
|
||||
symlink = icons.files.symlink,
|
||||
bookmark = icons.file_status.bookmarked,
|
||||
modified = icons.file_status.modified,
|
||||
hidden = icons.file_status.hidden,
|
||||
folder = {
|
||||
arrow_closed = icons.folder.arrow_closed,
|
||||
arrow_open = icons.folder.arrow_open,
|
||||
default = icons.folder.closed,
|
||||
open = icons.folder.open,
|
||||
empty = icons.folder.empty,
|
||||
empty_open = icons.folder.empty_open,
|
||||
symlink = icons.folder.symlink,
|
||||
symlink_open = icons.folder.symlink_open,
|
||||
},
|
||||
git = {
|
||||
unstaged = icons.gitsigns.unstaged,
|
||||
staged = icons.gitsigns.staged,
|
||||
unmerged = "",
|
||||
renamed = icons.gitsigns.renamed,
|
||||
untracked = icons.gitsigns.untracked,
|
||||
deleted = icons.gitsigns.deleted,
|
||||
ignored = icons.gitsigns.ignored,
|
||||
},
|
||||
},
|
||||
},
|
||||
indent_markers = {
|
||||
enable = false,
|
||||
inline_arrows = false,
|
||||
icons = {
|
||||
corner = icons.tree.nodelast,
|
||||
edge = icons.tree.vertical,
|
||||
item = icons.tree.node,
|
||||
bottom = icons.tree.horizontal,
|
||||
},
|
||||
}
|
||||
},
|
||||
actions = {
|
||||
change_dir = {
|
||||
enable = true,
|
||||
global = true,
|
||||
restrict_above_cwd = true,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
'nvim-tree/nvim-tree.lua',
|
||||
opts = options,
|
||||
config = function (_, opts)
|
||||
require('nvim-tree').setup(opts)
|
||||
|
||||
local augroup = vim.api.nvim_create_augroup("nvim-tree", {})
|
||||
|
||||
vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, {
|
||||
group = augroup,
|
||||
pattern = "*",
|
||||
callback = function(args)
|
||||
if vim.bo[args.buf].filetype == 'NvimTree' then
|
||||
vim.opt_local.fillchars:append("vert:▕")
|
||||
vim.opt_local.statuscolumn = ''
|
||||
end
|
||||
end
|
||||
})
|
||||
end
|
||||
}
|
||||
|
|
@ -7,7 +7,8 @@ local opts = function()
|
|||
relculright = true,
|
||||
ft_ignore = {
|
||||
'help',
|
||||
'alpha'
|
||||
'alpha',
|
||||
'NvimTree',
|
||||
},
|
||||
segments = {
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue