addet some configurations

This commit is contained in:
pika 2024-08-17 21:02:18 +02:00
parent a97049a1d1
commit 58552a7a72

View file

@ -2,13 +2,75 @@ return {
{ {
"nvim-neo-tree/neo-tree.nvim", "nvim-neo-tree/neo-tree.nvim",
opts = { opts = {
sources = { "filesystem", "buffers", "git_status" },
open_files_do_not_replace_types = { "terminal", "Trouble", "trouble", "qf", "Outline" },
close_if_last_window = false, -- Close Neo-tree if it is the last window left in the tab
popup_border_style = "rounded",
enable_git_status = true,
enable_diagnostics = true,
filesystem = {
bind_to_cwd = false,
follow_current_file = { enabled = true },
use_libuv_file_watcher = true,
components = {
name = function(config, node, state)
local result = require("neo-tree.sources.filesystem.components").name(config, node, state)
-- Check if the file is open in a buffer
local is_open = false
for _, buf in ipairs(vim.api.nvim_list_bufs()) do
if vim.api.nvim_buf_get_name(buf) == node.path then
is_open = true
break
end
end
-- Add an indicator if the file is open
if is_open then
result.text = result.text .. " 󱞇"
end
return result
end,
},
},
window = { window = {
mappings = { mappings = {
["l"] = "open", ["l"] = "open",
["o"] = "open",
["h"] = "close_node", ["h"] = "close_node",
["C-v"] = "open_split", ["<space>"] = "none",
["Y"] = {
function(state)
local node = state.tree:get_node()
local path = node:get_id()
vim.fn.setreg("+", path, "c")
end,
desc = "Copy Path to Clipboard",
}, },
["O"] = {
function(state)
require("lazy.util").open(state.tree:get_node().path, { system = true })
end,
desc = "Open with System Application",
},
["P"] = { "toggle_preview", config = { use_float = false } },
},
},
default_component_configs = {
indent = {
with_expanders = true, -- if nil and file nesting is enabled, will enable expanders
expander_collapsed = "",
expander_expanded = "",
expander_highlight = "NeoTreeExpander",
},
git_status = {
symbols = {
unstaged = "󰄱",
staged = "󰱒",
},
},
}
}, },
branch = "v3.x", branch = "v3.x",
dependencies = { dependencies = {
@ -18,5 +80,5 @@ return {
"3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information
} }
} }
}
} }