diff --git a/NEWS.md b/NEWS.md index 9342acb2..9bb6809a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -18,6 +18,16 @@ Going forward, **LazyVim** requires **Neovim** `>= 0.11.2`, and drops support fo - enabled [blink.cmp](https://github.com/saghen/blink.cmp) **cmdline** completions - use **LSP** based folding when available (disable with `nvim-lspconfig.folds.enabled = false`) +### Keymaps + +- `uH` to toggle LSP Codelens [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig) +- `sp` to pick a picker [fzf-lua](https://github.com/ibhagwan/fzf-lua) +- `xh` to show file hunks as Quickfix [gitsigns](https://github.com/lewis6991/gitsigns.nvim) +- `xH` to show project hunks as Quickfix [gitsigns](https://github.com/lewis6991/gitsigns.nvim) +- `uB` to toggle current line blame [gitsigns](https://github.com/lewis6991/gitsigns.nvim) +- `uW` to toggle word diff [gitsigns](https://github.com/lewis6991/gitsigns.nvim) +- `rI` to inline function [refactoring](https://github.com/ThePrimeagen/refactoring.nvim) + ## 14.x Big new release with a lot of changes and improvements! diff --git a/lua/lazyvim/config/keymaps.lua b/lua/lazyvim/config/keymaps.lua index 9651e4e6..dc3acfb2 100644 --- a/lua/lazyvim/config/keymaps.lua +++ b/lua/lazyvim/config/keymaps.lua @@ -153,6 +153,7 @@ Snacks.toggle.option("background", { off = "light", on = "dark" , name = "Dark B Snacks.toggle.dim():map("uD") Snacks.toggle.animate():map("ua") Snacks.toggle.indent():map("ug") +Snacks.toggle.codelens():map("uH") Snacks.toggle.scroll():map("uS") Snacks.toggle.profiler():map("dpp") Snacks.toggle.profiler_highlights():map("dph") diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index ce7a068c..864e7b3b 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -184,6 +184,9 @@ return { map("n", "ghd", gs.diffthis, "Diff This") map("n", "ghD", function() gs.diffthis("~") end, "Diff This ~") map({ "o", "x" }, "ih", ":Gitsigns select_hunk", "GitSigns Select Hunk") + + map("n", "xh", gs.setqflist, "Git hunks (file)") + map("n", "xH", function() gs.setqflist("all") end, "Git hunks (all)") end, }, }, @@ -199,6 +202,24 @@ return { require("gitsigns").toggle_signs(state) end, }):map("uG") + Snacks.toggle({ + name = "Git Line Blame", + get = function() + return require("gitsigns.config").config.current_line_blame + end, + set = function(state) + require("gitsigns").toggle_current_line_blame(state) + end, + }):map("uB") + Snacks.toggle({ + name = "Git Word Diff", + get = function() + return require("gitsigns.config").config.word_diff + end, + set = function(state) + require("gitsigns").toggle_word_diff(state) + end, + }):map("uW") end, }, diff --git a/lua/lazyvim/plugins/extras/editor/fzf.lua b/lua/lazyvim/plugins/extras/editor/fzf.lua index 4f703405..3634b067 100644 --- a/lua/lazyvim/plugins/extras/editor/fzf.lua +++ b/lua/lazyvim/plugins/extras/editor/fzf.lua @@ -249,6 +249,7 @@ return { { "sl", "FzfLua loclist", desc = "Location List" }, { "sM", "FzfLua man_pages", desc = "Man Pages" }, { "sm", "FzfLua marks", desc = "Jump to Mark" }, + { "sp", "FzfLua builtin fuzzy=true", desc = "FZF pickers" }, { "sR", "FzfLua resume", desc = "Resume" }, { "sq", "FzfLua quickfix", desc = "Quickfix List" }, { "sw", LazyVim.pick("grep_cword"), desc = "Word (Root Dir)" }, diff --git a/lua/lazyvim/plugins/extras/editor/refactoring.lua b/lua/lazyvim/plugins/extras/editor/refactoring.lua index 11ab3786..dedc9f11 100644 --- a/lua/lazyvim/plugins/extras/editor/refactoring.lua +++ b/lua/lazyvim/plugins/extras/editor/refactoring.lua @@ -46,6 +46,15 @@ return { desc = "Inline Variable", expr = true, }, + { + "rI", + function() + return require("refactoring").refactor("Inline Function") + end, + mode = { "n", "x" }, + desc = "Inline Function", + expr = true, + }, { "rb", function() @@ -113,14 +122,6 @@ return { desc = "Extract Variable", expr = true, }, - { - "rp", - function() - require("refactoring").debug.print_var() - end, - mode = { "n", "x" }, - desc = "Debug Print Variable", - }, }, opts = { prompt_func_return_type = {