-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtree.nix
49 lines (43 loc) · 1.3 KB
/
tree.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{ pkgs, ... }: {
binaries = [];
lazy = with pkgs.vimPlugins;
# lua
''
{
dir = "${nvim-tree-lua}",
name = "nvim-tree",
config = function ()
-- disable netrw at the very start of your init.lua
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
-- set colors
vim.opt.termguicolors = true
local function on_attach(bufnr)
local api = require "nvim-tree.api"
local function opts(desc)
return {
desc = "nvim-tree: " .. desc,
buffer = bufnr,
noremap = true,
silent = true,
nowait = true,
}
end
-- default mappings
api.config.mappings.default_on_attach(bufnr)
vim.keymap.set("n", "?", api.tree.toggle_help, opts("Help"))
-- collides with closing vim keybind
vim.keymap.set("n", "<C-e>", "<cmd>:q<cr>", opts("Quit"))
end
require('nvim-tree').setup {
on_attach = on_attach,
sync_root_with_cwd = true,
git = {
ignore = true,
},
}
vim.keymap.set('n', '<leader>a', '<cmd>:NvimTreeToggle<cr>', opts)
end
},
'';
}