1
0
mirror of https://github.com/dcarrillo/dotfiles.git synced 2025-07-02 10:59:25 +00:00

[neovim] Minimal refactor

This commit is contained in:
2024-02-16 16:37:22 +01:00
parent d1c002183f
commit 5d6b68c0bd
9 changed files with 70 additions and 44 deletions

View File

@ -153,18 +153,12 @@ keymap(
)
-- Copilot
keymap(
"n",
"<leader>coe",
"<cmd>CopilotChatExplain<cr>",
vim.tbl_extend("force", opts, { desc = "CopilotChat - Explain code" })
)
keymap(
"n",
"<leader>cot",
"<cmd>CopilotChatTests<cr>",
vim.tbl_extend("force", opts, { desc = "CopilotChat - Generate tests" })
)
keymap("n", "<leader>coa", function()
require("CopilotChat.code_actions").show_help_actions()
end, vim.tbl_extend("force", opts, { desc = "CopilotChat - Help actions" }))
keymap("n", "<leader>cop", function()
require("CopilotChat.code_actions").show_prompt_actions()
end, vim.tbl_extend("force", opts, { desc = "CopilotChat - Prompt actions" }))
-- Better 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" },
{ "mg979/vim-visual-multi", version = "v0.*" },
{ "mg979/vim-visual-multi" },
{
"coffebar/neovim-project",
opts = {
@ -263,11 +263,6 @@ require("lazy").setup({
-- Typescript
{
"pmizio/typescript-tools.nvim",
opts = {
settings = {
complete_function_calls = true,
},
},
},
-- Markdown
@ -293,11 +288,6 @@ require("lazy").setup({
{ "AndreM222/copilot-lualine" },
{
"copilotc-nvim/copilotchat.nvim",
opts = {
show_help = "yes",
debug = false,
disable_extra_info = "yes",
},
event = "VeryLazy",
},

View File

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

View File

@ -15,3 +15,22 @@ require("copilot").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.lsp")
require("plugins.go")
require("plugins.typescript")
require("plugins.neotest")
require("plugins.dap")
require("plugins.noice")

View File

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

View File

@ -54,7 +54,7 @@ local get_filetype = function()
if ft == "yaml" then
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
end
@ -98,7 +98,20 @@ require("lualine").setup({
return true
end,
},
"copilot",
{
"copilot",
symbols = {
status = {
icons = {
enabled = "",
sleep = "",
disabled = "",
warning = "",
unknown = "",
},
},
},
},
lsp_progress,
{
require("noice").api.status.search.get,

View File

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