mirror of
https://github.com/junegunn/vim-easy-align.git
synced 2025-11-14 21:03:48 -05:00
Make <Down> set both left and right margin to zero
(Undocumented) <Up> will clear *UP* left_margin, right_margin, and stick_to_left
This commit is contained in:
@@ -158,6 +158,7 @@ keys listed below. The meaning of each option will be described in
|
|||||||
| `CTRL-O` | `mode_sequence` | Input string of `/[lrc]+\*{0,2}/` |
|
| `CTRL-O` | `mode_sequence` | Input string of `/[lrc]+\*{0,2}/` |
|
||||||
| `<Left>` | `stick_to_left` | `{ 'stick_to_left': 1, 'left_margin': 0 }` |
|
| `<Left>` | `stick_to_left` | `{ 'stick_to_left': 1, 'left_margin': 0 }` |
|
||||||
| `<Right>` | `stick_to_left` | `{ 'stick_to_left': 0, 'left_margin': 1 }` |
|
| `<Right>` | `stick_to_left` | `{ 'stick_to_left': 0, 'left_margin': 1 }` |
|
||||||
|
| `<Down>` | `*_margin` | `{ 'left_margin': 0, 'right_margin': 0 }` |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -629,9 +629,13 @@ function! s:interactive(modes, vis, opts, delims)
|
|||||||
elseif c == "\<Right>"
|
elseif c == "\<Right>"
|
||||||
let opts['stl'] = 0
|
let opts['stl'] = 0
|
||||||
let opts['lm'] = 1
|
let opts['lm'] = 1
|
||||||
elseif c == "\<Up>" || c == "\<Down>"
|
elseif c == "\<Down>"
|
||||||
|
let opts['lm'] = 0
|
||||||
|
let opts['rm'] = 0
|
||||||
|
elseif c == "\<Up>"
|
||||||
silent! call remove(opts, 'stl')
|
silent! call remove(opts, 'stl')
|
||||||
silent! call remove(opts, 'lm')
|
silent! call remove(opts, 'lm')
|
||||||
|
silent! call remove(opts, 'rm')
|
||||||
elseif ch == "\<C-O>"
|
elseif ch == "\<C-O>"
|
||||||
let modes = tolower(s:input("Mode sequence: ", get(opts, 'm', mode), a:vis))
|
let modes = tolower(s:input("Mode sequence: ", get(opts, 'm', mode), a:vis))
|
||||||
if match(modes, '^[lrc]\+\*\{0,2}$') != -1
|
if match(modes, '^[lrc]\+\*\{0,2}$') != -1
|
||||||
|
|||||||
@@ -97,6 +97,7 @@ described in the following sections.
|
|||||||
| CTRL-O | mode_sequence | Input string of /[lrc]+\*{0,2}/ |
|
| CTRL-O | mode_sequence | Input string of /[lrc]+\*{0,2}/ |
|
||||||
| <Left> | stick_to_left | { 'stick_to_left': 1, 'left_margin': 0 } |
|
| <Left> | stick_to_left | { 'stick_to_left': 1, 'left_margin': 0 } |
|
||||||
| <Right> | stick_to_left | { 'stick_to_left': 0, 'left_margin': 1 } |
|
| <Right> | stick_to_left | { 'stick_to_left': 0, 'left_margin': 1 } |
|
||||||
|
| <Down> | *_margin | { 'left_margin': 0, 'right_margin': 0 } |
|
||||||
|
|
||||||
|
|
||||||
Non-interactive mode
|
Non-interactive mode
|
||||||
|
|||||||
Reference in New Issue
Block a user