From 8c0d7a32fcdfc80c410f4b4e9ec9e509bf83a991 Mon Sep 17 00:00:00 2001 From: Quentin Boyer Date: Tue, 14 Dec 2021 21:33:45 +0100 Subject: [PATCH] add nvim-tree --- flake.lock | 17 +++++++++++++++++ flake.nix | 8 ++++++++ nvim/init.lua | 9 ++++++++- plugins.py | 1 + 4 files changed, 34 insertions(+), 1 deletion(-) diff --git a/flake.lock b/flake.lock index 1e20adc..2a3f3c5 100644 --- a/flake.lock +++ b/flake.lock @@ -600,6 +600,22 @@ "type": "github" } }, + "nvim-tree.lua": { + "flake": false, + "locked": { + "lastModified": 1639338723, + "narHash": "sha256-B3YzoO2DxirRMWir0jNJuKkOhErMn6bLkXdqpvYdKwA=", + "owner": "kyazdani42", + "repo": "nvim-tree.lua", + "rev": "f408781a463c2edc3a49091b1bca5a18f790ee3d", + "type": "github" + }, + "original": { + "owner": "kyazdani42", + "repo": "nvim-tree.lua", + "type": "github" + } + }, "nvim-treesitter": { "flake": false, "locked": { @@ -745,6 +761,7 @@ "nvim-cmp": "nvim-cmp", "nvim-lightbulb": "nvim-lightbulb", "nvim-lspconfig": "nvim-lspconfig", + "nvim-tree.lua": "nvim-tree.lua", "nvim-treesitter": "nvim-treesitter", "nvim-web-devicons": "nvim-web-devicons", "plantuml-syntax": "plantuml-syntax", diff --git a/flake.nix b/flake.nix index 97178e8..d8d2a3b 100644 --- a/flake.nix +++ b/flake.nix @@ -164,6 +164,10 @@ url = "github:tweekmonster/startuptime.vim"; flake = false; }; + "nvim-tree.lua" = { + url = "github:kyazdani42/nvim-tree.lua"; + flake = false; + }; }; outputs = { home-manager, nixpkgs, ... }@inputs: { @@ -321,6 +325,10 @@ name = "startuptime.vim"; path = inputs."startuptime.vim"; } + { + name = "nvim-tree.lua"; + path = inputs."nvim-tree.lua"; + } ]; }; # Optionally, use home-manager.extraSpecialArgs to pass diff --git a/nvim/init.lua b/nvim/init.lua index eb2855c..42b5bb2 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -6,7 +6,13 @@ require("lsp") require("completion") require("statusline") -require('gitsigns').setup() +require("gitsigns").setup() +require("nvim-tree").setup({ + auto_close = true, + diagnostics = { + enable = true, + }, +}) vim.o.number = true vim.o.tabstop = 4 @@ -55,6 +61,7 @@ vim.api.nvim_set_keymap("n", "gr", "Telescope lsp_references", { norema vim.api.nvim_set_keymap("n", "gW", "Telescope lsp_workspace_symbols", { noremap = true, silent = true }) vim.api.nvim_set_keymap("n", "gF", "Telescope lsp_document_symbols", { noremap = true, silent = true }) vim.api.nvim_set_keymap("n", "ft", "Telescope file_browser", { noremap = true, silent = true }) +vim.api.nvim_set_keymap("n", "fT", "NvimTreeToggle", { noremap = true, silent = true }) vim.api.nvim_set_keymap("n", "ge", "Telescope diagnostics bufnr=0", { noremap = true, silent = true }) vim.api.nvim_set_keymap("n", "gE", "Telescope diagnostics", { noremap = true, silent = true }) vim.api.nvim_set_keymap("n", "mn", "Telescope man_pages sections=1,3,5", { noremap = true, silent = true }) diff --git a/plugins.py b/plugins.py index 7b95f61..e432e39 100644 --- a/plugins.py +++ b/plugins.py @@ -31,6 +31,7 @@ plugins = [ "jose-elias-alvarez/null-ls.nvim", "nathom/filetype.nvim", "tweekmonster/startuptime.vim", + "kyazdani42/nvim-tree.lua", ] inputs = ""