From b1209734093729d1f0305a40c23cb43daa76b6e9 Mon Sep 17 00:00:00 2001 From: Taken Date: Mon, 4 Sep 2023 00:35:27 +0200 Subject: [PATCH] Modified config --- lua/taken/plugins/copilot.lua | 22 ++++++++++++++++++++++ lua/taken/plugins/lsp/lspconfig.lua | 12 ++++++------ lua/taken/plugins/otherplugins.lua | 8 ++++---- 3 files changed, 32 insertions(+), 10 deletions(-) create mode 100644 lua/taken/plugins/copilot.lua diff --git a/lua/taken/plugins/copilot.lua b/lua/taken/plugins/copilot.lua new file mode 100644 index 0000000..a1b0734 --- /dev/null +++ b/lua/taken/plugins/copilot.lua @@ -0,0 +1,22 @@ +return { + "zbirenbaum/copilot.lua", + cmd = "Copilot", + event = "InsertEnter", + config = function() + require("copilot").setup({ + suggestion = { + auto_trigger = true, + keymap = { + accept = "", + }, + }, + filetypes = { + lua = true, + javascript = true, + python = true, + markdown = true, + json = true, + }, + }) + end, +} diff --git a/lua/taken/plugins/lsp/lspconfig.lua b/lua/taken/plugins/lsp/lspconfig.lua index 3772907..eb53739 100644 --- a/lua/taken/plugins/lsp/lspconfig.lua +++ b/lua/taken/plugins/lsp/lspconfig.lua @@ -7,9 +7,11 @@ return { local on_attach = function(client, bufnr) local opts = { noremap = true, silent = true, buffer = bufnr } - vim.keymap.set("n", "gd", function() - vim.lsp.buf.definition() - end, opts) + vim.keymap.set("n", "gd", "Telescope lsp_definitions", opts) + vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts) + vim.keymap.set("n", "gi", "Telescope lsp_implementations", opts) + vim.keymap.set("n", "gt", "Telescope lsp_type_definitions", opts) + vim.keymap.set("n", "rn", vim.lsp.buf.rename, opts) vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts) @@ -28,9 +30,7 @@ return { vim.keymap.set("n", "vca", function() vim.lsp.buf.code_action() end, opts) - vim.keymap.set("n", "vrr", function() - vim.lsp.buf.references() - end, opts) + vim.keymap.set("n", "gR", "Telescope lsp_references", opts) vim.keymap.set("n", "vrn", function() vim.lsp.buf.rename() end, opts) diff --git a/lua/taken/plugins/otherplugins.lua b/lua/taken/plugins/otherplugins.lua index 40ca61f..36473f9 100644 --- a/lua/taken/plugins/otherplugins.lua +++ b/lua/taken/plugins/otherplugins.lua @@ -1,8 +1,4 @@ return { - { - "github/copilot.vim", - event = "VimEnter", - }, { "folke/todo-comments.nvim", dependencies = { "nvim-lua/plenary.nvim" }, @@ -56,4 +52,8 @@ return { ]]) end, }, + { + "stevearc/dressing.nvim", + event = "VeryLazy", + }, }