From 815585895f1446f32dc2d3ff419c375d6a83d5c8 Mon Sep 17 00:00:00 2001 From: zhao_wei_nan <326747337@qq.com> Date: Sat, 1 Jul 2023 15:57:13 +0800 Subject: [PATCH] feat(motion): add move plugin flash nvim --- .../motion/flash-nvim/README.md | 23 +++++++++++++ lua/astrocommunity/motion/flash-nvim/init.lua | 32 +++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 lua/astrocommunity/motion/flash-nvim/README.md create mode 100644 lua/astrocommunity/motion/flash-nvim/init.lua diff --git a/lua/astrocommunity/motion/flash-nvim/README.md b/lua/astrocommunity/motion/flash-nvim/README.md new file mode 100644 index 000000000..78075dd95 --- /dev/null +++ b/lua/astrocommunity/motion/flash-nvim/README.md @@ -0,0 +1,23 @@ +# flash.nvim + +`flash.nvim` lets you navigate your code with search labels, enhanced character motions, and Treesitter integration. + +**Repository:** + +## ✨ Features + +- 🔍 **Search Integration**: integrate **flash.nvim** with your regular + search using `/` or `?`. Labels appear next to the matches, + allowing you to quickly jump to any location. Labels are + guaranteed not to exist as a continuation of the search pattern. +- ⌨️ **type as many characters as you want** before using a jump label. +- ⚡ **Enhanced `f`, `t`, `F`, `T` motions** +- 🌳 **Treesitter Integration**: all parents of the Treesitter node + under your cursor are highlighted with a label for quick selection + of a specific Treesitter node. +- 🎯 **Jump Mode**: a standalone jumping mode similar to search +- 🔎 **Search Modes**: `exact`, `search` (regex), and `fuzzy` search modes +- 🪟 **Multi Window** jumping +- 🌐 **Remote Actions**: perform motions in remote locations +- ⚫ **dot-repeatable** jumps +- 📡 **highly extensible**: check the [examples](https://github.com/folke/flash.nvim#-examples) diff --git a/lua/astrocommunity/motion/flash-nvim/init.lua b/lua/astrocommunity/motion/flash-nvim/init.lua new file mode 100644 index 000000000..2bef8af97 --- /dev/null +++ b/lua/astrocommunity/motion/flash-nvim/init.lua @@ -0,0 +1,32 @@ +return { + "folke/flash.nvim", + event = "VeryLazy", + vscode = true, + opts = {}, + keys = { + { + "s", + mode = { "n", "x", "o" }, + function() require("flash").jump() end, + desc = "Flash", + }, + { + "S", + mode = { "n", "o", "x" }, + function() require("flash").treesitter() end, + desc = "Flash Treesitter", + }, + { + "r", + mode = "o", + function() require("flash").remote() end, + desc = "Remote Flash", + }, + { + "R", + mode = { "o", "x" }, + function() require("flash").treesitter_search() end, + desc = "Treesitter Search", + }, + }, +}