-
Notifications
You must be signed in to change notification settings - Fork 727
Regex
Bruno Heridet edited this page Oct 3, 2017
·
6 revisions
In kakoune, many prompts or commands require a regex:
- search
/
,?
- select
s
- split
S
- keep
<a-k>
- not keep
<a-K>
- …
As stated in the README, the regex syntax supported is the Perl syntax currently provided by Boost: Perl Regular Expression Syntax.
This page lists common patterns you may need to better express your intent.
You can set user mappings to pre-fill prompts with the ones you need often. Here's an example with search
and the \Q\E
mentioned below:
map global user / ':exec /<ret>\Q\E<left><left>'
(<left><left>
move the cursor back where you need it to be)
It is possible to make case insensitive regex by prefixing the expression with (?i)
.
Use the Quote flags, by surrounding your query with \Q
and \E
. Everything in between will be treated literally.
- Normal mode commands
- Avoid the escape key
- Implementing user mode (Leader key)
- Kakoune explain
- Kakoune TV