mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-04-25 18:28:41 +02:00
feat: neovim - add flash.nvim
This commit is contained in:
@@ -272,6 +272,28 @@ return {
|
||||
end
|
||||
},
|
||||
|
||||
-- Flash enhances the built-in search/jump functionality.
|
||||
{
|
||||
"folke/flash.nvim",
|
||||
event = "VeryLazy",
|
||||
vscode = true,
|
||||
---@type Flash.Config
|
||||
opts = {},
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
-- Normal, Visual, or Operator-pending modes
|
||||
{ "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" },
|
||||
-- confict with nvim-surround's keys
|
||||
{ "S", mode = { "n", "o", "x" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" },
|
||||
-- command: yr
|
||||
{ "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" },
|
||||
-- command: yR
|
||||
{ "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" },
|
||||
-- <ctrl + s>, Command-line mode(prefix: `:`)
|
||||
{ "<c-s>", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" },
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
'nvim-telescope/telescope.nvim', branch = '0.1.x',
|
||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||
|
||||
@@ -10,7 +10,7 @@ require("telescope").load_extension("yank_history")
|
||||
require("telescope").load_extension("undo")
|
||||
|
||||
return {
|
||||
-- first key is the mode
|
||||
-- normal mode
|
||||
n = {
|
||||
-- second key is the lefthand side of the map
|
||||
-- mappings seen under group name "Buffer"
|
||||
@@ -48,10 +48,12 @@ return {
|
||||
["gP" ] = { "<cmd>lua require('goto-preview').close_all_win()<CR>", desc="close_all_win" },
|
||||
["gpr"] = { "<cmd>lua require('goto-preview').goto_preview_references()<CR>", desc="goto_preview_references" },
|
||||
},
|
||||
-- Visual mode
|
||||
v = {
|
||||
-- search and replace globally
|
||||
['<leader>sw'] = {'<esc><cmd>lua require("spectre").open_visual()<CR>', desc = "Search current word" },
|
||||
},
|
||||
-- visual mode(what's the difference between v and x???)
|
||||
x = {
|
||||
-- refactoring
|
||||
["<leader>ri"] = { function() require('refactoring').refactor('Inline Variable') end, desc = "Inverse of extract variable" },
|
||||
@@ -64,8 +66,4 @@ return {
|
||||
["p"] = {"<Plug>(YankyPutAfter)", desc="YankyPutAfter" },
|
||||
["P"] = {"<Plug>(YankyPutBefore)", desc="YankyPutBefore" },
|
||||
},
|
||||
t = {
|
||||
-- setting a mapping to false will disable it
|
||||
-- ["<esc>"] = false,
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user