diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 5eb0d3f..6e74834 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,16 +1,19 @@ { + "codeium.nvim": { "branch": "main", "commit": "ebed4f7cc8a18184d8332d421ca10bed5f7d59a1" }, "conform.nvim": { "branch": "master", "commit": "70019124aa4f2e6838be9fbd2007f6d13b27a96d" }, "gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" }, "indent-blankline.nvim": { "branch": "master", "commit": "259357fa4097e232730341fa60988087d189193a" }, - "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "c6c686781f9841d855bf1b926e10aa5e19430a38" }, + "lazy.nvim": { "branch": "main", "commit": "72aa3a2624be5dc240646084f7b6a38eb99eb2ce" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "97d9f1d3ad205dece6bcafd1d71cf1507608f3c7" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, - "mini.icons": { "branch": "main", "commit": "6787321f70d674a481776b7cc2c781fb7002c644" }, + "mini.icons": { "branch": "main", "commit": "1c79feb7478ca773fa3dac5cadf43ced9180e861" }, "nord.nvim": { "branch": "master", "commit": "80c1e5321505aeb22b7a9f23eb82f1e193c12470" }, - "nvim-lspconfig": { "branch": "master", "commit": "a8ef5e6e497b3ebeaaf35b939c07c211563b2e05" }, + "nvim-cmp": { "branch": "main", "commit": "4c1ca8268569bfc6d487473cd17b167560e5bed2" }, + "nvim-lspconfig": { "branch": "master", "commit": "8121483b8132b7053120fafd83728178fb3febf6" }, + "oil.nvim": { "branch": "master", "commit": "c12fad2d225d8f81fadd48521d253607fe25465c" }, "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, "slimline.nvim": { "branch": "main", "commit": "5a7e91619496c4655e02e7ba26aae6b9a5b5a564" }, "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, "toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" }, - "which-key.nvim": { "branch": "main", "commit": "8ab96b38a2530eacba5be717f52e04601eb59326" } + "which-key.nvim": { "branch": "main", "commit": "1f8d414f61e0b05958c342df9b6a4c89ce268766" } } diff --git a/.config/nvim/lua/config/keybinds.lua b/.config/nvim/lua/config/keybinds.lua index f275792..d9994c6 100644 --- a/.config/nvim/lua/config/keybinds.lua +++ b/.config/nvim/lua/config/keybinds.lua @@ -3,3 +3,6 @@ vim.api.nvim_set_keymap('n', '', 'h', { noremap = true, silent = true vim.api.nvim_set_keymap('n', '', 'j', { noremap = true, silent = true }) vim.api.nvim_set_keymap('n', '', 'k', { noremap = true, silent = true }) vim.api.nvim_set_keymap('n', '', 'l', { noremap = true, silent = true }) + +-- Clear Highlights +vim.api.nvim_set_keymap('n', '', ':noh', { noremap = true, silent = true }) diff --git a/.config/nvim/lua/config/settings.lua b/.config/nvim/lua/config/settings.lua index 0539cc2..e52567b 100644 --- a/.config/nvim/lua/config/settings.lua +++ b/.config/nvim/lua/config/settings.lua @@ -14,9 +14,9 @@ vim.o.clipboard = "unnamedplus" local restore_cursor_augroup = vim.api.nvim_create_augroup("restore_cursor_shape_on_exit", { clear = true }) vim.api.nvim_create_autocmd({ "VimLeave" }, { - group = restore_cursor_augroup, - desc = "restore the cursor shape on exit of neovim", - command = "set guicursor=a:ver20", + group = restore_cursor_augroup, + desc = "restore the cursor shape on exit of neovim", + command = "set guicursor=a:ver20", }) -- Horizontal Split Line @@ -27,3 +27,6 @@ vim.opt.scrolloff = 5 -- Highlight current line vim.opt.cursorline = true + +-- Set signcolumn to prevent lsp flickering +vim.opt.signcolumn = "yes" diff --git a/.config/nvim/lua/plugins/codeium.lua b/.config/nvim/lua/plugins/codeium.lua new file mode 100644 index 0000000..754bcf1 --- /dev/null +++ b/.config/nvim/lua/plugins/codeium.lua @@ -0,0 +1,15 @@ +return { + "Exafunction/codeium.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + "hrsh7th/nvim-cmp", + }, + config = function() + require("codeium").setup({ + enable_cmp_source = false, + virtual_text = { + enabled = true, + } + }) + end +} diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index d338b45..901c59b 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -1,121 +1,128 @@ return { - { - "williamboman/mason.nvim", - cmd = "Mason", - }, - { - "williamboman/mason-lspconfig.nvim", - event = { "BufReadPre", "BufNewFile" }, - config = function() - require("mason").setup() + { + "williamboman/mason.nvim", + cmd = "Mason", + }, + { + "williamboman/mason-lspconfig.nvim", + event = { "BufReadPre", "BufNewFile" }, + config = function() + require("mason").setup() - require("mason-lspconfig").setup_handlers({ - -- The first entry (without a key) will be the default handler - -- and will be called for each installed server that doesn't have - -- a dedicated handler. - function(server_name) -- default handler (optional) - require("lspconfig")[server_name].setup({}) - end, - -- Next, you can provide a dedicated handler for specific servers. - -- For example, a handler override for the `rust_analyzer`: - -- ["rust_analyzer"] = function () - -- require("rust-tools").setup {} - -- end - }) - end, - }, - "neovim/nvim-lspconfig", - { - "stevearc/conform.nvim", - event = { "BufWritePre" }, - cmd = { "ConformInfo" }, - opts = function() - local mason_reg = require("mason-registry") + require("mason-lspconfig").setup_handlers({ + -- The first entry (without a key) will be the default handler + -- and will be called for each installed server that doesn't have + -- a dedicated handler. + function(server_name) -- default handler (optional) + require("lspconfig")[server_name].setup({}) + end, + -- Next, you can provide a dedicated handler for specific servers. + -- For example, a handler override for the `rust_analyzer`: + -- ["rust_analyzer"] = function () + -- require("rust-tools").setup {} + -- end + }) + end, + }, + "neovim/nvim-lspconfig", + { + "stevearc/conform.nvim", + event = { "BufWritePre" }, + cmd = { "ConformInfo" }, + opts = function() + local mason_reg = require("mason-registry") - local formatters = {} - local formatters_by_ft = {} + local formatters = {} + local formatters_by_ft = {} - -- add diff langue vs filetype - local keymap = { - ["c++"] = "cpp", - ["c#"] = "cs", - } + -- add diff langue vs filetype + local keymap = { + ["c++"] = "cpp", + ["c#"] = "cs", + } - -- add dif conform vs mason - local name_map = { - ["cmakelang"] = "cmake_format", - ["deno"] = "deno_fmt", - ["elm-format"] = "elm_format", - ["gdtoolkit"] = "gdformat", - ["nixpkgs-fmt"] = "nixpkgs_fmt", - ["opa"] = "opa_fmt", - ["php-cs-fixer"] = "php_cs_fixer", - ["ruff"] = "ruff_format", - ["sql-formatter"] = "sql_formatter", - ["xmlformatter"] = "xmlformat", - } + -- add dif conform vs mason + local name_map = { + ["cmakelang"] = "cmake_format", + ["deno"] = "deno_fmt", + ["elm-format"] = "elm_format", + ["gdtoolkit"] = "gdformat", + ["nixpkgs-fmt"] = "nixpkgs_fmt", + ["opa"] = "opa_fmt", + ["php-cs-fixer"] = "php_cs_fixer", + ["ruff"] = "ruff_format", + ["sql-formatter"] = "sql_formatter", + ["xmlformatter"] = "xmlformat", + } - for _, pkg in pairs(mason_reg.get_installed_packages()) do - for _, type in pairs(pkg.spec.categories) do - -- only act upon a formatter - if type == "Formatter" then - -- if formatter doesn't have a builtin config, create our own from a generic template - if not require("conform").get_formatter_config(pkg.spec.name) then - -- the key of the entry to this table - -- is the name of the bare executable - -- the actual value may not be the absolute path - -- in some cases - local bin = next(pkg.spec.bin) - -- this should be replaced by a function - -- that quieries the configured mason install path - local prefix = vim.fn.stdpath("data") .. "/mason/bin/" + for _, pkg in pairs(mason_reg.get_installed_packages()) do + for _, type in pairs(pkg.spec.categories) do + -- only act upon a formatter + if type == "Formatter" then + -- if formatter doesn't have a builtin config, create our own from a generic template + if not require("conform").get_formatter_config(pkg.spec.name) then + -- the key of the entry to this table + -- is the name of the bare executable + -- the actual value may not be the absolute path + -- in some cases + local bin = next(pkg.spec.bin) + -- this should be replaced by a function + -- that quieries the configured mason install path + local prefix = vim.fn.stdpath("data") .. "/mason/bin/" - formatters[pkg.spec.name] = { - command = prefix .. bin, - args = { "$FILENAME" }, - stdin = true, - require_cwd = false, - } - end + formatters[pkg.spec.name] = { + command = prefix .. bin, + args = { "$FILENAME" }, + stdin = true, + require_cwd = false, + } + end - -- finally add the formatter to it's compatible filetype(s) - for _, ft in pairs(pkg.spec.languages) do - local ftl = string.lower(ft) - local ready = mason_reg.get_package(pkg.spec.name):is_installed() - if ready then - if keymap[ftl] ~= nil then - ftl = keymap[ftl] - end - if name_map[pkg.spec.name] ~= nil then - pkg.spec.name = name_map[pkg.spec.name] - end - formatters_by_ft[ftl] = formatters_by_ft[ftl] or {} - table.insert(formatters_by_ft[ftl], pkg.spec.name) - end - end - end - end - end + -- finally add the formatter to it's compatible filetype(s) + for _, ft in pairs(pkg.spec.languages) do + local ftl = string.lower(ft) + local ready = mason_reg.get_package(pkg.spec.name):is_installed() + if ready then + if keymap[ftl] ~= nil then + ftl = keymap[ftl] + end + if name_map[pkg.spec.name] ~= nil then + pkg.spec.name = name_map[pkg.spec.name] + end + formatters_by_ft[ftl] = formatters_by_ft[ftl] or {} + table.insert(formatters_by_ft[ftl], pkg.spec.name) + end + end + end + end + end - return { - format_on_save = { - lsp_fallback = true, - timeout_ms = 500, - }, - formatters = formatters, - formatters_by_ft = formatters_by_ft, - } - end, - keys = { - { - -- Customize or remove this keymap to your liking - "fm", - function() - require("conform").format({ async = true }) - end, - mode = "", - desc = "Format buffer", - }, - }, - }, + return { + format_on_save = { + lsp_fallback = true, + timeout_ms = 500, + }, + formatters = formatters, + formatters_by_ft = formatters_by_ft, + } + end, + keys = { + { + "fm", + function() + require("conform").format({ async = true }) + end, + mode = "", + desc = "Format buffer", + }, + { + "ca", + function() + vim.lsp.buf.code_action() + end, + mode = "", + desc = "Code Action", + } + }, + }, } diff --git a/.config/nvim/lua/plugins/oil.lua b/.config/nvim/lua/plugins/oil.lua new file mode 100644 index 0000000..ef7ec5a --- /dev/null +++ b/.config/nvim/lua/plugins/oil.lua @@ -0,0 +1,6 @@ +return { + "stevearc/oil.nvim", + config = function() + require("oil").setup() + end, +}