diff --git a/config/nvim/lua/user/lsp/config/lua_ls.lua b/config/nvim/lua/user/lsp/config/lua_ls.lua new file mode 100644 index 0000000..4f8e140 --- /dev/null +++ b/config/nvim/lua/user/lsp/config/lua_ls.lua @@ -0,0 +1,22 @@ +return { + settings = { + Lua = { + runtime = { + -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) + version = "LuaJIT", + }, + diagnostics = { + -- Get the language server to recognize the `vim` global + globals = { "vim" }, + }, + workspace = { + -- Make the server aware of Neovim runtime files + library = vim.api.nvim_get_runtime_file("", true), + }, + -- Do not send telemetry data containing a randomized but unique identifier + telemetry = { + enable = false, + }, + }, + }, +} diff --git a/config/nvim/lua/user/plugins/cmp.lua b/config/nvim/lua/user/plugins/cmp.lua new file mode 100644 index 0000000..051d4a1 --- /dev/null +++ b/config/nvim/lua/user/plugins/cmp.lua @@ -0,0 +1,20 @@ +return { + "hrsh7th/nvim-cmp", + -- override the options table that is used in the `require("cmp").setup()` call + opts = function(_, opts) + -- opts parameter is the default options table + -- the function is lazy loaded so cmp is able to be required + local cmp = require "cmp" + -- modify the sources part of the options table + opts.sources = cmp.config.sources { + { name = "nvim_lsp", priority = 1000 }, + { name = "luasnip", priority = 750 }, + { name = "buffer", priority = 500 }, + { name = "path", priority = 250 }, + { name = "copilot", priority = 100 }, + } + + -- return the new table to be used + return opts + end, +} -- override nvim-cmp plugin diff --git a/config/nvim/lua/user/plugins/lspkind.lua b/config/nvim/lua/user/plugins/lspkind.lua new file mode 100644 index 0000000..491e263 --- /dev/null +++ b/config/nvim/lua/user/plugins/lspkind.lua @@ -0,0 +1,27 @@ +return { + "onsails/lspkind.nvim", + opts = { + mode = "symbol", + symbol_map = { + NONE = "", + Array = "", + Boolean = "⊨", + Class = "", + Constructor = "", + Key = "", + Namespace = "", + Null = "NULL", + Number = "#", + Object = "⦿", + Package = "", + Property = "", + Reference = "", + Snippet = "", + String = "𝓐", + TypeParameter = "", + Unit = "", + Copilot = "", + }, + }, + vim.api.nvim_set_hl(0, "CmpItemKindCopilot", {fg ="#6CC644"}) +} diff --git a/config/nvim/lua/user/plugins/user.lua b/config/nvim/lua/user/plugins/user.lua index cd41f2a..b3ea578 100644 --- a/config/nvim/lua/user/plugins/user.lua +++ b/config/nvim/lua/user/plugins/user.lua @@ -1,14 +1,16 @@ return { - -- You can also add new plugins here as well: - -- Add plugins, the lazy syntax - -- "andweeb/presence.nvim", - -- { - -- "ray-x/lsp_signature.nvim", - -- event = "BufRead", - -- config = function() - -- require("lsp_signature").setup() - -- end, - -- }, + -- Signatures plugin to show function signatures as you type them + { + "ray-x/lsp_signature.nvim", + event = "BufRead", + config = function() + require("lsp_signature").setup { + hint_enable = false, + } + end, + }, + + -- Rooter plugin to change directory to the project root { "notjedi/nvim-rooter.lua", event = "UIEnter", @@ -20,11 +22,32 @@ return { } end, }, + + -- Leap plugin to jump to any line in the file { "ggandor/leap.nvim", event = "UIEnter", + config = function() require("leap").add_default_mappings() end, + }, + + -- Copilot plugin to autocomplete text + { + "zbirenbaum/copilot.lua", + cmd = "Copilot", + event = "InsertEnter", config = function() - require("leap").add_default_mappings() + require("copilot").setup { + suggestion = { enabled = false }, + panel = { enabled = false }, + filetypes = { markdown = true }, + } end, }, + + -- Copilot CMP plugin to autocomplete text in the completion menu + { + "zbirenbaum/copilot-cmp", + event = "InsertEnter", + config = function() require("copilot_cmp").setup() end, + }, }