From 2228aaea4acd6248ea289e86bf9233dc482760d2 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Tue, 19 Oct 2021 10:11:59 +0300 Subject: nvim: remove fern, use nvim-tree --- .config/nvim/lua/mappings.lua | 5 +++ .config/nvim/lua/plugin_settings.lua | 68 ++++++++++++++++++++++++++++++++++++ .config/nvim/lua/plugins.lua | 5 +-- .config/nvim/lua/settings.lua | 2 ++ 4 files changed, 76 insertions(+), 4 deletions(-) diff --git a/.config/nvim/lua/mappings.lua b/.config/nvim/lua/mappings.lua index 6c17177..234f051 100644 --- a/.config/nvim/lua/mappings.lua +++ b/.config/nvim/lua/mappings.lua @@ -167,4 +167,9 @@ map('n', 'cn', ':DashboardNewFile') -- toggle rose pine theme map('n', 'cz', [[lua require('rose-pine.functions').toggle_variant({'dawn', 'base'})]], { noremap = true, silent = true }) + +map('n', 'vt', ':NvimTreeToggle') +map('n', 'vr', ':NvimTreeRefresh') +map('n', 'vs', ':NvimTreeFindFile') + -- }}} plug mappings -- diff --git a/.config/nvim/lua/plugin_settings.lua b/.config/nvim/lua/plugin_settings.lua index 2dfbaeb..0ca647a 100644 --- a/.config/nvim/lua/plugin_settings.lua +++ b/.config/nvim/lua/plugin_settings.lua @@ -392,3 +392,71 @@ npairs.add_rule(Rule('%"','%"',"remind")) -- }}} nvim-autopairs -- + +-- nvim-tree {{{ -- + +require'nvim-tree'.setup { + disable_netrw = true, + hijack_netrw = true, + open_on_setup = false, + ignore_ft_on_setup = {}, + -- closes neovim automatically when the tree is the last **WINDOW** in the view + auto_close = true, + open_on_tab = false, + -- hijacks new directory buffers when they are opened. + update_to_buf_dir = { + -- enable the feature + enable = true, + -- allow to open the tree if it was previously closed + auto_open = true, + }, + -- hijack the cursor in the tree to put it at the start of the filename + hijack_cursor = false, + -- updates the root directory of the tree on `DirChanged` (when your run `:cd` usually) + update_cwd = true, + -- show lsp diagnostics in the signcolumn + diagnostics = { + enable = false, + icons = { + hint = "❔", + info = "❕", + warning = "❗", + error = "❌", + } + }, + -- update the focused file on `BufEnter`, un-collapses the folders recursively until it finds the file + update_focused_file = { + -- enables the feature + enable = false, + -- update the root directory of the tree to the one of the folder containing the file if the file is not under the current root directory + update_cwd = false, + -- list of buffer names / filetypes that will not update the cwd if the file isn't found under the current root directory + ignore_list = {} + }, + -- configuration options for the system open command (`s` in the tree by default) + system_open = { + -- the command to run this, leaving nil should work in most cases + cmd = nil, + -- the command arguments as a list + args = {} + }, + + view = { + -- width of the window, can be either a number (columns) or a string in `%`, for left or right side placement + width = 30, + -- height of the window, can be either a number (columns) or a string in `%`, for top or bottom side placement + height = 30, + -- side of the tree, can be one of 'left' | 'right' | 'top' | 'bottom' + side = 'left', + -- if true the tree will resize itself after opening a file + auto_resize = false, + mappings = { + -- custom only false will merge the list with the default mappings + -- if true, it will only use your list to set the mappings + custom_only = false, + -- list of mappings to set on the tree manually + list = {} + } + } +} +-- }}} nvim-tree -- diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua index 055aa2d..d8ef949 100644 --- a/.config/nvim/lua/plugins.lua +++ b/.config/nvim/lua/plugins.lua @@ -63,10 +63,7 @@ return require('packer').startup(function() use 'ledger/vim-ledger' -- file explorer - use 'lambdalisue/fern.vim' - -- bug in neovim, so required for now - -- https://github.com/lambdalisue/fern.vim/issues/120 - use 'antoinemadec/FixCursorHold.nvim' + use 'kyazdani42/nvim-tree.lua' -- viewer & finder for lsp symbols and tags use 'liuchengxu/vista.vim' diff --git a/.config/nvim/lua/settings.lua b/.config/nvim/lua/settings.lua index fbc28ac..34e68b2 100644 --- a/.config/nvim/lua/settings.lua +++ b/.config/nvim/lua/settings.lua @@ -12,6 +12,8 @@ local opt = vim.opt -- convenient :set -- look & feel o.termguicolors = true +-- Disable italics +vim.g.rose_pine_disable_italics = true vim.cmd('colorscheme rose-pine') -- interact with system clipboard -- cgit v1.2.3-70-g09d2