feat: add keybinds to neotree
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
|
"99": { "branch": "master", "commit": "0172d3caae2d8b967c9d47aa7557295f1481e5df" },
|
||||||
"FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" },
|
"FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" },
|
||||||
"LuaSnip": { "branch": "master", "commit": "dae4f5aaa3574bd0c2b9dd20fb9542a02c10471c" },
|
"LuaSnip": { "branch": "master", "commit": "dae4f5aaa3574bd0c2b9dd20fb9542a02c10471c" },
|
||||||
"SchemaStore.nvim": { "branch": "main", "commit": "55ca969ceed5209d62cbf4c20cef023ff188b6c5" },
|
"SchemaStore.nvim": { "branch": "main", "commit": "55ca969ceed5209d62cbf4c20cef023ff188b6c5" },
|
||||||
|
|||||||
@@ -190,6 +190,11 @@ return {
|
|||||||
vim.lsp.config("gopls", {
|
vim.lsp.config("gopls", {
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
filetypes = { "go", "gomod", "gowork", "gotmpl", "gohtml" },
|
filetypes = { "go", "gomod", "gowork", "gotmpl", "gohtml" },
|
||||||
|
settings = {
|
||||||
|
gopls = {
|
||||||
|
buildFlags = { "-tags=integration" }
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.lsp.enable("gopls")
|
vim.lsp.enable("gopls")
|
||||||
|
|||||||
+45
-19
@@ -1,29 +1,55 @@
|
|||||||
return {
|
return {
|
||||||
"nvim-neo-tree/neo-tree.nvim",
|
"nvim-neo-tree/neo-tree.nvim",
|
||||||
branch = "v3.x",
|
branch = "v3.x",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"nvim-lua/plenary.nvim",
|
"nvim-lua/plenary.nvim",
|
||||||
"nvim-tree/nvim-web-devicons",
|
"nvim-tree/nvim-web-devicons",
|
||||||
"MunifTanjim/nui.nvim",
|
"MunifTanjim/nui.nvim",
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
require("neo-tree").setup({
|
require("neo-tree").setup({
|
||||||
filesystem = {
|
filesystem = {
|
||||||
use_libuv_file_watcher = true,
|
use_libuv_file_watcher = true,
|
||||||
filtered_items = {
|
filtered_items = {
|
||||||
visible = true,
|
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_handlers = {
|
||||||
{
|
{
|
||||||
event = "file_open_requested",
|
event = "file_open_requested",
|
||||||
handler = function()
|
handler = function()
|
||||||
vim.cmd("Neotree close")
|
vim.cmd("Neotree close")
|
||||||
end
|
end,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
}
|
|
||||||
})
|
})
|
||||||
vim.keymap.set("n", "<C-b>", ":Neotree filesystem reveal right<CR>", { desc = "Neotree show explorer" })
|
vim.keymap.set("n", "<C-b>", ":Neotree filesystem reveal right<CR>", { desc = "Neotree show explorer" })
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user