This commit is contained in:
Markus Dieckmann 2023-02-01 21:48:43 +01:00
parent 0546335cf2
commit c5e502f761
1 changed files with 93 additions and 80 deletions

View File

@ -1,35 +1,35 @@
require'nvim-tree'.setup {
renderer ={
require 'nvim-tree'.setup {
renderer = {
icons = {
padding = ' ',
symlink_arrow = ' >> ',
show = {
git=true,
folder=true,
file=true,
folder_arrow= false
git = true,
folder = true,
file = true,
folder_arrow = false
},
glyphs = {
default= "",
symlink= "",
git= {
unstaged= "",
staged= "",
unmerged= "",
renamed= "",
untracked= "",
deleted= "",
ignored= ""
default = "",
symlink = "",
git = {
unstaged = "",
staged = "",
unmerged = "",
renamed = "",
untracked = "",
deleted = "",
ignored = ""
},
folder= {
arrow_open= "",
arrow_closed= "",
default= "",
open= "",
empty= "",
empty_open= "",
symlink= "",
symlink_open= "",
folder = {
arrow_open = "",
arrow_closed = "",
default = "",
open = "",
empty = "",
empty_open = "",
symlink = "",
symlink_open = "",
}
},
},
@ -54,12 +54,11 @@ require'nvim-tree'.setup {
respect_buf_cwd = true,
disable_netrw = true,
hijack_netrw = true,
open_on_setup = false,
ignore_ft_on_setup = {},
open_on_tab = false,
hijack_cursor = true,
auto_reload_on_write = true,
update_cwd = false,
hijack_unnamed_buffer_when_opening = true,
diagnostics = {
enable = true,
icons = {
@ -82,10 +81,10 @@ require'nvim-tree'.setup {
dotfiles = false,
custom = {}
},
git={
git = {
ignore = false,
enable= true,
timeout=500,
enable = true,
timeout = 500,
},
actions = {
open_file = {
@ -93,7 +92,7 @@ require'nvim-tree'.setup {
window_picker = {
exclude = {
filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame" },
buftype = { "nofile","terminal","help" }
buftype = { "nofile", "terminal", "help" }
}
}
}
@ -108,3 +107,17 @@ require'nvim-tree'.setup {
}
}
}
local function open_nvim_tree(data)
local directory = vim.fn.isdirectory(data.file) == 1
if not directory then
return
end
vim.cmd.enew()
vim.cmd.bw(data.buf)
vim.cmd.cd(data.file)
require('nvim-tree.api').tree.open()
end
vim.api.nvim_create_autocmd({ 'VimEnter' }, { callback = open_nvim_tree })