diff options
| author | Marcelo <setanta@gmail.com> | 2025-03-30 04:26:45 -0300 |
|---|---|---|
| committer | Marcelo <setanta@gmail.com> | 2025-03-30 04:26:45 -0300 |
| commit | 5431699795570147e1382223bcb37e2b8522a6fd (patch) | |
| tree | d3a4afcaaf0f8901af87d29f7633ab0b6623f129 | |
| parent | a25552fd567f0efb76239d0580fae4357e874c74 (diff) | |
Add keybinds to save changed buffers.
And another to reopen the last telescope search.
| -rw-r--r-- | init.lua | 7 | ||||
| -rw-r--r-- | lua/config/plugins/telescope.lua | 2 |
2 files changed, 9 insertions, 0 deletions
@@ -52,6 +52,12 @@ vim.opt.shiftwidth = 2 vim.keymap.set("n", "<ESC>", "<CMD>nohlsearch<CR>") +vim.keymap.set("n", "<Leader>s", "<CMD>wall<CR>", { desc = "Save all changed buffers" }) +vim.keymap.set("n", "<Leader>s", function() + vim.cmd[[wall]] + vim.notify("Changed buffers saved.") +end, { desc = "Save all changed buffers" }) + -- When I forgot that vim is o insert mode. vim.keymap.set("i", "jj", "<ESC>") @@ -73,6 +79,7 @@ vim.keymap.set({ "i", "x" }, "<C-s>", "<ESC><CMD>silent! update | redraw<CR>", { vim.keymap.set("n", "<Leader>-", "<CMD>Oil<CR>", { desc = "Open Oil" }) +-- Quickfix and location list navigation. vim.keymap.set("n", "<C-d>", "<C-d>zz") vim.keymap.set("n", "<C-u>", "<C-u>zz") vim.keymap.set("n", "<C-k>", "<cmd>cnext<CR>zz") diff --git a/lua/config/plugins/telescope.lua b/lua/config/plugins/telescope.lua index e55fc17..dbe844e 100644 --- a/lua/config/plugins/telescope.lua +++ b/lua/config/plugins/telescope.lua @@ -83,6 +83,8 @@ return { vim.keymap.set("n", "<Leader>f", builtin.live_grep, { desc = "Search file contents" }) vim.keymap.set("n", "<Leader>F", builtin.grep_string, { desc = "Search for the string under the cursor" }) + vim.keymap.set("n", "<Leader>r", builtin.resume, { desc = "Open last telescope search" }) + vim.keymap.set("n", "<Leader>m", function() builtin.treesitter({ symbols = "function", |
