mirror of
https://github.com/aminnairi/dotfiles.git
synced 2026-09-14 15:42:14 +02:00
using local variable instead of calling the require on each keybind for
nvim tree
This commit is contained in:
@@ -8,6 +8,8 @@ return {
|
|||||||
vim.g.loaded_netrwPlugin = 1
|
vim.g.loaded_netrwPlugin = 1
|
||||||
vim.opt.termguicolors = true
|
vim.opt.termguicolors = true
|
||||||
|
|
||||||
|
local nvimTreeApi = require("nvim-tree.api")
|
||||||
|
|
||||||
require("nvim-tree").setup({
|
require("nvim-tree").setup({
|
||||||
auto_reload_on_write = true,
|
auto_reload_on_write = true,
|
||||||
sort_by = "case_sensitive",
|
sort_by = "case_sensitive",
|
||||||
@@ -30,25 +32,25 @@ return {
|
|||||||
name = "NvimTree",
|
name = "NvimTree",
|
||||||
t = {
|
t = {
|
||||||
function()
|
function()
|
||||||
require("nvim-tree.api").tree.toggle()
|
nvimTreeApi.tree.toggle()
|
||||||
end,
|
end,
|
||||||
"Toggle NvimTree",
|
"Toggle NvimTree",
|
||||||
},
|
},
|
||||||
f = {
|
f = {
|
||||||
function()
|
function()
|
||||||
require("nvim-tree.api").tree.focus()
|
nvimTreeApi.tree.focus()
|
||||||
end,
|
end,
|
||||||
"Focus NvimTree",
|
"Focus NvimTree",
|
||||||
},
|
},
|
||||||
e = {
|
e = {
|
||||||
function()
|
function()
|
||||||
require("nvim-tree.api").tree.expand_all()
|
nvimTreeApi.tree.expand_all()
|
||||||
end,
|
end,
|
||||||
"Expand NvimTree",
|
"Expand NvimTree",
|
||||||
},
|
},
|
||||||
c = {
|
c = {
|
||||||
function()
|
function()
|
||||||
require("nvim-tree.api").tree.collapse_all()
|
nvimTreeApi.tree.collapse_all()
|
||||||
end,
|
end,
|
||||||
"Collapse NvimTree",
|
"Collapse NvimTree",
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user