From bcb5775dabf2b9144d8a87721d0095d087827f3e Mon Sep 17 00:00:00 2001 From: Elvis Claros Castro Date: Sat, 30 Aug 2025 15:00:26 -0300 Subject: =?UTF-8?q?feat(keymaps,=20plugins):=20agrega=20integraci=C3=B3n?= =?UTF-8?q?=20con=20Floaterm=20y=20elimina=20Harpoon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Se añadió el plugin Floaterm para soporte de terminal flotante, incluyendo el mapeo ft para alternar el terminal. - Se eliminó el plugin Harpoon y sus mapeos relacionados para navegación de archivos y terminales. - Se refactorizaron los mapeos de teclas para mayor consistencia y legibilidad. - Motivación: simplificar el flujo de trabajo con terminales y reducir la cantidad de plugins reemplazando Harpoon por Floaterm. --- lua/config/keymaps.lua | 126 +++++++++++++++++------------------------------ lua/plugins/foatterm.lua | 6 +++ lua/plugins/harpoon.lua | 72 --------------------------- 3 files changed, 50 insertions(+), 154 deletions(-) create mode 100644 lua/plugins/foatterm.lua delete mode 100644 lua/plugins/harpoon.lua (limited to 'lua') diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua index c42bf71..07c9d77 100644 --- a/lua/config/keymaps.lua +++ b/lua/config/keymaps.lua @@ -1,9 +1,9 @@ local map = vim.keymap.set map("v", "p", function() - local val = vim.fn.getreg '+' + local val = vim.fn.getreg "+" vim.api.nvim_command [[normal! p]] - vim.fn.setreg('+', val) + vim.fn.setreg("+", val) end, { desc = "Special paste, paste without replacing copy register content" }) map("n", "mm", function() @@ -69,98 +69,60 @@ map( { desc = "Save the current file and source it for .vim and .lua files" } ) -map( - "n", - "vn", - function() vim.diagnostic.jump({ count = 1, float = true }) end, - { desc = "Goes to next diagnostic error" } -) -map( - "n", - "vp", - function() vim.diagnostic.jump({ count = -1, float = true }) end, - { desc = "Goes to prev diagnostic error" } -) +map("n", "vn", function() + vim.diagnostic.jump { count = 1, float = true } +end, { desc = "Goes to next diagnostic error" }) +map("n", "vp", function() + vim.diagnostic.jump { count = -1, float = true } +end, { desc = "Goes to prev diagnostic error" }) -map("v", "q", require('pi.select_to_quickfix').handle) -map('n', '99', ':set invspell', { noremap = true }) +map("v", "q", require("pi.select_to_quickfix").handle) +map("n", "99", ":set invspell", { noremap = true }) -- map("n", "ss", function() require('nvim-python-repl').send_statement_definition() end, { desc = "Send semantic unit to REPL"}) vim.api.nvim_set_keymap( - 'n', - '', + "n", + "", [[:lua require('nvim-python-repl').send_statement_definition()j]], - {noremap = true, silent = true} + { noremap = true, silent = true } ) vim.api.nvim_set_keymap( - 'i', - '', + "i", + "", [[:lua require('nvim-python-repl').send_statement_definition()i]], - {noremap = true, silent = true} -) -map( - "n", - "sl", - function() require('nvim-python-repl').send_visual_to_repl() end, - { desc = "Send visual selection to REPL"} -) -map( - "v", - "sl", - function() require('nvim-python-repl').send_visual_to_repl() end, - { desc = "Send visual selection to REPL"} -) -map( - "n", - "MReturn", - function() require('nvim-python-repl').send_buffer_to_repl() end, - { desc = "Send entire buffer to REPL"} -) -map( - "n", - "e", - function() require('nvim-python-repl').toggle_execute() end, - { desc = "Automatically execute command in REPL after sent"} -) -map( - "n", - "vi", - function() require('nvim-python-repl').toggle_vertical() end, - { desc = "Create REPL in vertical or horizontal split"} -) -map( - "n", - "-", - "Oil", - { desc = "Open parent directory" } -) -map( - "n", - "fg", - function() require('telescope').extensions.live_grep_args.live_grep_args() end, - {desc = "run grep"} + { noremap = true, silent = true } ) +map("n", "sl", function() + require("nvim-python-repl").send_visual_to_repl() +end, { desc = "Send visual selection to REPL" }) +map("v", "sl", function() + require("nvim-python-repl").send_visual_to_repl() +end, { desc = "Send visual selection to REPL" }) +map("n", "MReturn", function() + require("nvim-python-repl").send_buffer_to_repl() +end, { desc = "Send entire buffer to REPL" }) +map("n", "e", function() + require("nvim-python-repl").toggle_execute() +end, { desc = "Automatically execute command in REPL after sent" }) +map("n", "vi", function() + require("nvim-python-repl").toggle_vertical() +end, { desc = "Create REPL in vertical or horizontal split" }) +map("n", "-", "Oil", { desc = "Open parent directory" }) +map("n", "fg", function() + require("telescope").extensions.live_grep_args.live_grep_args() +end, { desc = "run grep" }) -- Asignar la función a una tecla específica -vim.api.nvim_set_keymap( - 'n', - 'w', - ':lua ToggleWrap()', - { noremap = true, silent = true } -) -map( - "n", - "rrn", - ':RustLsp runnables', - {desc = "run rust"} -) -vim.keymap.set('n', 'pdm', function() - require('dap-python').test_method() +vim.api.nvim_set_keymap("n", "w", ":lua ToggleWrap()", { noremap = true, silent = true }) +map("n", "rrn", ":RustLsp runnables", { desc = "run rust" }) +vim.keymap.set("n", "pdm", function() + require("dap-python").test_method() end) -vim.keymap.set('n', 'pdc', function() - require('dap-python').test_class() +vim.keymap.set("n", "pdc", function() + require("dap-python").test_class() end) -vim.keymap.set('n', 'pdf', function() - require('dap-python').test_file() +vim.keymap.set("n", "pdf", function() + require("dap-python").test_file() end) +map("n", "ft", "FloatermToggle", { desc = "run terminal" }) diff --git a/lua/plugins/foatterm.lua b/lua/plugins/foatterm.lua new file mode 100644 index 0000000..708241a --- /dev/null +++ b/lua/plugins/foatterm.lua @@ -0,0 +1,6 @@ +return { + "nvzone/floaterm", + dependencies = "nvzone/volt", + opts = {}, + cmd = "FloatermToggle", +} diff --git a/lua/plugins/harpoon.lua b/lua/plugins/harpoon.lua deleted file mode 100644 index a214924..0000000 --- a/lua/plugins/harpoon.lua +++ /dev/null @@ -1,72 +0,0 @@ -local keys = {} -local terms = 3 -local binds = 5 - -table.insert(keys, { - "ss", - function() - require("harpoon.ui").toggle_quick_menu() - end, - desc = "Harpoon Menu", -}) - -table.insert(keys, { - "sa", - function() - require("harpoon.mark").add_file() - end, - desc = "Harpoon Add file", -}) - -table.insert(keys, { - "st", - function() - vim.api.nvim_command [[vsplit]] - require("harpoon.term").gotoTerminal(1) - vim.api.nvim_command [[startinsert]] - end, - desc = "Harpoon quick split Terminal", -}) - -for i = 1, terms do - table.insert(keys, { - string.format("%s", i), - function() - require("harpoon.term").gotoTerminal(i) - end, - desc = "Harpoon go to terminal " .. i, - }) -end - -for i = 1, binds do - table.insert(keys, { - string.format("%s", i), - function() - require("harpoon.ui").nav_file(i) - end, - desc = "Harpoon go to file " .. i, - }) -end - -return { - "ThePrimeagen/harpoon", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-lua/popup.nvim", - }, - keys = keys, - opts = { - global_settings = { - enter_on_sendcmd = true, - }, - projects = { - ["$HOME/code/svelte/snippets"] = { - term = { - cmds = { - "npm run dev", - }, - }, - }, - }, - }, -} -- cgit v1.2.3