dotfiles/nvim/lua/nvimtree.lua

123 lines
2.8 KiB
Lua
Raw Normal View History

2023-02-01 21:48:43 +01:00
require 'nvim-tree'.setup {
renderer = {
icons = {
padding = ' ',
symlink_arrow = ' >> ',
show = {
git = true,
folder = true,
file = true,
folder_arrow = false
},
glyphs = {
default = "",
symlink = "",
git = {
unstaged = "",
staged = "",
unmerged = "",
renamed = "",
untracked = "",
deleted = "",
ignored = ""
},
folder = {
arrow_open = "",
arrow_closed = "",
default = "",
open = "",
empty = "",
empty_open = "",
symlink = "",
symlink_open = "",
}
},
},
add_trailing = true,
highlight_opened_files = "all",
root_folder_modifier = ':~',
special_files = {
'README.md',
'Makefile',
'MAKEFILE'
},
highlight_git = true,
indent_markers = {
enable = true,
icons = {
corner = "",
2022-08-23 16:02:27 +02:00
edge = "",
2022-05-24 08:56:38 +02:00
none = " ",
2023-02-01 21:48:43 +01:00
}
}
},
respect_buf_cwd = true,
disable_netrw = true,
hijack_netrw = true,
open_on_tab = false,
hijack_cursor = true,
auto_reload_on_write = true,
hijack_unnamed_buffer_when_opening = true,
diagnostics = {
2022-08-23 16:02:27 +02:00
enable = true,
2022-05-24 08:56:38 +02:00
icons = {
hint = "",
info = "",
warning = "",
error = "",
}
},
2023-02-01 21:48:43 +01:00
update_focused_file = {
2022-05-24 08:56:38 +02:00
enable = true,
update_cwd = true,
ignore_list = {}
},
2023-02-01 21:48:43 +01:00
system_open = {
2022-05-24 08:56:38 +02:00
cmd = nil,
args = {}
},
2023-02-01 21:48:43 +01:00
filters = {
2022-05-24 08:56:38 +02:00
dotfiles = false,
custom = {}
},
2023-02-01 21:48:43 +01:00
git = {
ignore = false,
enable = true,
timeout = 500,
},
actions = {
open_file = {
2023-04-11 13:34:09 +02:00
resize_window = true,
2023-02-01 21:48:43 +01:00
window_picker = {
exclude = {
filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame" },
buftype = { "nofile", "terminal", "help" }
}
}
}
},
view = {
2022-08-23 16:02:27 +02:00
width = 35,
2022-05-24 08:56:38 +02:00
hide_root_folder = false,
2023-06-01 12:59:57 +02:00
side = 'right',
2022-05-24 08:56:38 +02:00
mappings = {
custom_only = false,
list = {}
}
}
}
2023-02-01 21:48:43 +01:00
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 })