Added nvim plugins oil, codeium

This commit is contained in:
Luka Jankovic 2025-01-06 01:22:29 +01:00
parent 0709e96515
commit 18d295b5ad
6 changed files with 156 additions and 119 deletions

View file

@ -1,16 +1,19 @@
{ {
"codeium.nvim": { "branch": "main", "commit": "ebed4f7cc8a18184d8332d421ca10bed5f7d59a1" },
"conform.nvim": { "branch": "master", "commit": "70019124aa4f2e6838be9fbd2007f6d13b27a96d" }, "conform.nvim": { "branch": "master", "commit": "70019124aa4f2e6838be9fbd2007f6d13b27a96d" },
"gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" }, "gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" },
"indent-blankline.nvim": { "branch": "master", "commit": "259357fa4097e232730341fa60988087d189193a" }, "indent-blankline.nvim": { "branch": "master", "commit": "259357fa4097e232730341fa60988087d189193a" },
"lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }, "lazy.nvim": { "branch": "main", "commit": "72aa3a2624be5dc240646084f7b6a38eb99eb2ce" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "c6c686781f9841d855bf1b926e10aa5e19430a38" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "97d9f1d3ad205dece6bcafd1d71cf1507608f3c7" },
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
"mini.icons": { "branch": "main", "commit": "6787321f70d674a481776b7cc2c781fb7002c644" }, "mini.icons": { "branch": "main", "commit": "1c79feb7478ca773fa3dac5cadf43ced9180e861" },
"nord.nvim": { "branch": "master", "commit": "80c1e5321505aeb22b7a9f23eb82f1e193c12470" }, "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" }, "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
"slimline.nvim": { "branch": "main", "commit": "5a7e91619496c4655e02e7ba26aae6b9a5b5a564" }, "slimline.nvim": { "branch": "main", "commit": "5a7e91619496c4655e02e7ba26aae6b9a5b5a564" },
"telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
"toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" }, "toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" },
"which-key.nvim": { "branch": "main", "commit": "8ab96b38a2530eacba5be717f52e04601eb59326" } "which-key.nvim": { "branch": "main", "commit": "1f8d414f61e0b05958c342df9b6a4c89ce268766" }
} }

View file

