feat: add keybinds to neotree

This commit is contained in:
Stevan Freeborn
2026-04-11 14:47:56 -05:00
parent 56a59cd8a8
commit fec0810584
3 changed files with 51 additions and 19 deletions
+1
View File
@@ -1,4 +1,5 @@
{
"99": { "branch": "master", "commit": "0172d3caae2d8b967c9d47aa7557295f1481e5df" },
"FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" },
"LuaSnip": { "branch": "master", "commit": "dae4f5aaa3574bd0c2b9dd20fb9542a02c10471c" },
"SchemaStore.nvim": { "branch": "main", "commit": "55ca969ceed5209d62cbf4c20cef023ff188b6c5" },
+5
View File
@@ -190,6 +190,11 @@ return {
vim.lsp.config("gopls", {
capabilities = capabilities,
filetypes = { "go", "gomod", "gowork", "gotmpl", "gohtml" },
settings = {
gopls = {
buildFlags = { "-tags=integration" }
}
}
})
vim.lsp.enable("gopls")
+30 -4
View File
@@ -12,17 +12,43 @@ return {
use_libuv_file_watcher = true,
filtered_items = {
visible = true,
}
},
},
window = {
mappings = {
["Y"] = {
function(state)
local node = state.tree:get_node()
local path = node:get_id()
vim.fn.setreg("+", path, "c")
vim.notify("Copied: " .. path .. " to clipboard")
end,
desc = "Copy path to clipboard",
},
["O"] = {
function(state)
local node = state.tree:get_node()
vim.notify("Opening: " .. node.path)
local _, err = vim.ui.open(node.path)
if err then
vim.notify("Error opening explorer: " .. err, vim.log.levels.ERROR)
end
end,
desc = "Open in default app",
},
["P"] = { "toggle_preview", config = { use_float = false } },
},
},
event_handlers = {
{
event = "file_open_requested",
handler = function()
vim.cmd("Neotree close")
end
end,
},
},
}
})
vim.keymap.set("n", "<C-b>", ":Neotree filesystem reveal right<CR>", { desc = "Neotree show explorer" })
end,