.dotfiles/nvim/lua/filemanager.lua

61 lines
1.5 KiB
Lua
Raw Normal View History

2022-01-24 00:49:38 +01:00
-- NVIM TREE setup
-- colors
vim.cmd [[hi Directory guifg=#D1D5DB ctermfg=blue]]
vim.cmd [[hi NvimTreeFolderIcon guifg=#4B5563]]
vim.cmd [[hi NvimTreeRootFolder guifg=#9CA3AF]]
vim.cmd [[hi NvimTreeIndentMarker guifg=#9CA3AF]]
vim.cmd [[hi NvimTreeExecFile guifg=#DC2626]]
vim.cmd [[hi NvimTreeGitDirty guifg=#FB923C]]
vim.cmd [[hi NvimTreeGitStaged guifg=#DC2626]]
vim.cmd [[hi NvimTreeGitNew guifg=#DC2626]]
vim.cmd [[hi NvimTreeGitDeleted guifg=#DC2626]]
vim.cmd [[hi NvimTreeSpecialFile guifg=#F8FAFC ]]
2022-01-24 18:56:10 +01:00
vim.cmd [[hi NvimTreeFolderName guifg=#D1D5DB ]]
vim.cmd [[hi NvimTreeOpenedFolderName guifg=#D1D5DB ]]
vim.cmd [[hi NvimTreeEmptyFolderName guifg=#D1D5DB ]]
2022-01-24 00:49:38 +01:00
-- setup
local nvimtree = require'nvim-tree'
nvimtree.setup {
update_cwd = true,
renderer = {
2023-06-16 01:48:21 +02:00
add_trailing = false,
special_files = {"README.md", "readme.md", "Pipfile", "Makefile", "package.json"},
indent_markers = {
enable = true,
},
},
2023-06-16 01:48:21 +02:00
hijack_directories = {
enable = true,
auto_open = true,
2022-01-24 00:49:38 +01:00
},
system_open = {
cmd = 'open'
2022-01-24 00:49:38 +01:00
},
filters = {
dotfiles = true
},
git = {
enable = true,
2022-01-24 18:56:10 +01:00
ignore = false,
2022-01-24 00:49:38 +01:00
timeout = 500,
},
view = {
mappings = {
custom_only = false,
list = {}
},
},
trash = {
cmd = 'trash'
2022-01-24 00:49:38 +01:00
}
}
2022-04-13 21:45:29 +02:00
vim.cmd("autocmd BufEnter * ++nested if winnr('$') == 1 && bufname() == 'NvimTree_' . tabpagenr() | quit | endif")
-- KEYMAPS
2023-06-16 02:07:11 +02:00
local api = require("nvim-tree.api")
vim.keymap.set('n', '<leader>e', api.tree.toggle)