Apply Patch
This commit is contained in:
parent
25dcd58627
commit
f9c808c3c5
13 changed files with 268 additions and 225 deletions
|
|
@ -1,3 +1,2 @@
|
|||
require('config.lazy')
|
||||
require('config.settings')
|
||||
require('config.keybinds')
|
||||
require('config.rest')
|
||||
|
|
|
|||
|
|
@ -32,4 +32,9 @@ require("lazy").setup({
|
|||
install = { colorscheme = { "nord" } },
|
||||
-- automatically check for plugin updates
|
||||
checker = { enabled = false },
|
||||
|
||||
change_detection = {
|
||||
enabled = false,
|
||||
notify = false
|
||||
}
|
||||
})
|
||||
|
|
|
|||
2
nvim/lua/config/rest.lua
Normal file
2
nvim/lua/config/rest.lua
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
require('config.settings')
|
||||
require('config.keybinds')
|
||||
|
|
@ -8,24 +8,42 @@ vim.o.tabstop = 4
|
|||
vim.o.shiftwidth = 4
|
||||
|
||||
-- Clipboard
|
||||
local function paste()
|
||||
return {
|
||||
vim.fn.split(vim.fn.getreg(""), "\n"),
|
||||
vim.fn.getregtype(""),
|
||||
}
|
||||
end
|
||||
|
||||
vim.o.clipboard = "unnamedplus"
|
||||
vim.api.nvim_exec(
|
||||
[[
|
||||
augroup YankHighlight
|
||||
autocmd!
|
||||
autocmd TextYankPost * silent! lua vim.highlight.on_yank()
|
||||
augroup end
|
||||
]],
|
||||
false
|
||||
)
|
||||
-- vim.g.clipboard = {
|
||||
-- name = "OSC 52",
|
||||
-- copy = {
|
||||
-- ["+"] = require("vim.ui.clipboard.osc52").copy("+"),
|
||||
-- ["*"] = require("vim.ui.clipboard.osc52").copy("*"),
|
||||
-- },
|
||||
-- paste = {
|
||||
-- ["+"] = paste,
|
||||
-- ["*"] = paste,
|
||||
-- },
|
||||
-- }
|
||||
-- vim.api.nvim_exec(
|
||||
-- [[
|
||||
-- augroup YankHighlight
|
||||
-- autocmd!
|
||||
-- autocmd TextYankPost * silent! lua vim.highlight.on_yank()
|
||||
-- augroup end
|
||||
-- ]],
|
||||
-- false
|
||||
-- )
|
||||
|
||||
-- Restore cursor
|
||||
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
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
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
|
||||
}
|
||||
|
|
@ -3,5 +3,5 @@ return {
|
|||
cmd = { 'GitMessenger' },
|
||||
keys = {
|
||||
{ "<leader>gm", "<cmd>GitMessenger<cr>", desc = "[G]it [M]essenger" },
|
||||
}
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,171 +1,181 @@
|
|||
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,
|
||||
},
|
||||
{
|
||||
"ray-x/lsp_signature.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {},
|
||||
config = function(_, opts)
|
||||
require 'lsp_signature'.setup(opts)
|
||||
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
callback = function(args)
|
||||
local bufnr = args.buf
|
||||
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
||||
if vim.tbl_contains({ 'null-ls' }, client.name) then -- blacklist lsp
|
||||
return
|
||||
end
|
||||
require("lsp_signature").on_attach({
|
||||
-- ... setup options here ...
|
||||
}, bufnr)
|
||||
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 = {}
|
||||
|
||||
-- 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",
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
-- 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
|
||||
if not vim.g.pre_load then
|
||||
require("mason-lspconfig").setup({
|
||||
-- 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
|
||||
end,
|
||||
},
|
||||
{
|
||||
"ray-x/lsp_signature.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {},
|
||||
config = function(_, opts)
|
||||
require("lsp_signature").setup(opts)
|
||||
|
||||
return {
|
||||
formatters = formatters,
|
||||
formatters_by_ft = formatters_by_ft,
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
callback = function(args)
|
||||
local bufnr = args.buf
|
||||
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
||||
if vim.tbl_contains({ "null-ls" }, client.name) then -- blacklist lsp
|
||||
return
|
||||
end
|
||||
require("lsp_signature").on_attach({
|
||||
-- ... setup options here ...
|
||||
}, bufnr)
|
||||
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 = {}
|
||||
|
||||
-- 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",
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
-- 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 {
|
||||
formatters = formatters,
|
||||
formatters_by_ft = formatters_by_ft,
|
||||
}
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
"<leader>fm",
|
||||
function()
|
||||
require("conform").format({ async = true })
|
||||
end,
|
||||
mode = "",
|
||||
desc = "Format buffer",
|
||||
},
|
||||
-- {
|
||||
-- "<leader>ca",
|
||||
-- function()
|
||||
-- vim.lsp.buf.code_action()
|
||||
-- end,
|
||||
-- mode = "",
|
||||
-- desc = "Code Action",
|
||||
-- },
|
||||
{
|
||||
"<leader>rn",
|
||||
function()
|
||||
vim.lsp.buf.rename()
|
||||
end,
|
||||
mode = "",
|
||||
desc = "[R]e[N]ame",
|
||||
},
|
||||
{
|
||||
"gd",
|
||||
function()
|
||||
vim.lsp.buf.definition()
|
||||
end,
|
||||
mode = "",
|
||||
desc = "[G]oto [D]efinition",
|
||||
},
|
||||
{
|
||||
"gD",
|
||||
function()
|
||||
vim.lsp.buf.declaration()
|
||||
end,
|
||||
mode = "",
|
||||
desc = "[G]oto [D]eclaration",
|
||||
},
|
||||
{
|
||||
"<leader>ih",
|
||||
function()
|
||||
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({0}),{0})
|
||||
end,
|
||||
mode = "",
|
||||
desc = "Toggle [I]nlay [H]ints"
|
||||
}
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
"<leader>fm",
|
||||
function()
|
||||
require("conform").format({ async = true })
|
||||
end,
|
||||
mode = "",
|
||||
desc = "Format buffer",
|
||||
},
|
||||
{
|
||||
"<leader>ca",
|
||||
function()
|
||||
vim.lsp.buf.code_action()
|
||||
end,
|
||||
mode = "",
|
||||
desc = "Code Action",
|
||||
},
|
||||
{
|
||||
"<leader>rn",
|
||||
function()
|
||||
vim.lsp.buf.rename()
|
||||
end,
|
||||
mode = "",
|
||||
desc = "[R]e[N]ame",
|
||||
},
|
||||
{
|
||||
"gd",
|
||||
function()
|
||||
vim.lsp.buf.definition()
|
||||
end,
|
||||
mode = "",
|
||||
desc = "[G]oto [D]efinition",
|
||||
},
|
||||
{
|
||||
"gD",
|
||||
function()
|
||||
vim.lsp.buf.declaration()
|
||||
end,
|
||||
mode = "",
|
||||
desc = "[G]oto [D]eclaration",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ return {
|
|||
code_action = '⋯',
|
||||
expand = '+',
|
||||
collapse = '-'
|
||||
}
|
||||
},
|
||||
})
|
||||
end,
|
||||
dependencies = {
|
||||
|
|
@ -18,5 +18,9 @@ return {
|
|||
{ "<leader>fi", "<cmd>Lspsaga finder<cr>", desc = "LSP Find References" },
|
||||
{ "<leader>ci", "<cmd>Lspsaga incoming_calls<cr>", desc = "Incoming Calls" },
|
||||
{ "<leader>co", "<cmd>Lspsaga outgoing_calls<cr>", desc = "Outgoing Calls" },
|
||||
{ "<leader>ca", "<cmd>Lspsaga code_action<cr>", desc = "[C]ode [A]ction" },
|
||||
{ "<leader>cd", "<cmd>Lspsaga diagnostic_jump_next<cr>", desc = "[C]ode [D]iagnostics Next" },
|
||||
{ "<leader>cD", "<cmd>Lspsaga diagnostic_jump_prev<cr>", desc = "[C]ode [D]iagnostics Prev" },
|
||||
{ "<leader>cr", "<cmd>Lspsaga finder<cr>", desc = "[C]ode [R]eferences" },
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
return {
|
||||
'shaunsingh/nord.nvim',
|
||||
config = function()
|
||||
vim.cmd [[colorscheme nord]]
|
||||
end
|
||||
"gbprod/nord.nvim",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
config = function()
|
||||
require("nord").setup({})
|
||||
vim.cmd.colorscheme("nord")
|
||||
end,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ return {
|
|||
require("nvim-tree").setup()
|
||||
end,
|
||||
keys = {
|
||||
{ "<M-n>", "<cmd>NvimTreeToggle<cr>", desc = "Toggle [N]vimTree" },
|
||||
{ "<M-n>", "<cmd>NvimTreeFindFileToggle<cr>", desc = "Toggle [N]vimTree" },
|
||||
{ "<leader>nr", "<cmd>NvimTreeRefresh<cr>", desc = "[N]vimTree [R]efresh" },
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ return {
|
|||
local builtin = require("telescope.builtin")
|
||||
vim.keymap.set("n", "<leader>sf", require('telescope').extensions.menufacture.find_files, { desc = "[S]earch [F]iles" })
|
||||
vim.keymap.set("n", "<leader>sg", require('telescope').extensions.menufacture.live_grep, { desc = "[S]earch [G]rep" })
|
||||
vim.keymap.set("n", "<leader>sw", require('telescope').extensions.menufacture.grep_string, { desc = "[S]earch [W]ord under cursor" })
|
||||
|
||||
vim.keymap.set("n", "<leader>/", function()
|
||||
-- You can pass additional configuration to Telescope to change the theme, layout, etc.
|
||||
|
|
|
|||
16
nvim/lua/plugins/windsurf.lua
Normal file
16
nvim/lua/plugins/windsurf.lua
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
return {
|
||||
"Exafunction/codeium.nvim",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"hrsh7th/nvim-cmp",
|
||||
},
|
||||
opts = {
|
||||
enable_cmp_source = false,
|
||||
virtual_text = {
|
||||
enabled = true,
|
||||
},
|
||||
api = {
|
||||
host = "codingbuddy.onprem.gic.ericsson.se",
|
||||
},
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue