5 Commits

Author SHA1 Message Date
Andreas Guth
ba664672b6 Merge a496fe2cb7 into 9815a55dbc 2024-09-12 04:34:39 +00:00
Gordin
a496fe2cb7 fixed documentation 2020-07-02 00:46:49 +02:00
Gordin
bc76930333 Added hjkl to documentation 2020-07-01 23:51:31 +02:00
Gordin
207482468a typo 2020-07-01 23:32:32 +02:00
Gordin
a8a8feb8a5 Makes hjkl work like arrow keys in live mode 2020-07-01 23:30:17 +02:00
2 changed files with 26 additions and 20 deletions

View File

@@ -752,16 +752,16 @@ function! s:interactive(range, modes, n, d, opts, rules, vis, bvis)
else
let s:live = 1
endif
elseif c == "\<Left>"
elseif c == "\<Left>" || ch == "h"
let opts['stl'] = 1
let opts['lm'] = 0
elseif c == "\<Right>"
elseif c == "\<Right>" || ch == "l"
let opts['stl'] = 0
let opts['lm'] = 1
elseif c == "\<Down>"
elseif c == "\<Down>" || ch == "j"
let opts['lm'] = 0
let opts['rm'] = 0
elseif c == "\<Up>"
elseif c == "\<Up>" || ch == "k"
silent! call remove(opts, 'stl')
silent! call remove(opts, 'lm')
silent! call remove(opts, 'rm')

View File

@@ -279,7 +279,7 @@ to align text around all occurrences of numbers:
- <Enter>
- `*`
- CTRL-X
- `[0-9]\+`
- `[0-9]\+`
Alignment options in interactive mode~
@@ -290,21 +290,27 @@ While in interactive mode, you can set alignment options using special
shortcut keys listed below. The meaning of each option will be described in
{the following sections}{6}.
--------+--------------------+---------------------------------------------------
Key | Option | Values ~
--------+--------------------+---------------------------------------------------
CTRL-F | `filter` | Input string ( `[gv]/.*/?` )
CTRL-I | `indentation` | shallow, deep, none, keep
CTRL-L | `left_margin` | Input number or string
CTRL-R | `right_margin` | Input number or string
CTRL-D | `delimiter_align` | left, center, right
CTRL-U | `ignore_unmatched` | 0, 1
CTRL-G | `ignore_groups` | [], ["String'], ["Comment'], ["String', "Comment']
CTRL-A | `align` | Input string ( `/[lrc]+\*{0,2}/` )
<Left> | `stick_to_left` | `{ 'stick_to_left': 1, 'left_margin': 0 }`
<Right> | `stick_to_left` | `{ 'stick_to_left': 0, 'left_margin': 1 }`
<Down> | `*_margin` | `{ 'left_margin': 0, 'right_margin': 0 }`
--------+--------------------+---------------------------------------------------
--------+----------------------+---------------------------------------------
Key | Option | Values ~
--------+----------------------+---------------------------------------------
CTRL-F | `filter` | Input string ( `[gv]/.*/?` )
CTRL-I | `indentation` | shallow, deep, none, keep
CTRL-L | `left_margin` | Input number or string
CTRL-R | `right_margin` | Input number or string
CTRL-D | `delimiter_align` | left, center, right
CTRL-U | `ignore_unmatched` | 0, 1
CTRL-G | `ignore_groups` | [], ["String'], ["Comment'],
| | ["String', "Comment']
CTRL-A | `align` | Input string ( `/[lrc]+\*{0,2}/` )
<Left> | `stick_to_left` | `{ 'left_margin': 0, 'stick_to_left': 1 }`
h | `stick_to_left` | `{ 'left_margin': 0, 'stick_to_left': 1 }`
<Right> | `stick_to_left` | `{ 'left_margin': 1, 'stick_to_left': 0 }`
l | `stick_to_left` | `{ 'left_margin': 1, 'stick_to_left': 0 }`
<Down> | `*_margin` | `{ 'left_margin': 0, 'right_margin': 0 }`
j | `*_margin` | `{ 'left_margin': 0, 'right_margin': 0 }`
<Up> | `reset_stl_and_margin` | `{ 'left_margin': 1, 'right_margin': 1 }`
k | `reset_stl_and_margin` | `{ 'left_margin': 1, 'right_margin': 1 }`
--------+----------------------+---------------------------------------------
{6} https://github.com/junegunn/vim-easy-align#alignment-options