mirror of
https://github.com/d0zingcat/dotfiles.git
synced 2026-05-13 23:16:44 +00:00
init
This commit is contained in:
72
nvim/lua/config/nvim-tree.lua
Normal file
72
nvim/lua/config/nvim-tree.lua
Normal file
@@ -0,0 +1,72 @@
|
||||
local g = vim.g
|
||||
local map = require('utils').map
|
||||
|
||||
g.nvim_tree_highlight_opened_files = 1
|
||||
g.nvim_tree_icons = {
|
||||
symlink = '',
|
||||
git = {
|
||||
untracked = '?',
|
||||
},
|
||||
folder = {
|
||||
arrow_open = '',
|
||||
arrow_closed = '',
|
||||
default = '',
|
||||
open = '',
|
||||
},
|
||||
}
|
||||
g.nvim_tree_show_icons = {
|
||||
git = 1,
|
||||
folders = 1,
|
||||
files = 1,
|
||||
folder_arrows = 1,
|
||||
}
|
||||
|
||||
local tree_cb = require('nvim-tree.config').nvim_tree_callback
|
||||
require('nvim-tree').setup({
|
||||
view = {
|
||||
width = 35,
|
||||
side = 'left',
|
||||
mappings = {
|
||||
list = {
|
||||
{ key = '<C-v>', cb = tree_cb('vsplit') },
|
||||
{ key = '<C-s>', cb = tree_cb('split') },
|
||||
{ key = 'v', cb = tree_cb('vsplit') },
|
||||
{ key = 's', cb = tree_cb('split') },
|
||||
{ key = '-', cb = '<Plug>(choosewin)' },
|
||||
{ key = '<C-t>', cb = ':ToggleTerm<cr>' },
|
||||
},
|
||||
},
|
||||
},
|
||||
diagnostics = {
|
||||
enable = true,
|
||||
icons = {
|
||||
error = '',
|
||||
warning = '',
|
||||
info = '',
|
||||
hint = '',
|
||||
},
|
||||
},
|
||||
update_to_buf_dir = {
|
||||
enable = true,
|
||||
auto_update = true,
|
||||
},
|
||||
update_focused_file = {
|
||||
enable = true,
|
||||
},
|
||||
filters = {
|
||||
custom = { '.git' }, -- ignore .git
|
||||
},
|
||||
auto_close = true,
|
||||
hijack_netrw = true,
|
||||
update_cwd = true,
|
||||
focus_tree = false,
|
||||
open_on_setup = true,
|
||||
})
|
||||
|
||||
map('n', '<leader>te', ':NvimTreeToggle<CR>')
|
||||
|
||||
vim.cmd([[
|
||||
augroup nvimtree
|
||||
autocmd VimEnter * lua require('nvim-tree').toggle(false, true)
|
||||
augroup END
|
||||
]])
|
||||
Reference in New Issue
Block a user