Nvim : Filetree cd by <Leader><Tab>.

This commit is contained in:
Dmitry Voronin 2024-02-22 18:45:26 +03:00
parent 5280231a07
commit c28bd075c9
2 changed files with 17 additions and 2 deletions

View file

@ -2,12 +2,27 @@
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
local function my_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)
-- Custom mappings.
vim.keymap.set('n', '<Leader><Tab>', api.tree.change_root_to_node, opts('Cd into'))
end
-- Set termguicolors to enable highlight groups.
vim.opt.termguicolors = true
-- Setup nvim-tree.
require("nvim-tree").setup({
sort_by = "case_sensitive",
on_attach = my_on_attach,
sort_by = "case_sensitive",
view = {
width = 30,
},

View file

@ -48,9 +48,9 @@ return require("packer").startup(function(use)
local treesitter = true
-- Plugin setup. Order is important.
require("plugin/Filetree")
require("plugin/Mason")
require("plugin/lsp/Init")
require("plugin/Filetree")
require("plugin/Bufferline")
require("plugin/Lualine")
require("plugin/Autoclose")