From 1fd0af14d592d612c2aaab7717c04c8806ba3daa Mon Sep 17 00:00:00 2001 From: Elvis Claros Castro Date: Thu, 11 Jul 2024 05:12:18 -0300 Subject: Feat: Todo actulizado --- lua/config/autocmds.lua | 12 ++++++++++++ lua/config/keymaps.lua | 7 ++++++- 2 files changed, 18 insertions(+), 1 deletion(-) (limited to 'lua/config') diff --git a/lua/config/autocmds.lua b/lua/config/autocmds.lua index c178f44..b62150e 100644 --- a/lua/config/autocmds.lua +++ b/lua/config/autocmds.lua @@ -37,3 +37,15 @@ vim.api.nvim_create_autocmd({ "BufWritePre" }, { vim.cmd [[%s/\s\+$//e]] end, }) + +if vim.fn.has("persistent_undo") then + local target_path = vim.fn.expand('~/.cache/undodir') + -- crear el directorio y cualquier directorio padre + -- si la ubicación no existe. + if not vim.fn.isdirectory(target_path) then + vim.fn.mkdir(target_path, "p", 0700) + end + + vim.o.undodir = target_path + vim.o.undofile = true +end diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua index cf70ef0..d56b536 100644 --- a/lua/config/keymaps.lua +++ b/lua/config/keymaps.lua @@ -32,6 +32,8 @@ map("n", "", ":cprevzz", { desc = "Goes to the previous item in the qui -- map("n", "o", ":lprevzz") map("n", "cc", ":cclose", { desc = "Close the quick fix list" }) +map("n", "tc", ":TSContextToggle", { desc = "Toggle treesitter context" }) + -- tabulation map("v", "<", "", ">gv", { desc = "Indent in and keeps the selection" }) @@ -72,7 +74,9 @@ map("n", "vp", vim.diagnostic.goto_prev, { desc = "Goes to prev diagnost map("v", "q", require('alpha.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"}) +-- 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"}) @@ -82,3 +86,4 @@ map("n", "rl",function() require('rust-tools').inlay_hints.enable() end, 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"}) -- cgit v1.2.3