diff --git a/nvim/init.lua b/nvim/init.lua index 198fafa..b93aa15 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -12,3 +12,4 @@ vim.cmd("source " .. nvim_config_root .. "/pluginoptions.vim") require('telescopeconfig') require('autocompletion') require('treesitterconfig') +require('filemanager') diff --git a/nvim/lua/filemanager.lua b/nvim/lua/filemanager.lua new file mode 100644 index 0000000..f1190c0 --- /dev/null +++ b/nvim/lua/filemanager.lua @@ -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" + } +} diff --git a/nvim/lua/mappings.lua b/nvim/lua/mappings.lua index 1436408..d6a7f66 100644 --- a/nvim/lua/mappings.lua +++ b/nvim/lua/mappings.lua @@ -35,8 +35,8 @@ map {'i', '[,', '[],O'} -- toggle hybrid mode map {'n', 'h', ':set rnu!'} --- nerdtree -map {'n', 'e', ':NERDTreeToggle'} +-- nvim-tree.lua +map {'n', 'e', ':NvimTreeToggle'} -- Telescope map {'n', '', 'Telescope buffers'} diff --git a/nvim/lua/plugins.lua b/nvim/lua/plugins.lua index 3a21458..b209d39 100644 --- a/nvim/lua/plugins.lua +++ b/nvim/lua/plugins.lua @@ -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' diff --git a/nvim/pluginoptions.vim b/nvim/pluginoptions.vim index 535e323..430f101 100644 --- a/nvim/pluginoptions.vim +++ b/nvim/pluginoptions.vim @@ -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 " =========================