Skip to content

Commit

Permalink
feat(motion): add move plugin flash nvim (#340)
Browse files Browse the repository at this point in the history
  • Loading branch information
chaozwn authored Jul 1, 2023
1 parent 8b30fd6 commit 86815e1
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
23 changes: 23 additions & 0 deletions lua/astrocommunity/motion/flash-nvim/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# flash.nvim

`flash.nvim` lets you navigate your code with search labels, enhanced character motions, and Treesitter integration.

**Repository:** <https://github.com/folke/flash.nvim>

## ✨ 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)
32 changes: 32 additions & 0 deletions lua/astrocommunity/motion/flash-nvim/init.lua
Original file line number Diff line number Diff line change
@@ -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",
},
},
}

2 comments on commit 86815e1

@Cyberczy
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I checkhealth, my nvim prompts - WARNING {flash.nvim}: unknown key .

@Cyberczy
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VS Code: some functionality is changed/disabled when running flash in VS Code:
prompt is disabled
highlights are set to different defaults that will actually work in VS Code
search.multi_window is disabled, since VS Code has problems with vim.api.nvim_set_current_win

Please sign in to comment.