From 56758415b40197ff1e7dab653ab24af58727aa4e Mon Sep 17 00:00:00 2001 From: Elvis Claros Castro Date: Sat, 17 Aug 2024 18:37:18 -0300 Subject: Feat: update all --- lua/config/keymaps.lua | 108 ++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 94 insertions(+), 14 deletions(-) (limited to 'lua/config/keymaps.lua') diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua index 70f7511..73478de 100644 --- a/lua/config/keymaps.lua +++ b/lua/config/keymaps.lua @@ -69,21 +69,101 @@ map( { desc = "Save the current file and source it for .vim and .lua files" } ) -map("n", "vn", vim.diagnostic.goto_next, { desc = "Goes to next diagnostic error" }) -map("n", "vp", vim.diagnostic.goto_prev, { desc = "Goes to prev diagnostic error" }) +-- map("n", "vn", vim.diagnostic.goto_next, { desc = "Goes to next diagnostic error" }) +-- map("n", "vp", vim.diagnostic.goto_prev, { 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("n", "ss", function() require('nvim-python-repl').send_statement_definition() end, { desc = "Send semantic unit to REPL"}) -vim.api.nvim_set_keymap('n', '', [[:lua require('nvim-python-repl').send_statement_definition()j]], {noremap = true, silent = true}) -vim.api.nvim_set_keymap('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", "rl",function() require('rust-tools').inlay_hints.enable() end, {desc = "Enable inlay hints auto update and set them for all the buffers"}) -map("n", "rdl",function() require('rust-tools').inlay_hints.disable() end, {desc = "Disable inlay hints auto update and unset them for all buffers"}) -map("n", "rrn", function () require('rust-tools').runnables.runnables() end, {desc = "run rust"}) -map("n", "-", "Oil", { desc = "Open parent directory" }) -map("n", "fg", function() require('telescope').extensions.live_grep_args.live_grep_args() end, {desc = "run grep"}) +vim.api.nvim_set_keymap( + 'n', + '', + [[:lua require('nvim-python-repl').send_statement_definition()j]], + {noremap = true, silent = true} +) +vim.api.nvim_set_keymap( + '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", +-- "rl", +-- function() require('rust-tools').inlay_hints.enable() end, +-- {desc = "Enable inlay hints auto update and set them for all the buffers"} +-- ) +-- map( +-- "n", +-- "rdl", +-- function() require('rust-tools').inlay_hints.disable() end, +-- {desc = "Disable inlay hints auto update and unset them for all buffers"} +-- ) +-- map( +-- "n", +-- "rrn", +-- function () require('rust-tools').runnables.runnables() end, +-- {desc = "run rust"} +-- ) +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 } +) -- cgit v1.2.3