aboutsummaryrefslogtreecommitdiffstats
path: root/lua/alpha
diff options
context:
space:
mode:
authorAriel D'Alessandro <dalessandro.ariel@gmail.com>2023-04-04 00:15:10 +0200
committerAriel D'Alessandro <dalessandro.ariel@gmail.com>2023-04-04 00:15:10 +0200
commitcf9605f7a01ef90050df2f5aafa3b89db492604f (patch)
treee008cae4c33969f78e6febd914676f2b5ed57272 /lua/alpha
parent0cde83cfa15c5c0b8d117c34a8bfae38b4dec39c (diff)
downloadnvim-conf-cf9605f7a01ef90050df2f5aafa3b89db492604f.tar.gz
nvim-conf-cf9605f7a01ef90050df2f5aafa3b89db492604f.zip
feat(impro) add plugins and configs
Diffstat (limited to 'lua/alpha')
-rw-r--r--lua/alpha/harpoon.lua44
-rw-r--r--lua/alpha/snips/ft/go.lua9
2 files changed, 7 insertions, 46 deletions
diff --git a/lua/alpha/harpoon.lua b/lua/alpha/harpoon.lua
deleted file mode 100644
index 78e6e9b..0000000
--- a/lua/alpha/harpoon.lua
+++ /dev/null
@@ -1,44 +0,0 @@
-local M = {}
-
--- changing this values will require re-compile packer
-local terms = vim.g.harpoon_terms or 3
-local quick_binds = vim.g.harpoon_quick_binds or 5
-
-M.keymaps = {
- { "<leader>ss" },
- { "<leader>sa" },
-}
-
-for i = 1, terms do
- table.insert(M.keymaps, { string.format("<leader><leader>%s", i) })
-end
-
-for i = 1, quick_binds do
- table.insert(M.keymaps, { string.format("<leader>%s", i) })
-end
-
-M.setup = function()
- require("harpoon").setup()
-
- vim.keymap.set(
- "n",
- "<leader>ss",
- require("harpoon.ui").toggle_quick_menu,
- { noremap = true, silent = true, expr = false }
- )
- vim.keymap.set("n", "<leader>sa", require("harpoon.mark").add_file, { noremap = true, silent = true, expr = false })
-
- for i = 1, terms do
- vim.keymap.set("n", string.format("<leader><leader>%s", i), function()
- require("harpoon.term").gotoTerminal(i)
- end, { noremap = true, silent = true, expr = false })
- end
-
- for i = 1, quick_binds do
- vim.keymap.set("n", string.format("<leader>%s", i), function()
- require("harpoon.ui").nav_file(i)
- end, { noremap = true, silent = true, expr = false })
- end
-end
-
-return M
diff --git a/lua/alpha/snips/ft/go.lua b/lua/alpha/snips/ft/go.lua
index 58c6bfc..637f57d 100644
--- a/lua/alpha/snips/ft/go.lua
+++ b/lua/alpha/snips/ft/go.lua
@@ -13,7 +13,12 @@ local ts_utils = require "nvim-treesitter.ts_utils"
local get_node_text = vim.treesitter.get_node_text
-vim.treesitter.set_query(
+if vim.fn.has "nvim-0.9.0" ~= 1 then
+ vim.treesitter.query.get = vim.treesitter.get_query
+ vim.treesitter.query.set = vim.treesitter.set_query
+end
+
+vim.treesitter.query.set(
"go",
"LuaSnip_Result",
[[
@@ -83,7 +88,7 @@ local function go_result_type(info)
end
end
- local query = vim.treesitter.get_query("go", "LuaSnip_Result")
+ local query = vim.treesitter.query.get_query("go", "LuaSnip_Result")
for _, node in query:iter_captures(function_node, 0) do
if handlers[node:type()] then
return handlers[node:type()](node, info)