@ -3,3 +3,6 @@ vim.api.nvim_set_keymap('n', '<C-h>', '<C-w>h', { noremap = true, silent = true
vim.api.nvim_set_keymap('n', '<C-j>', '<C-w>j', { noremap = true, silent = true }) vim.api.nvim_set_keymap('n', '<C-j>', '<C-w>j', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<C-k>', '<C-w>k', { noremap = true, silent = true }) vim.api.nvim_set_keymap('n', '<C-k>', '<C-w>k', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<C-l>', '<C-w>l', { noremap = true, silent = true }) vim.api.nvim_set_keymap('n', '<C-l>', '<C-w>l', { noremap = true, silent = true })
-- Clear Highlights
vim.api.nvim_set_keymap('n', '<Esc>', ':noh<CR>', { noremap = true, silent = true })

View file

@ -14,9 +14,9 @@ vim.o.clipboard = "unnamedplus"
local restore_cursor_augroup = vim.api.nvim_create_augroup("restore_cursor_shape_on_exit", { clear = true }) local restore_cursor_augroup = vim.api.nvim_create_augroup("restore_cursor_shape_on_exit", { clear = true })
vim.api.nvim_create_autocmd({ "VimLeave" }, { vim.api.nvim_create_autocmd({ "VimLeave" }, {
group = restore_cursor_augroup, group = restore_cursor_augroup,
desc = "restore the cursor shape on exit of neovim", desc = "restore the cursor shape on exit of neovim",
command = "set guicursor=a:ver20", command = "set guicursor=a:ver20",
}) })
-- Horizontal Split Line -- Horizontal Split Line
@ -27,3 +27,6 @@ vim.opt.scrolloff = 5
-- Highlight current line -- Highlight current line
vim.opt.cursorline = true vim.opt.cursorline = true
-- Set signcolumn to prevent lsp flickering
vim.opt.signcolumn = "yes"

View file

@ -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
}

View file

@ -1,121 +1,128 @@
return { return {
{ {
"williamboman/mason.nvim", "williamboman/mason.nvim",
cmd = "Mason", cmd = "Mason",
}, },
{ {
"williamboman/mason-lspconfig.nvim", "williamboman/mason-lspconfig.nvim",
event = { "BufReadPre", "BufNewFile" }, event = { "BufReadPre", "BufNewFile" },
config = function() config = function()
require("mason").setup() require("mason").setup()
require("mason-lspconfig").setup_handlers({ require("mason-lspconfig").setup_handlers({
-- The first entry (without a key) will be the default handler -- The first entry (without a key) will be the default handler
-- and will be called for each installed server that doesn't have -- and will be called for each installed server that doesn't have
-- a dedicated handler. -- a dedicated handler.
function(server_name) -- default handler (optional) function(server_name) -- default handler (optional)
require("lspconfig")[server_name].setup({}) require("lspconfig")[server_name].setup({})
end, end,
-- Next, you can provide a dedicated handler for specific servers. -- Next, you can provide a dedicated handler for specific servers.
-- For example, a handler override for the `rust_analyzer`: -- For example, a handler override for the `rust_analyzer`:
-- ["rust_analyzer"] = function () -- ["rust_analyzer"] = function ()
-- require("rust-tools").setup {} -- require("rust-tools").setup {}
-- end -- end
}) })
end, end,
}, },
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
{ {
"stevearc/conform.nvim", "stevearc/conform.nvim",
event = { "BufWritePre" }, event = { "BufWritePre" },
cmd = { "ConformInfo" }, cmd = { "ConformInfo" },
opts = function() opts = function()
local mason_reg = require("mason-registry") local mason_reg = require("mason-registry")
local formatters = {} local formatters = {}
local formatters_by_ft = {} local formatters_by_ft = {}
-- add diff langue vs filetype -- add diff langue vs filetype
local keymap = { local keymap = {
["c++"] = "cpp", ["c++"] = "cpp",
["c#"] = "cs", ["c#"] = "cs",
} }
-- add dif conform vs mason -- add dif conform vs mason
local name_map = { local name_map = {
["cmakelang"] = "cmake_format", ["cmakelang"] = "cmake_format",
["deno"] = "deno_fmt", ["deno"] = "deno_fmt",
["elm-format"] = "elm_format", ["elm-format"] = "elm_format",
["gdtoolkit"] = "gdformat", ["gdtoolkit"] = "gdformat",
["nixpkgs-fmt"] = "nixpkgs_fmt", ["nixpkgs-fmt"] = "nixpkgs_fmt",
["opa"] = "opa_fmt", ["opa"] = "opa_fmt",
["php-cs-fixer"] = "php_cs_fixer", ["php-cs-fixer"] = "php_cs_fixer",
["ruff"] = "ruff_format", ["ruff"] = "ruff_format",
["sql-formatter"] = "sql_formatter", ["sql-formatter"] = "sql_formatter",
["xmlformatter"] = "xmlformat", ["xmlformatter"] = "xmlformat",
} }
for _, pkg in pairs(mason_reg.get_installed_packages()) do for _, pkg in pairs(mason_reg.get_installed_packages()) do
for _, type in pairs(pkg.spec.categories) do for _, type in pairs(pkg.spec.categories) do
-- only act upon a formatter -- only act upon a formatter
if type == "Formatter" then if type == "Formatter" then
-- if formatter doesn't have a builtin config, create our own from a generic template -- 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 if not require("conform").get_formatter_config(pkg.spec.name) then
-- the key of the entry to this table -- the key of the entry to this table
-- is the name of the bare executable -- is the name of the bare executable
-- the actual value may not be the absolute path -- the actual value may not be the absolute path
-- in some cases -- in some cases
local bin = next(pkg.spec.bin) local bin = next(pkg.spec.bin)
-- this should be replaced by a function -- this should be replaced by a function
-- that quieries the configured mason install path -- that quieries the configured mason install path
local prefix = vim.fn.stdpath("data") .. "/mason/bin/" local prefix = vim.fn.stdpath("data") .. "/mason/bin/"
formatters[pkg.spec.name] = { formatters[pkg.spec.name] = {
command = prefix .. bin, command = prefix .. bin,
args = { "$FILENAME" }, args = { "$FILENAME" },
stdin = true, stdin = true,
require_cwd = false, require_cwd = false,
} }
end end
-- finally add the formatter to it's compatible filetype(s) -- finally add the formatter to it's compatible filetype(s)
for _, ft in pairs(pkg.spec.languages) do for _, ft in pairs(pkg.spec.languages) do
local ftl = string.lower(ft) local ftl = string.lower(ft)
local ready = mason_reg.get_package(pkg.spec.name):is_installed() local ready = mason_reg.get_package(pkg.spec.name):is_installed()
if ready then if ready then
if keymap[ftl] ~= nil then if keymap[ftl] ~= nil then
ftl = keymap[ftl] ftl = keymap[ftl]
end end
if name_map[pkg.spec.name] ~= nil then if name_map[pkg.spec.name] ~= nil then
pkg.spec.name = name_map[pkg.spec.name] pkg.spec.name = name_map[pkg.spec.name]
end end
formatters_by_ft[ftl] = formatters_by_ft[ftl] or {} formatters_by_ft[ftl] = formatters_by_ft[ftl] or {}
table.insert(formatters_by_ft[ftl], pkg.spec.name) table.insert(formatters_by_ft[ftl], pkg.spec.name)
end end
end end
end end
end end
end end
return { return {
format_on_save = { format_on_save = {
lsp_fallback = true, lsp_fallback = true,
timeout_ms = 500, timeout_ms = 500,
}, },
formatters = formatters, formatters = formatters,
formatters_by_ft = formatters_by_ft, formatters_by_ft = formatters_by_ft,
} }
end, end,
keys = { keys = {
{ {
-- Customize or remove this keymap to your liking "<leader>fm",
"<leader>fm", function()
function() require("conform").format({ async = true })
require("conform").format({ async = true }) end,
end, mode = "",
mode = "", desc = "Format buffer",
desc = "Format buffer", },
}, {
}, "<leader>ca",
}, function()
vim.lsp.buf.code_action()
end,
mode = "",
desc = "Code Action",
}
},
},
} }

View file

@ -0,0 +1,6 @@
return {
"stevearc/oil.nvim",
config = function()
require("oil").setup()
end,
}