Skip to content

Commit

Permalink
fix(plugins): resize of nvim-tree works with "File Explorer" title
Browse files Browse the repository at this point in the history
  • Loading branch information
ecosse3 committed Apr 28, 2023
1 parent 6b53c18 commit 94c4fed
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lua/config/autocmds.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@ vim.api.nvim_create_autocmd("BufEnter", { pattern = { "*test.js", "*test.ts", "*
callback = function() pwk.attach_jest(0) end })
vim.api.nvim_create_autocmd("FileType", { pattern = "spectre_panel",
callback = function() pwk.attach_spectre(0) end })
vim.api.nvim_create_autocmd("FileType", { pattern = "NvimTree",
callback = function() pwk.attach_nvim_tree(0) end })
15 changes: 15 additions & 0 deletions lua/plugins/which-key.lua
Original file line number Diff line number Diff line change
Expand Up @@ -386,11 +386,26 @@ local function attach_spectre(bufnr)
})
end

local function attach_nvim_tree(bufnr)
wk.register({
["="] = { "<cmd>NvimTreeResize +5<CR>", "resize +5" },
["-"] = { "<cmd>NvimTreeResize -5<CR>", "resize +5" },
}, {
buffer = bufnr,
mode = "n", -- NORMAL mode
prefix = "<leader>",
silent = true, -- use `silent` when creating keymaps
noremap = true, -- use `noremap` when creating keymaps
nowait = false, -- use `nowait` when creating keymaps
})
end

return {
attach_markdown = attach_markdown,
attach_typescript = attach_typescript,
attach_npm = attach_npm,
attach_zen = attach_zen,
attach_jest = attach_jest,
attach_spectre = attach_spectre,
attach_nvim_tree = attach_nvim_tree,
}

0 comments on commit 94c4fed

Please sign in to comment.