lsp stuff

This commit is contained in:
iris committed 2026-02-17 17:40:12 -05:00
1 parent 5b93f815b8
commit 8836b2fbd9
3 files changed
+56 -53

No files matched your search

+45
View File
@@ -10,6 +10,12 @@ vim.api.nvim_create_autocmd('LspAttach', {
)
end
local selmap = function(from, to)
vim.keymap.set({"x", "o"}, from, to,
{ noremap = true, silent = true, buffer = ev.buf }
)
end
local builtin = require('telescope.builtin')
local dap = require('dap')
@@ -36,5 +42,44 @@ vim.api.nvim_create_autocmd('LspAttach', {
map("<leader>da", dap.toggle_breakpoint)
map("<leader>dc", dap.continue)
map("<leader>ds", dap.step_into)
local move = require("nvim-treesitter-textobjects.move")
map("]f", function() move.goto_next_start "@function.outer" end)
map("[f", function() move.goto_previous_start "@function.outer" end)
map("]F", function() move.goto_next_end "@function.outer" end)
map("[F", function() move.goto_previous_end "@function.outer" end)
map("][", function() move.goto_next_start "@class.outer" end)
map("[[", function() move.goto_previous_start "@class.outer" end)
map("]]", function() move.goto_next_end "@class.outer" end)
map("[]", function() move.goto_previous_end "@class.outer" end)
local select = require("nvim-treesitter-textobjects.select")
selmap("af", function() select.select_textobject("@function.outer", "textobjects") end)
selmap("kf", function() select.select_textobject("@function.inner", "textobjects") end)
selmap("ac", function() select.select_textobject("@class.outer", "textobjects") end)
selmap("kc", function() select.select_textobject("@class.inner", "textobjects") end)
selmap("ap", function() select.select_textobject("@parameter.outer", "textobjects") end)
selmap("kp", function() select.select_textobject("@parameter.inner", "textobjects") end)
local swap = require("nvim-treesitter-textobjects.swap")
map("<leader>so", function() swap.swap_next "@parameter.inner" end)
map("<leader>sn", function() swap.swap_previous "@parameter.inner" end)
-- goto_next_start = {
-- ["]f"] = "@function.outer",
-- ["]]"] = "@class.outer",
-- },
-- goto_next_end = {
-- ["]F"] = "@function.outer",
-- ["]["] = "@class.outer",
-- },
-- goto_previous_start = {
-- ["[f"] = "@function.outer",
-- ["[["] = "@class.outer",
-- },
-- goto_previous_end = {
-- ["[F"] = "@function.outer",
-- ["[]"] = "@class.outer",
-- },
end
})