tree.lua - dotfiles - 🍚 personal arsenal of "rice"
HTML git clone https://git.drkhsh.at/dotfiles.git
DIR Log
DIR Files
DIR Refs
DIR Submodules
DIR README
DIR LICENSE
---
tree.lua (811B)
---
1 return {
2 "nvim-tree/nvim-tree.lua",
3 version = "*",
4 lazy = false,
5 dependencies = {
6 "nvim-tree/nvim-web-devicons",
7 },
8 config = function()
9 local function my_on_attach(bufnr)
10 local api = require "nvim-tree.api"
11
12 local function opts(desc)
13 return { desc = "nvim-tree: " .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true }
14 end
15
16 -- default mappings
17 api.config.mappings.default_on_attach(bufnr)
18
19 -- custom mappings
20 vim.keymap.set('n', '<C-t>', api.tree.change_root_to_parent, opts('Up'))
21 vim.keymap.set('n', '?', api.tree.toggle_help, opts('Help'))
22 end
23 require("nvim-tree").setup {
24 filters = {
25 dotfiles = true,
26 },
27 on_attach = my_on_attach,
28 }
29 local api = require "nvim-tree.api"
30 vim.keymap.set("n", "<leader>tt", api.tree.toggle)
31 end,
32 }