1
0
mirror of https://github.com/dcarrillo/dotfiles.git synced 2024-12-22 18:38:00 +00:00

[neovim] Minimal refactor

This commit is contained in:
Daniel Carrillo 2024-02-16 16:37:22 +01:00
parent d1c002183f
commit 5d6b68c0bd
Signed by: dcarrillo
GPG Key ID: E4CD5C09DAED6E16
9 changed files with 70 additions and 44 deletions

View File

@ -9,52 +9,55 @@
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
"codeium.nvim": { "branch": "main", "commit": "ad6705cacce51df32c9fd72b66f38cb242a95485" }, "copilot-cmp": { "branch": "master", "commit": "72fbaa03695779f8349be3ac54fa8bd77eed3ee3" },
"copilot-lualine": { "branch": "main", "commit": "9e226cf8f4653e13ec282f5878d66aa435899c8c" },
"copilot.lua": { "branch": "master", "commit": "03f825956ec49e550d07875d867ea6e7c4dc8c00" },
"copilotchat.nvim": { "branch": "main", "commit": "d8d6d8d52a1a34dac0502ac22419117642ffedc5" },
"diffview.nvim": { "branch": "main", "commit": "3dc498c9777fe79156f3d32dddd483b8b3dbd95f" }, "diffview.nvim": { "branch": "main", "commit": "3dc498c9777fe79156f3d32dddd483b8b3dbd95f" },
"friendly-snippets": { "branch": "main", "commit": "b8fae73a479ae0a1c54f5c98fa687ae8a0addc53" }, "friendly-snippets": { "branch": "main", "commit": "dbd45e9ba76d535e4cba88afa1b7aa43bb765336" },
"fzy-lua-native": { "branch": "master", "commit": "820f745b7c442176bcc243e8f38ef4b985febfaf" }, "fzy-lua-native": { "branch": "master", "commit": "820f745b7c442176bcc243e8f38ef4b985febfaf" },
"git-blame.nvim": { "branch": "master", "commit": "196602b570b1d754b7b8f9a9f75fa7bd88f12ef8" }, "git-blame.nvim": { "branch": "master", "commit": "196602b570b1d754b7b8f9a9f75fa7bd88f12ef8" },
"github-nvim-theme": { "branch": "main", "commit": "d92e1143e5aaa0d7df28a26dd8ee2102df2cadd8" }, "github-nvim-theme": { "branch": "main", "commit": "d92e1143e5aaa0d7df28a26dd8ee2102df2cadd8" },
"gitsigns.nvim": { "branch": "main", "commit": "6ef8c54fb526bf3a0bc4efb0b2fe8e6d9a7daed2" }, "gitsigns.nvim": { "branch": "main", "commit": "6ef8c54fb526bf3a0bc4efb0b2fe8e6d9a7daed2" },
"go.nvim": { "branch": "master", "commit": "d748e79011437d5b080006b896b3c296656641d7" }, "go.nvim": { "branch": "master", "commit": "d748e79011437d5b080006b896b3c296656641d7" },
"guihua.lua": { "branch": "master", "commit": "9fb6795474918b492d9ab01b1ebaf85e8bf6fe0b" }, "guihua.lua": { "branch": "master", "commit": "9fb6795474918b492d9ab01b1ebaf85e8bf6fe0b" },
"indent-blankline.nvim": { "branch": "master", "commit": "12e92044d313c54c438bd786d11684c88f6f78cd" }, "indent-blankline.nvim": { "branch": "master", "commit": "821a7acd88587d966f7e464b0b3031dfe7f5680c" },
"karen-yank.nvim": { "branch": "main", "commit": "817f50c9464ce557c8f7f8f4d4c8d2f7b81fc40c" }, "karen-yank.nvim": { "branch": "main", "commit": "817f50c9464ce557c8f7f8f4d4c8d2f7b81fc40c" },
"lazy.nvim": { "branch": "main", "commit": "aedcd79811d491b60d0a6577a9c1701063c2a609" }, "lazy.nvim": { "branch": "main", "commit": "aedcd79811d491b60d0a6577a9c1701063c2a609" },
"leap.nvim": { "branch": "main", "commit": "46e9b1a1d7438ac72794b0857b20cad4390b827c" }, "leap.nvim": { "branch": "main", "commit": "52f7ce4fcc1764caac77cf4d43c2c4f5fb42d517" },
"lspsaga.nvim": { "branch": "main", "commit": "2198c07124bef27ef81335be511c8abfd75db933" }, "lspsaga.nvim": { "branch": "main", "commit": "b1b140aa20a0cf353cd3e282870429b48b30a169" },
"lualine-lsp-progress": { "branch": "master", "commit": "56842d097245a08d77912edf5f2a69ba29f275d7" }, "lualine-lsp-progress": { "branch": "master", "commit": "56842d097245a08d77912edf5f2a69ba29f275d7" },
"lualine.nvim": { "branch": "master", "commit": "7d131a8d3ba5016229e8a1d08bf8782acea98852" }, "lualine.nvim": { "branch": "master", "commit": "7d131a8d3ba5016229e8a1d08bf8782acea98852" },
"markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "0954d7730e749d606ddf8d7ae8846848be435d53" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "fe4cce44dec93c69be17dad79b21de867dde118a" },
"mason.nvim": { "branch": "main", "commit": "c43eeb5614a09dc17c03a7fb49de2e05de203924" }, "mason.nvim": { "branch": "main", "commit": "c43eeb5614a09dc17c03a7fb49de2e05de203924" },
"mini.align": { "branch": "main", "commit": "c5ab28809c630b65ffe069b564ce1d473bbcb332" }, "mini.align": { "branch": "main", "commit": "c5ab28809c630b65ffe069b564ce1d473bbcb332" },
"mini.starter": { "branch": "main", "commit": "0ee58ac8975a929e90c8b104987fabfd13015e25" }, "mini.starter": { "branch": "main", "commit": "0ee58ac8975a929e90c8b104987fabfd13015e25" },
"neo-tree.nvim": { "branch": "v2.x", "commit": "e578fe7a5832421b0d2c5b3c0a7a1e40e0f6a47a" }, "neo-tree.nvim": { "branch": "v2.x", "commit": "f3941c57ec85d7bdb44fa53fd858fd80f159018f" },
"neotest": { "branch": "master", "commit": "89a5b1fc22ee5d459262955fe564c3d14e35fd67" }, "neotest": { "branch": "master", "commit": "f6048f32be831907fb15018af2688ff6633704fc" },
"neotest-go": { "branch": "main", "commit": "17579611af5d47bea5ff4d77e6493a6d647d3a15" }, "neotest-go": { "branch": "main", "commit": "ba5d536304ed6971f00d16b48ec26997622ffb43" },
"neovim-project": { "branch": "main", "commit": "e7868b38f402be94e859d479002df1418bc1e954" }, "neovim-project": { "branch": "main", "commit": "e7868b38f402be94e859d479002df1418bc1e954" },
"neovim-session-manager": { "branch": "master", "commit": "07bb62583769abd9d32f88f428ea58248730ac7a" }, "neovim-session-manager": { "branch": "master", "commit": "07bb62583769abd9d32f88f428ea58248730ac7a" },
"noice.nvim": { "branch": "main", "commit": "bf67d70bd7265d075191e7812d8eb42b9791f737" }, "noice.nvim": { "branch": "main", "commit": "bf67d70bd7265d075191e7812d8eb42b9791f737" },
"none-ls.nvim": { "branch": "main", "commit": "c10b7be7751aee820a02f2d1fafe76bc316fe223" }, "none-ls.nvim": { "branch": "main", "commit": "34b1311bd07bd3741e60e06b34d0709d6e5a9f0f" },
"nui.nvim": { "branch": "main", "commit": "35da9ca1de0fc4dda96c2e214d93d363c145f418" }, "nui.nvim": { "branch": "main", "commit": "c3c7fd618dcb5a89e443a2e1033e7d11fdb0596b" },
"nvim-autopairs": { "branch": "master", "commit": "096d0baecc34f6c5d8a6dd25851e9d5ad338209b" }, "nvim-autopairs": { "branch": "master", "commit": "2e8a10c5fc0dcaf8296a5f1a7077efcd37065cc8" },
"nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" }, "nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" },
"nvim-dap": { "branch": "master", "commit": "9d81c11fd185a131f81841e64941859305f6c42d" }, "nvim-dap": { "branch": "master", "commit": "9d81c11fd185a131f81841e64941859305f6c42d" },
"nvim-dap-python": { "branch": "master", "commit": "f5b6f3a90aae0284b61fb3565e575267c19a16e6" }, "nvim-dap-python": { "branch": "master", "commit": "f5b6f3a90aae0284b61fb3565e575267c19a16e6" },
"nvim-dap-ui": { "branch": "master", "commit": "0b4816e5ad5f3219e8e3ec9cce07f61b770c1974" }, "nvim-dap-ui": { "branch": "master", "commit": "0b4816e5ad5f3219e8e3ec9cce07f61b770c1974" },
"nvim-dap-virtual-text": { "branch": "master", "commit": "d4542ac257d3c7ee4131350db6179ae6340ce40b" }, "nvim-dap-virtual-text": { "branch": "master", "commit": "d4542ac257d3c7ee4131350db6179ae6340ce40b" },
"nvim-lspconfig": { "branch": "master", "commit": "41f40dc4b86f3e166cf08115f621001972565a20" }, "nvim-lspconfig": { "branch": "master", "commit": "d1bab4cf4b69e49d6058028fd933d8ef5e74e680" },
"nvim-treesitter": { "branch": "master", "commit": "9860fceb73eb85a9ad424513fe163e6506dfb1fd" }, "nvim-treesitter": { "branch": "master", "commit": "eb1914bb10dc9b114a61197de0ec58a308c40071" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "7ab799a9792f7cf3883cf28c6a00ad431f3d382a" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "7ab799a9792f7cf3883cf28c6a00ad431f3d382a" },
"nvim-ufo": { "branch": "main", "commit": "b0741a647efd98d9abb6cb653e056d24a07e4581" }, "nvim-ufo": { "branch": "main", "commit": "553d8a9c611caa9f020556d4a26b760698e5b81b" },
"nvim-web-devicons": { "branch": "master", "commit": "7f30f2da3c3641841ceb0e2c150281f624445e8f" }, "nvim-web-devicons": { "branch": "master", "commit": "7f30f2da3c3641841ceb0e2c150281f624445e8f" },
"plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" }, "plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" },
"promise-async": { "branch": "main", "commit": "94f6f03c6c1e2aab551aacdf0c1e597a7269abb6" }, "promise-async": { "branch": "main", "commit": "94f6f03c6c1e2aab551aacdf0c1e597a7269abb6" },
"statuscol.nvim": { "branch": "main", "commit": "3b629754420919575a9e5758027d6e1831dbf2aa" }, "statuscol.nvim": { "branch": "main", "commit": "eca428c8df8549fe7a480dd0da0ccc1634f16a4b" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" },
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
"telescope.nvim": { "branch": "master", "commit": "0f865f17af4f9bc1587a0132414cdfd32d91852e" }, "telescope.nvim": { "branch": "master", "commit": "b744cf59752aaa01561afb4223006de26f3836fd" },
"tokyonight.nvim": { "branch": "main", "commit": "610179f7f12db3d08540b6cc61434db2eaecbcff" }, "tokyonight.nvim": { "branch": "main", "commit": "610179f7f12db3d08540b6cc61434db2eaecbcff" },
"trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" }, "trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" },
"typescript-tools.nvim": { "branch": "master", "commit": "c43d9580c3ff5999a1eabca849f807ab33787ea7" }, "typescript-tools.nvim": { "branch": "master", "commit": "c43d9580c3ff5999a1eabca849f807ab33787ea7" },
@ -63,6 +66,6 @@
"vim-illuminate": { "branch": "master", "commit": "305bf07b919ac526deb5193280379e2f8b599926" }, "vim-illuminate": { "branch": "master", "commit": "305bf07b919ac526deb5193280379e2f8b599926" },
"vim-kitty-navigator": { "branch": "master", "commit": "20abf8613aa228a5def1ae02cd9da0f2d210352a" }, "vim-kitty-navigator": { "branch": "master", "commit": "20abf8613aa228a5def1ae02cd9da0f2d210352a" },
"vim-markdown-toc": { "branch": "master", "commit": "0e2c7cdc3ac1d067eb309a10220d001bb7be39cd" }, "vim-markdown-toc": { "branch": "master", "commit": "0e2c7cdc3ac1d067eb309a10220d001bb7be39cd" },
"vim-visual-multi": { "branch": "master", "commit": "1c9207b28c8898ab01b54e6d6b61b0b820a814bc" }, "vim-visual-multi": { "branch": "master", "commit": "cff14071098de5279743b009c496303995fe4df9" },
"yaml-companion.nvim": { "branch": "main", "commit": "4de1e1546abc461f62dee02fcac6a02debd6eb9e" } "yaml-companion.nvim": { "branch": "main", "commit": "4de1e1546abc461f62dee02fcac6a02debd6eb9e" }
} }

