|
local function setup_vim_commands() |
|
vim.api.nvim_create_user_command("NvimTreeOpen", function(res) |
|
require("nvim-tree.api").tree.open { path = res.args } |
|
end, { nargs = "?", complete = "dir" }) |
|
vim.api.nvim_create_user_command("NvimTreeClose", function() |
|
require("nvim-tree.api").tree.close() |
|
end, { bar = true }) |
|
vim.api.nvim_create_user_command("NvimTreeToggle", function(res) |
|
require("nvim-tree.api").tree.toggle { find_file = false, focus = true, path = res.args, update_root = false } |
|
end, { nargs = "?", complete = "dir" }) |
|
vim.api.nvim_create_user_command("NvimTreeFocus", function() |
|
require("nvim-tree.api").tree.focus() |
|
end, { bar = true }) |
|
vim.api.nvim_create_user_command("NvimTreeRefresh", function() |
|
require("nvim-tree.api").tree.reload() |
|
end, { bar = true }) |
|
vim.api.nvim_create_user_command("NvimTreeClipboard", function() |
|
require("nvim-tree.api").fs.print_clipboard() |
|
end, { bar = true }) |
|
vim.api.nvim_create_user_command("NvimTreeFindFile", function(res) |
|
require("nvim-tree.api").tree.find_file { open = true, update_root = res.bang } |
|
end, { bang = true, bar = true }) |
|
vim.api.nvim_create_user_command("NvimTreeFindFileToggle", function(res) |
|
require("nvim-tree.api").tree.toggle { find_file = true, focus = true, path = res.args, update_root = res.bang } |
|
end, { bang = true, nargs = "?", complete = "dir" }) |
|
vim.api.nvim_create_user_command("NvimTreeResize", function(res) |
|
M.resize(res.args) |
|
end, { nargs = 1, bar = true }) |
|
vim.api.nvim_create_user_command("NvimTreeCollapse", function() |
|
require("nvim-tree.api").tree.collapse_all(false) |
|
end, { bar = true }) |
|
vim.api.nvim_create_user_command("NvimTreeCollapseKeepBuffers", function() |
|
require("nvim-tree.api").tree.collapse_all(true) |
|
end, { bar = true }) |
|
vim.api.nvim_create_user_command("NvimTreeGenerateOnAttach", keymap_legacy.cmd_generate_on_attach, {}) |
|
end |
Is your feature request related to a problem? Please describe.
Trying to build a good
legendary.nvimextension fornvim-tree.luaDescribe the solution you'd like
You create the commands here:
nvim-tree.lua/lua/nvim-tree.lua
Lines 245 to 280 in aa99717
The
vim.api.nvim_create_user_commandfunction accepts adescfield to provide a description that will be shown if you look up the commands via the Neovim API.Describe alternatives you've considered
Hard-coding the descriptions.
Additional context
mrjones2014/legendary.nvim#320