switch to nvim-tree.lua from nerdtree

This commit is contained in:
Jidbo 2022-01-24 00:49:38 +01:00 committed by saibotk
parent 21046a4554
commit e0611a8b3a
Signed by: saibotk
GPG key ID: 67585F0065E261D5
5 changed files with 83 additions and 22 deletions

View file

@ -12,3 +12,4 @@ vim.cmd("source " .. nvim_config_root .. "/pluginoptions.vim")
require('telescopeconfig')
require('autocompletion')
require('treesitterconfig')
require('filemanager')

76
nvim/lua/filemanager.lua Normal file
View file

@ -0,0 +1,76 @@
-- NVIM TREE setup
-- icons
vim.g.nvim_tree_icons = {
default = '',
symlink = '',
git = {
unstaged = "",
staged = "",
unmerged = "",
renamed = "",
untracked = "",
deleted = "",
},
folder = {
default = "",
open = "",
empty = "",
empty_open = "",
symlink = "",
symlink_open = "",
},
}
-- extra options
vim.g.nvim_tree_indent_markers=1
vim.g.nvim_tree_add_trailing=1
vim.g.nvim_tree_special_files= {
["README.md"] = true,
["readme.md"] = true,
Pipfile = true,
Makefile = true,
["package.json"] = true,
}
-- 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 ]]
-- setup
require'nvim-tree'.setup {
auto_close = true,
update_cwd = true,
update_to_buf_dir = {
enable = true,
auto_open = true,
},
system_open = {
cmd = "open"
},
filters = {
dotfiles = true
},
git = {
enable = true,
ignore = true,
timeout = 500,
},
view = {
mappings = {
custom_only = false,
list = {}
},
},
trash = {
cmd = "trash"
}
}

View file

@ -35,8 +35,8 @@ map {'i', '[,', '[<CR>],<C-c>O'}
-- toggle hybrid mode
map {'n', '<leader>h', ':set rnu!<CR>'}
-- nerdtree
map {'n', '<leader>e', ':NERDTreeToggle<CR>'}
-- nvim-tree.lua
map {'n', '<leader>e', ':NvimTreeToggle<CR>'}
-- Telescope
map {'n', '<C-y>', '<cmd>Telescope buffers<CR>'}

View file

@ -28,13 +28,11 @@ Plug 'junegunn/goyo.vim'
-- FILE MANAGEMENT
-- ===================
-- nerd-tree
Plug 'preservim/nerdtree'
-- nvim-tree.lua
Plug 'kyazdani42/nvim-web-devicons'
Plug 'kyazdani42/nvim-tree.lua'
-- Icons
Plug 'ryanoasis/vim-devicons'
-- fzf plugin
-- telescope plugin
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim'

View file

@ -1,19 +1,5 @@
" PLUGIN OPTIONS
" NERD TREE SETUP
" =========================
let NERDTreeIgnore=['\.pyc$', '\~$', '__pycache__'] "ignore files in NERDTree
let NERDTreeChDirMode=2
highlight Directory guifg=#D1D5DB ctermfg=blue
highlight NERDTreeHelp guifg=#4B5563 ctermfg=gray
highlight NERDTreeCWD guifg=#9CA3AF ctermfg=gray
highlight NERDTreeFlags guifg=#4B5563 ctermfg=green
highlight NERDTreeExecFile guifg=#DC2626 ctermfg=green
" Exit Vim if NERDTree is the only window remaining in the only tab.
autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif
" AIRLINE SETUP
" =========================