From a8a8feb8a571671ecaf158ef11c5d2349d81bd4d Mon Sep 17 00:00:00 2001 From: Gordin <9ordin@gmail.com> Date: Wed, 1 Jul 2020 23:30:17 +0200 Subject: [PATCH 1/4] Makes hjkl work like arrow keys in live mode --- autoload/easy_align.vim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/autoload/easy_align.vim b/autoload/easy_align.vim index 795ea31..96e058f 100644 --- a/autoload/easy_align.vim +++ b/autoload/easy_align.vim @@ -731,16 +731,16 @@ function! s:interactive(range, modes, n, d, opts, rules, vis, bvis) else let s:live = 1 endif - elseif c == "\" + elseif c == "\" || ch == "h" let opts['stl'] = 1 let opts['lm'] = 0 - elseif c == "\" + elseif c == "\" || ch == "l" let opts['stl'] = 0 let opts['lm'] = 1 - elseif c == "\" + elseif c == "\" || ch == "j" let opts['lm'] = 0 let opts['rm'] = 0 - elseif c == "\" + elseif c == "\" || ch == "k" silent! call remove(opts, 'stl') silent! call remove(opts, 'lm') silent! call remove(opts, 'rm') From 207482468a4d816a4aeedac4bbbc85ed24080ead Mon Sep 17 00:00:00 2001 From: Gordin <9ordin@gmail.com> Date: Wed, 1 Jul 2020 23:32:32 +0200 Subject: [PATCH 2/4] typo --- autoload/easy_align.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/easy_align.vim b/autoload/easy_align.vim index 96e058f..6e2bf05 100644 --- a/autoload/easy_align.vim +++ b/autoload/easy_align.vim @@ -737,7 +737,7 @@ function! s:interactive(range, modes, n, d, opts, rules, vis, bvis) elseif c == "\" || ch == "l" let opts['stl'] = 0 let opts['lm'] = 1 - elseif c == "\" || ch == "j" + elseif c == "\" || ch == "j" let opts['lm'] = 0 let opts['rm'] = 0 elseif c == "\" || ch == "k" From bc76930333fddf40879543056ec5182c450d7311 Mon Sep 17 00:00:00 2001 From: Gordin <9ordin@gmail.com> Date: Wed, 1 Jul 2020 23:51:31 +0200 Subject: [PATCH 3/4] Added hjkl to documentation --- doc/easy_align.txt | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/doc/easy_align.txt b/doc/easy_align.txt index 015d018..15807a2 100644 --- a/doc/easy_align.txt +++ b/doc/easy_align.txt @@ -279,7 +279,7 @@ to align text around all occurrences of numbers: - - `*` - 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}/` ) - | `stick_to_left` | `{ 'stick_to_left': 1, 'left_margin': 0 }` - | `stick_to_left` | `{ 'stick_to_left': 0, 'left_margin': 1 }` - | `*_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}/` ) + | `stick_to_left` | `{ 'left_margin': 0, 'stick_to_left': 1 }` + h | `stick_to_left` | `{ 'left_margin': 0, 'stick_to_left': 1 }` + | `stick_to_left` | `{ 'left_margin': 1, 'stick_to_left': 0 }` + l | `stick_to_left` | `{ 'left_margin': 1, 'stick_to_left': 0 }` + | `*_margin` | `{ 'left_margin': 0, 'right_margin': 0 }` + j | `*_margin` | `{ 'left_margin': 0, 'right_margin': 0 }` + | `reset_stl_and_margin` | `{ 'left_margin': 0, 'right_margin': 0 }` + k | `reset_stl_and_margin` | `{ 'left_margin': 0, 'right_margin': 0 }` + --------+----------------------+--------------------------------------------- {6} https://github.com/junegunn/vim-easy-align#alignment-options From a496fe2cb73da2a1fdf2b19ddf0676e393d9b44a Mon Sep 17 00:00:00 2001 From: Gordin <9ordin@gmail.com> Date: Thu, 2 Jul 2020 00:43:52 +0200 Subject: [PATCH 4/4] fixed documentation --- doc/easy_align.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/easy_align.txt b/doc/easy_align.txt index 15807a2..26e5a8f 100644 --- a/doc/easy_align.txt +++ b/doc/easy_align.txt @@ -308,8 +308,8 @@ shortcut keys listed below. The meaning of each option will be described in l | `stick_to_left` | `{ 'left_margin': 1, 'stick_to_left': 0 }` | `*_margin` | `{ 'left_margin': 0, 'right_margin': 0 }` j | `*_margin` | `{ 'left_margin': 0, 'right_margin': 0 }` - | `reset_stl_and_margin` | `{ 'left_margin': 0, 'right_margin': 0 }` - k | `reset_stl_and_margin` | `{ 'left_margin': 0, 'right_margin': 0 }` + | `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