From a22350c4f702ad8c9dd92fdb0a1d82789a8ad1aa Mon Sep 17 00:00:00 2001 From: Jidbo Date: Wed, 1 Nov 2023 19:38:39 +0100 Subject: [PATCH] update nvimtree options --- nvim/lua/filemanager.lua | 93 +++++++++++++++++++--------------------- 1 file changed, 43 insertions(+), 50 deletions(-) diff --git a/nvim/lua/filemanager.lua b/nvim/lua/filemanager.lua index 0804eec..6da8f70 100644 --- a/nvim/lua/filemanager.lua +++ b/nvim/lua/filemanager.lua @@ -1,60 +1,53 @@ -- 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 ]] -vim.cmd [[hi NvimTreeFolderName guifg=#D1D5DB ]] -vim.cmd [[hi NvimTreeOpenedFolderName guifg=#D1D5DB ]] -vim.cmd [[hi NvimTreeEmptyFolderName guifg=#D1D5DB ]] +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 ]]) +vim.cmd([[hi NvimTreeFolderName guifg=#D1D5DB ]]) +vim.cmd([[hi NvimTreeOpenedFolderName guifg=#D1D5DB ]]) +vim.cmd([[hi NvimTreeEmptyFolderName guifg=#D1D5DB ]]) -- setup -local nvimtree = require'nvim-tree' +local nvimtree = require("nvim-tree") -nvimtree.setup { - update_cwd = true, - renderer = { - add_trailing = false, - special_files = {"README.md", "readme.md", "Pipfile", "Makefile", "package.json"}, - indent_markers = { - enable = true, - }, - }, - hijack_directories = { - enable = true, - auto_open = true, - }, - system_open = { - cmd = 'open' - }, - filters = { - dotfiles = true - }, - git = { - enable = true, - ignore = false, - timeout = 500, - }, - view = { - mappings = { - custom_only = false, - list = {} - }, - }, - trash = { - cmd = 'trash' - } -} +nvimtree.setup({ + update_cwd = true, + renderer = { + add_trailing = false, + special_files = { "README.md", "readme.md", "Pipfile", "Makefile", "package.json" }, + indent_markers = { + enable = true, + }, + }, + hijack_directories = { + enable = true, + auto_open = true, + }, + system_open = { + cmd = "open", + }, + filters = { + dotfiles = true, + }, + git = { + enable = true, + ignore = false, + timeout = 500, + }, + trash = { + cmd = "trash", + }, +}) vim.cmd("autocmd BufEnter * ++nested if winnr('$') == 1 && bufname() == 'NvimTree_' . tabpagenr() | quit | endif") -- KEYMAPS -local api = require("nvim-tree.api") -vim.keymap.set('n', 'e', api.tree.toggle) +vim.keymap.set("n", "e", "NvimTreeToggle")