diff options
| author | Elvis Claros Castro <elvis@claros.ar> | 2025-10-30 16:32:45 -0300 |
|---|---|---|
| committer | Elvis Claros Castro <elvis@claros.ar> | 2025-10-30 16:32:45 -0300 |
| commit | 3bcc0dfc274eaa46d9df4c5952d6b30a7e1a0131 (patch) | |
| tree | cdcca5f32e19f979f08ebf5844e9b46d5c285021 /lua | |
| parent | 64402794cfb767f9d579b0cef0e3bd9bcf062131 (diff) | |
| download | nvim-conf-3bcc0dfc274eaa46d9df4c5952d6b30a7e1a0131.tar.gz nvim-conf-3bcc0dfc274eaa46d9df4c5952d6b30a7e1a0131.zip | |
elimino zfz
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/config/autocmds.lua | 2 | ||||
| -rw-r--r-- | lua/config/init.lua | 5 | ||||
| -rw-r--r-- | lua/pi/lsp/default.lua | 6 | ||||
| -rw-r--r-- | lua/pi/lsp/servers/lua_ls.lua | 16 | ||||
| -rw-r--r-- | lua/plugins/codecompanion.lua | 111 | ||||
| -rw-r--r-- | lua/plugins/completition.lua | 8 | ||||
| -rw-r--r-- | lua/plugins/copilot-chat.lua | 7 | ||||
| -rw-r--r-- | lua/plugins/dressing.lua | 11 | ||||
| -rw-r--r-- | lua/plugins/lsp.lua | 7 |
9 files changed, 126 insertions, 47 deletions
diff --git a/lua/config/autocmds.lua b/lua/config/autocmds.lua index a18bc1a..ad999b9 100644 --- a/lua/config/autocmds.lua +++ b/lua/config/autocmds.lua @@ -42,7 +42,7 @@ vim.api.nvim_create_autocmd({ "BufWritePre" }, { vim.api.nvim_create_autocmd("BufWritePre", { pattern = { "*.c", "*.h", "*.cpp", "*.hpp", "*.cc", "*.cxx" }, callback = function() - vim.lsp.buf.format({ async = false }) + vim.lsp.buf.format { async = false } end, }) diff --git a/lua/config/init.lua b/lua/config/init.lua index 7bd1993..bc22409 100644 --- a/lua/config/init.lua +++ b/lua/config/init.lua @@ -4,7 +4,7 @@ require "config.options" -- Load Native Colorscheme and Statusline -- ===================================================== -- Load native implementations early to replace external plugins -local colorscheme = require("config.native-colorscheme") +local colorscheme = require "config.native-colorscheme" colorscheme.setup() -- Additional UI Enhancements @@ -14,7 +14,7 @@ vim.opt.number = true vim.opt.relativenumber = true vim.opt.signcolumn = "yes" -if vim.fn.has("termguicolors") == 1 then +if vim.fn.has "termguicolors" == 1 then vim.opt.termguicolors = true end -- ===================================================== @@ -29,7 +29,6 @@ vim.api.nvim_create_autocmd("User", { require "config.keymaps" require "config.diagnostic" require "config.composer" - require "config.codecompanion-save" end, }) require "config.lazy" diff --git a/lua/pi/lsp/default.lua b/lua/pi/lsp/default.lua index f7fa455..efde87a 100644 --- a/lua/pi/lsp/default.lua +++ b/lua/pi/lsp/default.lua @@ -31,6 +31,7 @@ local server_commands = { kotlin_language_server = { "kotlin-language-server" }, smarty_ls = { "smarty-language-server", "--stdio" }, clangd = { "clangd" }, + asm_lsp = { "asm-lsp" }, } return { @@ -74,6 +75,11 @@ return { filetypes = { "c", "cpp", "objc", "objcpp", "cuda", "proto" }, root_dir = root_pattern("compile_commands.json", ".git"), }, + asm_lsp = { + enable = true, + filetypes = { "asm", "s", "S" }, + root_dir = root_pattern("Makefile", ".git"), + }, }, default_options = function(options) return vim.tbl_deep_extend("force", { diff --git a/lua/pi/lsp/servers/lua_ls.lua b/lua/pi/lsp/servers/lua_ls.lua index c641911..a0915d5 100644 --- a/lua/pi/lsp/servers/lua_ls.lua +++ b/lua/pi/lsp/servers/lua_ls.lua @@ -2,22 +2,8 @@ local lsp_attach = require "pi.lsp.attach" local lsp_flags = require "pi.lsp.flags" return function(ops) - if ops.neodev == true then - -- Setup neodev with explicit configuration for native LSP - require("neodev").setup { - library = { - enabled = true, - runtime = true, - types = true, - plugins = true, - }, - setup_jsonls = true, - lspconfig = false, -- Don't let neodev override lspconfig setup - } - end - local capabilities = require("blink.cmp").get_lsp_capabilities(vim.lsp.protocol.make_client_capabilities()) - + return vim.tbl_extend("force", { cmd = { "lua-language-server" }, filetypes = { "lua" }, diff --git a/lua/plugins/codecompanion.lua b/lua/plugins/codecompanion.lua index ddd209b..ff00936 100644 --- a/lua/plugins/codecompanion.lua +++ b/lua/plugins/codecompanion.lua @@ -6,8 +6,9 @@ return { dependencies = { "nvim-lua/plenary.nvim", "nvim-treesitter/nvim-treesitter", - "ibhagwan/fzf-lua", -- For fzf provider, file or buffer picker + "nvim-telescope/telescope.nvim", -- Using telescope for file and buffer picker "jellydn/spinner.nvim", -- Show loading spinner when request is started + "ravitemer/codecompanion-history.nvim", -- History management extension { "echasnovski/mini.diff", config = function() @@ -75,7 +76,7 @@ return { gemini = function() return require("codecompanion.adapters").extend("gemini", { env = { - api_key = "cmd:op read op://personal/Gemini_API/credential --no-newline", + api_key = "cmd:echo $GEMINI_API_KEY", }, }) end, @@ -95,7 +96,7 @@ return { }, }) end, - openai_compatible = function() + openai_compatible_llama_cpp = function() return require("codecompanion.adapters").extend("openai_compatible", { env = { api_key = "cmd:echo $OPENAI_API_KEY", @@ -114,6 +115,27 @@ return { }, }) end, + + openai_compatible_qwen3_coder = function() + return require("codecompanion.adapters").extend("openai_compatible", { + env = { + api_key = "cmd:echo $DASHSCOPE_API_KEY", + chat_url = "/v1/chat/completions", + url = "https://dashscope-intl.aliyuncs.com/compatible-mode", + }, + headers = { + ["Content-Type"] = "application/json", + }, + schema = { + model = { + default = function() + return "qwen3-coder-plus" + end, + }, + }, + }) + end, + xai = function() return require("codecompanion.adapters").extend("xai", { env = { @@ -143,7 +165,7 @@ return { }, strategies = { chat = { - adapter = "copilot", + adapter = "openai_compatible_qwen3_coder", -- roles = { llm = " Copilot Chat", user = "IT Man" }, }, inline = { adapter = "copilot" }, @@ -166,6 +188,87 @@ return { show_result_in_chat = true, }, }, + history = { + enabled = true, + opts = { + -- Keymap to open history from chat buffer (default: gh) + keymap = "gh", + -- Keymap to save the current chat manually (when auto_save is disabled) + save_chat_keymap = "sc", + -- Save all chats by default (disable to save only manually using 'sc') + auto_save = true, + -- Number of days after which chats are automatically deleted (0 to disable) + expiration_days = 0, + -- Picker interface (auto resolved to a valid picker) + picker = "telescope", -- ("telescope", "snacks", "fzf-lua", or "default") + -- Optional filter function to control which chats are shown when browsing + chat_filter = nil, -- function(chat_data) return boolean end + -- Customize picker keymaps (optional) + picker_keymaps = { + rename = { n = "r", i = "<M-r>" }, + delete = { n = "d", i = "<M-d>" }, + duplicate = { n = "<C-y>", i = "<C-y>" }, + }, + -- Automatically generate titles for new chats + auto_generate_title = true, + title_generation_opts = { + -- Adapter for generating titles (defaults to current chat adapter) + adapter = "copilot", -- Use copilot for cheaper title generation + -- Model for generating titles (defaults to current chat model) + model = "gpt-4.1", -- Use cheaper model for titles + -- Number of user prompts after which to refresh the title (0 to disable) + refresh_every_n_prompts = 3, -- Refresh after every 3rd user prompt + -- Maximum number of times to refresh the title (default: 3) + max_refreshes = 5, + format_title = function(original_title) + -- Custom formatting for titles + return original_title + end, + }, + -- On exiting and entering neovim, loads the last chat on opening chat + continue_last_chat = false, + -- When chat is cleared with `gx` delete the chat from history + delete_on_clearing_chat = false, + -- Directory path to save the chats + dir_to_save = vim.fn.stdpath "data" .. "/codecompanion-history", + -- Enable detailed logging for history extension + enable_logging = false, + + -- Summary system + summary = { + -- Keymap to generate summary for current chat (default: "gcs") + create_summary_keymap = "gcs", + -- Keymap to browse summaries (default: "gbs") + browse_summaries_keymap = "gbs", + generation_opts = { + adapter = "copilot", -- Use copilot for cheaper summary generation + model = "gpt-4.1", -- Use cheaper model for summaries + context_size = 90000, -- max tokens that the model supports + include_references = true, -- include slash command content + include_tool_outputs = true, -- include tool execution results + system_prompt = nil, -- custom system prompt (string or function) + format_summary = nil, -- custom function to format generated summary + }, + }, + + -- Memory system (requires VectorCode CLI) + memory = { + -- Automatically index summaries when they are generated + auto_create_memories_on_summary_generation = false, -- Disabled by default + -- Path to the VectorCode executable + vectorcode_exe = "vectorcode", + -- Tool configuration + tool_opts = { + -- Default number of memories to retrieve + default_num = 10, + }, + -- Enable notifications for indexing progress + notify = true, + -- Index all existing memories on startup + index_on_startup = false, + }, + }, + }, }, } -- Show loading spinner when request is started diff --git a/lua/plugins/completition.lua b/lua/plugins/completition.lua index a21174b..91a7b89 100644 --- a/lua/plugins/completition.lua +++ b/lua/plugins/completition.lua @@ -32,7 +32,7 @@ return { -- 'super-tab' - Tab para aceptar, similar a VSCode -- 'enter' - Enter para aceptar -- 'none' - Sin atajos automáticos (defines los tuyos) - keymap = { + keymap = { preset = "default", -- Deshabilitar navegación con flechas ["<Up>"] = {}, @@ -87,6 +87,12 @@ return { name = "latex", module = "blink-cmp-latex", }, + lazydev = { + name = "LazyDev", + module = "lazydev.integrations.blink", + -- make lazydev completions top priority (see `:h blink.cmp`) + score_offset = 100, + }, }, }, diff --git a/lua/plugins/copilot-chat.lua b/lua/plugins/copilot-chat.lua index 9262258..c7decda 100644 --- a/lua/plugins/copilot-chat.lua +++ b/lua/plugins/copilot-chat.lua @@ -26,12 +26,7 @@ return { -- version = "v3.3.0", dependencies = { { "nvim-lua/plenary.nvim" }, - { - "ibhagwan/fzf-lua", - config = function() - require("fzf-lua").setup({}) - end - }, + { "nvim-telescope/telescope.nvim" }, -- Using telescope instead of fzf-lua }, opts = { -- question_header = "## User ", diff --git a/lua/plugins/dressing.lua b/lua/plugins/dressing.lua index edf6806..188453b 100644 --- a/lua/plugins/dressing.lua +++ b/lua/plugins/dressing.lua @@ -78,7 +78,7 @@ return { enabled = true, -- Enable for better selection UI -- ========== Backend Priority ========== - backend = { "telescope", "fzf_lua", "builtin", "nui" }, + backend = { "telescope", "builtin", "nui" }, trim_prompt = true, -- ========== Telescope Integration ========== @@ -102,15 +102,6 @@ return { }, }, - -- ========== FZF Lua Configuration ========== - fzf_lua = { - winopts = { - width = 0.7, - height = 0.6, - border = "rounded", - }, - }, - -- ========== NUI Configuration ========== nui = { position = "50%", diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index c7f6d52..1ba462f 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -14,13 +14,6 @@ return { event = "VeryLazy", }, { - "folke/neodev.nvim", - dependencies = { - "neovim/nvim-lspconfig", -- Required by neodev for lspconfig.util - }, - event = "VeryLazy", - }, - { "williamboman/mason-lspconfig.nvim", event = "VeryLazy", }, |