From f156292e8fa3fcc447bb3648d9d8872f99f91731 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 22 Mar 2023 15:58:18 +0100 Subject: [PATCH] nvim: Add file tree In addition to my standard file manager, vifm, being integrated into neovim, I have now also added a side-pane file tree (akin to nerdtree) that is easily reachable to get a quick overview of a file layout. For now, I do not intend to do much more with the plugin, only keep it for those rare cases I want to have a view on my file layout at the same time as working in a buffer. For all other things (file operations especially) I still have vifm. --- nvim/.config/nvim/lazy-lock.json | 2 ++ nvim/.config/nvim/lua/maps.lua | 4 ++++ nvim/.config/nvim/lua/plugins.lua | 16 +++++++++++----- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index 423307a..341c8c7 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -49,11 +49,13 @@ "nvim-notify": { "branch": "master", "commit": "bdd647f61a05c9b8a57c83b78341a0690e9c29d7" }, "nvim-surround": { "branch": "main", "commit": "b98862527c4727c171f8626e04d8ae88ef6cb736" }, "nvim-toggleterm.lua": { "branch": "main", "commit": "a5638b2206c3930a16a24e5c184dddd572f8cd34" }, + "nvim-tree.lua": { "branch": "master", "commit": "aa9971768a08caa4f10f94ab84e48d2ceb30b1c0" }, "nvim-treesitter": { "branch": "master", "commit": "c38646edf2bdfac157ca619697ecad9ea87fd469" }, "nvim-treesitter-context": { "branch": "master", "commit": "88d1627285f7477883516ef60521601862dae7a1" }, "nvim-treesitter-textsubjects": { "branch": "master", "commit": "b913508f503527ff540f7fe2dcf1bf1d1f259887" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "729d83ecb990dc2b30272833c213cc6d49ed5214" }, "nvim-ts-rainbow2": { "branch": "master", "commit": "cee4601ff8aac73dee4afa1074814343bb5a0b80" }, + "nvim-web-devicons": { "branch": "master", "commit": "95b1e300699be8eb6b5be1758a9d4d69fe93cc7f" }, "otter.nvim": { "branch": "main", "commit": "cfb548957aed403d9838febd7223595d47b32031" }, "playground": { "branch": "master", "commit": "4044b53c4d4fcd7a78eae20b8627f78ce7dc6f56" }, "plenary.nvim": { "branch": "master", "commit": "253d34830709d690f013daf2853a9d21ad7accab" }, diff --git a/nvim/.config/nvim/lua/maps.lua b/nvim/.config/nvim/lua/maps.lua index 30ca8ff..513ae9e 100644 --- a/nvim/.config/nvim/lua/maps.lua +++ b/nvim/.config/nvim/lua/maps.lua @@ -211,6 +211,10 @@ map('n', 'ss', ":lua MiniStarter.open()", { desc = 'show startpage' map('n', 'so', 'SymbolsOutline', { silent = true, desc = 'toggle symbol outline' }) +-- PLUGIN: nvim-tree +map('n', 'se', 'NvimTreeToggle', + { silent = true, desc = 'toggle filetree' }) + -- PLUGIN: easy-align -- Start interactive EasyAlign in visual mode (e.g. vipga) map('x', 'ga', '(EasyAlign)') diff --git a/nvim/.config/nvim/lua/plugins.lua b/nvim/.config/nvim/lua/plugins.lua index d833ab9..596b5cb 100644 --- a/nvim/.config/nvim/lua/plugins.lua +++ b/nvim/.config/nvim/lua/plugins.lua @@ -1,18 +1,24 @@ local writing_ft = { "quarto", "pandoc", "markdown", "text", "tex" } return { - -- vim plugs -- essential { 'numToStr/Navigator.nvim', branch = "master", config = true }, -- allow seamless navigation between vim buffers and tmux/wezterm splits { 'jeffkreeftmeijer/vim-numbertoggle', event = "BufEnter" }, -- toggles numbers to absolute for all buffers but the current which is relative { 'ojroques/vim-oscyank', event = "VeryLazy" }, -- yank from *anywhere* (even ssh session) to clipboard, using :OSCYank { 'ggandor/lightspeed.nvim', event = "VeryLazy" }, -- jump between letters with improved fFtT quicksearch, mimics sneak - -- files - { 'vifm/vifm.vim' }, -- integrate file manager { 'lewis6991/gitsigns.nvim', -- show vcs changes on left-hand gutter opts = { numhl = true, signcolumn = false }, event = "BufRead" + }, + -- files + { 'vifm/vifm.vim' }, -- integrate file manager + { + 'nvim-tree/nvim-tree.lua', -- integrate file tree + config = true, + dependencies = { 'nvim-tree/nvim-web-devicons', config = true }, + cmd = "NvimTreeToggle" + }, }, { 'RRethy/nvim-base16', event = "BufWinEnter", @@ -66,7 +72,7 @@ return { }, { 'edKotinsky/Arduino.nvim', ft = 'arduino', config = true }, -- statusline { 'nvim-lualine/lualine.nvim', - requires = { 'kyazdani42/nvim-web-devicons', opt = true }, + requires = { 'nvim-tree/nvim-web-devicons', config = true }, config = function() require('plug._lualine') end }, -- writing { 'vim-pandoc/vim-criticmarkup', ft = writing_ft }, { @@ -136,7 +142,7 @@ return { vim.g.magma_image_provider = "kitty" vim.g.magma_automatically_open_output = false end - }, -- nvim plugs + }, { 'echasnovski/mini.nvim', version = '*',