diff options
Diffstat (limited to 'lua/config/keymaps.lua')
| -rw-r--r-- | lua/config/keymaps.lua | 108 |
1 files changed, 94 insertions, 14 deletions
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", "<leader>vn", vim.diagnostic.goto_next, { desc = "Goes to next diagnostic error" }) -map("n", "<leader>vp", vim.diagnostic.goto_prev, { desc = "Goes to prev diagnostic error" }) +-- map("n", "<leader>vn", vim.diagnostic.goto_next, { desc = "Goes to next diagnostic error" }) +-- map("n", "<leader>vp", vim.diagnostic.goto_prev, { desc = "Goes to prev diagnostic error" }) +map( + "n", + "<leader>vn", + function() vim.diagnostic.jump({ count = 1, float = true }) end, + { desc = "Goes to next diagnostic error" } +) +map( + "n", + "<leader>vp", + function() vim.diagnostic.jump({ count = -1, float = true }) end, + { desc = "Goes to prev diagnostic error" } +) map("v", "<leader>q", require('pi.select_to_quickfix').handle) map('n', '99', ':set invspell<CR>', { noremap = true }) -- map("n", "<leader>ss", function() require('nvim-python-repl').send_statement_definition() end, { desc = "Send semantic unit to REPL"}) -vim.api.nvim_set_keymap('n', '<C-Enter>', [[<Esc>:lua require('nvim-python-repl').send_statement_definition()<CR>j]], {noremap = true, silent = true}) -vim.api.nvim_set_keymap('i', '<C-Enter>', [[<Esc>:lua require('nvim-python-repl').send_statement_definition()<CR>i]], {noremap = true, silent = true}) -map("n", "<leader>sl", function() require('nvim-python-repl').send_visual_to_repl() end, { desc = "Send visual selection to REPL"}) -map("v", "<leader>sl", function() require('nvim-python-repl').send_visual_to_repl() end, { desc = "Send visual selection to REPL"}) -map("n", "<leader>MReturn", function() require('nvim-python-repl').send_buffer_to_repl() end, { desc = "Send entire buffer to REPL"}) -map("n", "<leader>e", function() require('nvim-python-repl').toggle_execute() end, { desc = "Automatically execute command in REPL after sent"}) -map("n", "<leader>vi", function() require('nvim-python-repl').toggle_vertical() end, { desc = "Create REPL in vertical or horizontal split"}) -map("n", "<leader>rl",function() require('rust-tools').inlay_hints.enable() end, {desc = "Enable inlay hints auto update and set them for all the buffers"}) -map("n", "<leader>rdl",function() require('rust-tools').inlay_hints.disable() end, {desc = "Disable inlay hints auto update and unset them for all buffers"}) -map("n", "<leader>rrn", function () require('rust-tools').runnables.runnables() end, {desc = "run rust"}) -map("n", "-", "<CMD>Oil<CR>", { desc = "Open parent directory" }) -map("n", "<leader>fg", function() require('telescope').extensions.live_grep_args.live_grep_args() end, {desc = "run grep"}) +vim.api.nvim_set_keymap( + 'n', + '<C-Enter>', + [[<Esc>:lua require('nvim-python-repl').send_statement_definition()<CR>j]], + {noremap = true, silent = true} +) +vim.api.nvim_set_keymap( + 'i', + '<C-Enter>', + [[<Esc>:lua require('nvim-python-repl').send_statement_definition()<CR>i]], + {noremap = true, silent = true} +) +map( + "n", + "<leader>sl", + function() require('nvim-python-repl').send_visual_to_repl() end, + { desc = "Send visual selection to REPL"} +) +map( + "v", + "<leader>sl", + function() require('nvim-python-repl').send_visual_to_repl() end, + { desc = "Send visual selection to REPL"} +) +map( + "n", + "<leader>MReturn", + function() require('nvim-python-repl').send_buffer_to_repl() end, + { desc = "Send entire buffer to REPL"} +) +map( + "n", + "<leader>e", + function() require('nvim-python-repl').toggle_execute() end, + { desc = "Automatically execute command in REPL after sent"} +) +map( + "n", + "<leader>vi", + function() require('nvim-python-repl').toggle_vertical() end, + { desc = "Create REPL in vertical or horizontal split"} +) +-- map( +-- "n", +-- "<leader>rl", +-- function() require('rust-tools').inlay_hints.enable() end, +-- {desc = "Enable inlay hints auto update and set them for all the buffers"} +-- ) +-- map( +-- "n", +-- "<leader>rdl", +-- function() require('rust-tools').inlay_hints.disable() end, +-- {desc = "Disable inlay hints auto update and unset them for all buffers"} +-- ) +-- map( +-- "n", +-- "<leader>rrn", +-- function () require('rust-tools').runnables.runnables() end, +-- {desc = "run rust"} +-- ) +map( + "n", + "-", + "<CMD>Oil<CR>", + { desc = "Open parent directory" } +) +map( + "n", + "<leader>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', + '<leader>w', + ':lua ToggleWrap()<CR>', + { noremap = true, silent = true } +) |