1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 22:20:06 +08:00
SpaceVim/docs/layers/foldsearch.md

51 lines
1.2 KiB
Markdown
Raw Normal View History

2020-04-26 18:49:22 +08:00
---
title: "SpaceVim foldsearch layer"
description: "This layer provides functions that fold away lines that don't match a specific search pattern."
---
# [Available Layers](../) >> foldsearch
<!-- vim-markdown-toc GFM -->
2020-04-27 23:28:19 +08:00
- [Intro](#intro)
- [Install](#install)
2020-04-28 13:24:37 +08:00
- [Options](#options)
2020-04-26 18:49:22 +08:00
- [Key bindings](#key-bindings)
<!-- vim-markdown-toc -->
2020-04-27 23:28:19 +08:00
## Intro
2020-04-26 18:49:22 +08:00
This layer provides functions that fold away lines that don't match a specific search pattern.
2020-04-27 23:28:19 +08:00
The search pattern can be a word or a regular expression.
## Install
To use this layer, add it to your configuration file.
2020-04-26 18:49:22 +08:00
```toml
[[layers]]
2020-04-26 18:49:22 +08:00
name = "foldsearch"
```
2021-06-21 20:39:29 +08:00
This layer requires at least one search tool: `ag`, `rg`, `ack`, `pt` and `grep`, Choose your favorite one.
2020-04-27 23:28:19 +08:00
2020-04-28 13:24:37 +08:00
## Options
2021-06-21 20:39:29 +08:00
- foldsearch_highlight: a boolean option to enable/disabled highlight. Enabled by default. To disable the highlight:
2020-04-28 13:24:37 +08:00
```toml
[[layers]]
2020-04-28 13:24:37 +08:00
name = "foldsearch"
foldsearch_highlight = false
```
2020-04-26 18:49:22 +08:00
## Key bindings
2020-04-27 23:28:19 +08:00
| Key bindings | Description |
| ------------ | ----------------------------- |
| `SPC F w` | foldsearch input word |
| `SPC F W` | foldsearch cursor word |
2020-04-28 13:24:37 +08:00
| `SPC F p` | foldsearch regular expression |
| `SPC F e` | end foldsearch |