View File

@ -153,18 +153,12 @@ keymap(
) )
-- Copilot -- Copilot
keymap( keymap("n", "<leader>coa", function()
"n", require("CopilotChat.code_actions").show_help_actions()
"<leader>coe", end, vim.tbl_extend("force", opts, { desc = "CopilotChat - Help actions" }))
"<cmd>CopilotChatExplain<cr>", keymap("n", "<leader>cop", function()
vim.tbl_extend("force", opts, { desc = "CopilotChat - Explain code" }) require("CopilotChat.code_actions").show_prompt_actions()
) end, vim.tbl_extend("force", opts, { desc = "CopilotChat - Prompt actions" }))
keymap(
"n",
"<leader>cot",
"<cmd>CopilotChatTests<cr>",
vim.tbl_extend("force", opts, { desc = "CopilotChat - Generate tests" })
)
-- Better paste -- Better paste
keymap("v", "p", "P", vim.tbl_extend("force", opts, { desc = "Paste" })) keymap("v", "p", "P", vim.tbl_extend("force", opts, { desc = "Paste" }))

View File

@ -120,7 +120,7 @@ require("lazy").setup({
}, },
}, },
{ "romgrk/fzy-lua-native" }, { "romgrk/fzy-lua-native" },
{ "mg979/vim-visual-multi", version = "v0.*" }, { "mg979/vim-visual-multi" },
{ {
"coffebar/neovim-project", "coffebar/neovim-project",
opts = { opts = {
@ -263,11 +263,6 @@ require("lazy").setup({
-- Typescript -- Typescript
{ {
"pmizio/typescript-tools.nvim", "pmizio/typescript-tools.nvim",
opts = {
settings = {
complete_function_calls = true,
},
},
}, },
-- Markdown -- Markdown
@ -293,11 +288,6 @@ require("lazy").setup({
{ "AndreM222/copilot-lualine" }, { "AndreM222/copilot-lualine" },
{ {
"copilotc-nvim/copilotchat.nvim", "copilotc-nvim/copilotchat.nvim",
opts = {
show_help = "yes",
debug = false,
disable_extra_info = "yes",
},
event = "VeryLazy", event = "VeryLazy",
}, },

View File

@ -16,7 +16,7 @@ local kind_icons = {
Color = "", Color = "",
Constant = "", Constant = "",
Constructor = "", Constructor = "",
Copilot = " ", Copilot = " ",
Enum = "", Enum = "",
EnumMember = "", EnumMember = "",
Event = "", Event = "",

View File

@ -15,3 +15,22 @@ require("copilot").setup({
}) })
require("copilot_cmp").setup() require("copilot_cmp").setup()
local prompts = {
-- Code related prompts
Explain = "Please explain how the following code works.",
Review = "Please review the following code and provide suggestions for improvement.",
Tests = "Please explain how the selected code works, then generate unit tests for it.",
Refactor = "Please refactor the following code to improve its clarity and readability.",
FixCode = "Please fix the following code to make it work as intended.",
BetterNamings = "Please provide better names for the following variables and functions.",
-- Text related prompts
Spelling = "Please correct any grammar and spelling errors in the following text. Respect the markdown format when provided",
Wording = "Please improve the grammar and wording of the following text. Respect the markdown format when provided",
}
require("CopilotChat").setup({
show_help = "yes",
debug = false,
disable_extra_info = "yes",
prompts = prompts,
})

View File

@ -11,6 +11,7 @@ require("plugins.illuminate")
require("plugins.indentline") require("plugins.indentline")
require("plugins.lsp") require("plugins.lsp")
require("plugins.go") require("plugins.go")
require("plugins.typescript")
require("plugins.neotest") require("plugins.neotest")
require("plugins.dap") require("plugins.dap")
require("plugins.noice") require("plugins.noice")

View File

@ -8,6 +8,7 @@ require("lspsaga").setup({
}, },
code_action = { code_action = {
show_server_name = true, show_server_name = true,
extend_gitsigns = true,
}, },
rename = { rename = {
auto_save = true, auto_save = true,

View File

@ -54,7 +54,7 @@ local get_filetype = function()
if ft == "yaml" then if ft == "yaml" then
local schema = require("yaml-companion").get_buf_schema(0) local schema = require("yaml-companion").get_buf_schema(0)
if schema.result[1].name == "none" then if not schema or not schema.result or not schema.result[1].name then
return ft return ft
end end
@ -98,7 +98,20 @@ require("lualine").setup({
return true return true
end, end,
}, },
"copilot", {
"copilot",
symbols = {
status = {
icons = {
enabled = "",
sleep = "",
disabled = "",
warning = "",
unknown = "",
},
},
},
},
lsp_progress, lsp_progress,
{ {
require("noice").api.status.search.get, require("noice").api.status.search.get,

View File

@ -0,0 +1,5 @@
require("typescript-tools").setup({
settings = {
complete_function_calls = true,
},
})