From badc26c307142216ff4c6d905014e501882bf029 Mon Sep 17 00:00:00 2001 From: Ariel D'Alessandro Date: Tue, 24 May 2022 11:53:49 +0200 Subject: Add lazygit, refactor code actions, fix lsp command --- lua/alpha/lsp.lua | 2 +- lua/alpha/php_code_actions.lua | 3 +++ lua/alpha/plugins.lua | 2 ++ lua/alpha/refactor.lua | 4 ++-- 4 files changed, 8 insertions(+), 3 deletions(-) (limited to 'lua') diff --git a/lua/alpha/lsp.lua b/lua/alpha/lsp.lua index 8d48993..95b7148 100644 --- a/lua/alpha/lsp.lua +++ b/lua/alpha/lsp.lua @@ -24,13 +24,13 @@ local function on_attach(client) vim.keymap.set("n", "vf", vim.lsp.buf.formatting, { buffer = 0 }) vim.keymap.set("n", "vn", vim.diagnostic.goto_next, { buffer = 0 }) vim.keymap.set("n", "vp", vim.diagnostic.goto_prev, { buffer = 0 }) + vim.keymap.set("n", "vca", vim.lsp.buf.code_action, { buffer = 0 }) vim.keymap.set("i", "", vim.lsp.buf.signature_help, { buffer = 0 }) vim.keymap.set("n", "vo", ":LspRestart", { noremap = true }) telescope_mapper("gr", "lsp_references", nil, true) telescope_mapper("pv", "find_symbol", nil, true) telescope_mapper("pd", "lsp_document_symbols", nil, true) - telescope_mapper("vca", "lsp_code_actions", nil, true) vim.bo.omnifunc = "v:lua.vim.lsp.omnifunc" diff --git a/lua/alpha/php_code_actions.lua b/lua/alpha/php_code_actions.lua index 998fcb5..5bca3c3 100644 --- a/lua/alpha/php_code_actions.lua +++ b/lua/alpha/php_code_actions.lua @@ -38,6 +38,9 @@ local php_setter_getter_actions = { generator = { fn = function(context) local cursor_node = utils.get_master_node() + if cursor_node == nil then + return + end if cursor_node.type(cursor_node) ~= "property_declaration" then return end diff --git a/lua/alpha/plugins.lua b/lua/alpha/plugins.lua index 446c1d6..7b9f4c4 100644 --- a/lua/alpha/plugins.lua +++ b/lua/alpha/plugins.lua @@ -97,6 +97,8 @@ return require("packer").startup(function(use) use("github/copilot.vim") + use "kdheepak/lazygit.nvim" + use({ "nvim-telescope/telescope.nvim", requires = { diff --git a/lua/alpha/refactor.lua b/lua/alpha/refactor.lua index 418a078..8474b87 100644 --- a/lua/alpha/refactor.lua +++ b/lua/alpha/refactor.lua @@ -243,7 +243,7 @@ M.new_property = function () vim.api.nvim_win_set_cursor(0, {row, column}) end -vim.keymap.set("n", "rs", M.setter_getter, {}) -vim.keymap.set("n", "rn", M.new_property, {}) +-- vim.keymap.set("n", "rs", M.setter_getter, {}) +-- vim.keymap.set("n", "rn", M.new_property, {}) return M -- cgit v1.2.3