mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-02 23:20:04 +08:00
Add: add two new key bindings: align at [SPC] and operators. (#2571)
* Add: add a new key binding: align at [SPC]. * Add: add a new key binding: align at operators.
This commit is contained in:
parent
972fb6d04d
commit
0c8be4f18e
@ -81,8 +81,10 @@ function! SpaceVim#layers#edit#config() abort
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['x', 'a', ':'], 'Tabularize /:', 'align region at :', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['x', 'a', ';'], 'Tabularize /;', 'align region at ;', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['x', 'a', '='], 'Tabularize /===\|<=>\|\(&&\|||\|<<\|>>\|\/\/\)=\|=\~[#?]\?\|=>\|[:+/*!%^=><&|.?-]\?=[#?]\?/l1r1', 'align region at =', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['x', 'a', 'o'], 'Tabularize /&&\|||\|\.\.\|\*\*\|<<\|>>\|\/\/\|[-+*/.%^><&|?]/l1r1', 'align region at operator, such as +,-,*,/,%,^,etc', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['x', 'a', '¦'], 'Tabularize /¦', 'align region at ¦', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['x', 'a', '<Bar>'], 'Tabularize /|', 'align region at |', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['x', 'a', '[SPC]'], 'Tabularize /\s\+', 'align region at [SPC]', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['x', 'd', 'w'], 'StripWhitespace', 'delete trailing whitespaces', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['x', 'd', '[SPC]'], 'silent call call('
|
||||
\ . string(s:_function('s:delete_extra_space')) . ', [])',
|
||||
|
@ -1519,62 +1519,63 @@ In highlight symbol transient state:
|
||||
|
||||
文本相关的命令 (以 `x` 开头):
|
||||
|
||||
| 快捷键 | 描述 |
|
||||
| ------------- | -------------------------------------------------------------------- |
|
||||
| `SPC x a &` | align region at & |
|
||||
| `SPC x a (` | align region at ( |
|
||||
| `SPC x a )` | align region at ) |
|
||||
| `SPC x a [` | align region at [ |
|
||||
| `SPC x a ]` | align region at ] |
|
||||
| `SPC x a {` | align region at { |
|
||||
| `SPC x a }` | align region at } |
|
||||
| `SPC x a ,` | align region at , |
|
||||
| `SPC x a .` | align region at . (for numeric tables) |
|
||||
| `SPC x a :` | align region at : |
|
||||
| `SPC x a ;` | align region at ; |
|
||||
| `SPC x a =` | align region at = |
|
||||
| `SPC x a ¦` | align region at ¦ |
|
||||
| `SPC x a |` | align region at | |
|
||||
| `SPC x a a` | align region (or guessed section) using default rules (TODO) |
|
||||
| `SPC x a c` | align current indentation region using default rules (TODO) |
|
||||
| `SPC x a l` | left-align with evil-lion (TODO) |
|
||||
| `SPC x a L` | right-align with evil-lion (TODO) |
|
||||
| `SPC x a r` | align region using user-specified regexp (TODO) |
|
||||
| `SPC x a m` | align region at arithmetic operators `(+-*/)` (TODO) |
|
||||
| `SPC x c` | count the number of chars/words/lines in the selection region |
|
||||
| `SPC x d w` | delete trailing whitespaces |
|
||||
| `SPC x d SPC` | Delete all spaces and tabs around point, leaving one space |
|
||||
| `SPC x g l` | set lanuages used by translate commands (TODO) |
|
||||
| `SPC x g t` | translate current word using Google Translate |
|
||||
| `SPC x g T` | reverse source and target languages (TODO) |
|
||||
| `SPC x i c` | change symbol style to `lowerCamelCase` |
|
||||
| `SPC x i C` | change symbol style to `UpperCamelCase` |
|
||||
| `SPC x i i` | cycle symbol naming styles (i to keep cycling) |
|
||||
| `SPC x i -` | change symbol style to `kebab-case` |
|
||||
| `SPC x i k` | change symbol style to `kebab-case` |
|
||||
| `SPC x i _` | change symbol style to `under_score` |
|
||||
| `SPC x i u` | change symbol style to `under_score` |
|
||||
| `SPC x i U` | change symbol style to `UP_CASE` |
|
||||
| `SPC x j c` | 居中对齐当前段落 |
|
||||
| `SPC x j f` | set the justification to full (TODO) |
|
||||
| `SPC x j l` | 左对齐当前段落 |
|
||||
| `SPC x j n` | set the justification to none (TODO) |
|
||||
| `SPC x j r` | 右对齐当前段落 |
|
||||
| `SPC x J` | move down a line of text (enter transient state) |
|
||||
| `SPC x K` | move up a line of text (enter transient state) |
|
||||
| `SPC x l d` | duplicate line or region (TODO) |
|
||||
| `SPC x l s` | sort lines (TODO) |
|
||||
| `SPC x l u` | uniquify lines (TODO) |
|
||||
| `SPC x o` | use avy to select a link in the frame and open it (TODO) |
|
||||
| `SPC x O` | use avy to select multiple links in the frame and open them (TODO) |
|
||||
| `SPC x t c` | swap (transpose) the current character with the previous one |
|
||||
| `SPC x t w` | swap (transpose) the current word with the previous one |
|
||||
| `SPC x t l` | swap (transpose) the current line with the previous one |
|
||||
| `SPC x u` | set the selected text to lower case (TODO) |
|
||||
| `SPC x U` | set the selected text to upper case (TODO) |
|
||||
| `SPC x w c` | count the number of occurrences per word in the select region (TODO) |
|
||||
| `SPC x w d` | show dictionary entry of word from wordnik.com (TODO) |
|
||||
| `SPC x TAB` | indent or dedent a region rigidly (TODO) |
|
||||
| 快捷键 | 描述 |
|
||||
| --------------- | -------------------------------------------------------------------- |
|
||||
| `SPC x a &` | align region at & |
|
||||
| `SPC x a (` | align region at ( |
|
||||
| `SPC x a )` | align region at ) |
|
||||
| `SPC x a [` | align region at [ |
|
||||
| `SPC x a ]` | align region at ] |
|
||||
| `SPC x a {` | align region at { |
|
||||
| `SPC x a }` | align region at } |
|
||||
| `SPC x a ,` | align region at , |
|
||||
| `SPC x a .` | align region at . (for numeric tables) |
|
||||
| `SPC x a :` | align region at : |
|
||||
| `SPC x a ;` | align region at ; |
|
||||
| `SPC x a =` | align region at = |
|
||||
| `SPC x a ¦` | align region at ¦ |
|
||||
| `SPC x a |` | align region at | |
|
||||
| `SPC x a [SPC]` | align region at [SPC] |
|
||||
| `SPC x a a` | align region (or guessed section) using default rules (TODO) |
|
||||
| `SPC x a c` | align current indentation region using default rules (TODO) |
|
||||
| `SPC x a l` | left-align with evil-lion (TODO) |
|
||||
| `SPC x a L` | right-align with evil-lion (TODO) |
|
||||
| `SPC x a r` | align region using user-specified regexp (TODO) |
|
||||
| `SPC x a o` | align region at arithmetic operators `+-*/` |
|
||||
| `SPC x c` | count the number of chars/words/lines in the selection region |
|
||||
| `SPC x d w` | delete trailing whitespaces |
|
||||
| `SPC x d SPC` | Delete all spaces and tabs around point, leaving one space |
|
||||
| `SPC x g l` | set lanuages used by translate commands (TODO) |
|
||||
| `SPC x g t` | translate current word using Google Translate |
|
||||
| `SPC x g T` | reverse source and target languages (TODO) |
|
||||
| `SPC x i c` | change symbol style to `lowerCamelCase` |
|
||||
| `SPC x i C` | change symbol style to `UpperCamelCase` |
|
||||
| `SPC x i i` | cycle symbol naming styles (i to keep cycling) |
|
||||
| `SPC x i -` | change symbol style to `kebab-case` |
|
||||
| `SPC x i k` | change symbol style to `kebab-case` |
|
||||
| `SPC x i _` | change symbol style to `under_score` |
|
||||
| `SPC x i u` | change symbol style to `under_score` |
|
||||
| `SPC x i U` | change symbol style to `UP_CASE` |
|
||||
| `SPC x j c` | 居中对齐当前段落 |
|
||||
| `SPC x j f` | set the justification to full (TODO) |
|
||||
| `SPC x j l` | 左对齐当前段落 |
|
||||
| `SPC x j n` | set the justification to none (TODO) |
|
||||
| `SPC x j r` | 右对齐当前段落 |
|
||||
| `SPC x J` | move down a line of text (enter transient state) |
|
||||
| `SPC x K` | move up a line of text (enter transient state) |
|
||||
| `SPC x l d` | duplicate line or region (TODO) |
|
||||
| `SPC x l s` | sort lines (TODO) |
|
||||
| `SPC x l u` | uniquify lines (TODO) |
|
||||
| `SPC x o` | use avy to select a link in the frame and open it (TODO) |
|
||||
| `SPC x O` | use avy to select multiple links in the frame and open them (TODO) |
|
||||
| `SPC x t c` | swap (transpose) the current character with the previous one |
|
||||
| `SPC x t w` | swap (transpose) the current word with the previous one |
|
||||
| `SPC x t l` | swap (transpose) the current line with the previous one |
|
||||
| `SPC x u` | set the selected text to lower case (TODO) |
|
||||
| `SPC x U` | set the selected text to upper case (TODO) |
|
||||
| `SPC x w c` | count the number of occurrences per word in the select region (TODO) |
|
||||
| `SPC x w d` | show dictionary entry of word from wordnik.com (TODO) |
|
||||
| `SPC x TAB` | indent or dedent a region rigidly (TODO) |
|
||||
|
||||
#### 文本插入命令
|
||||
|
||||
|
@ -45,6 +45,7 @@ lang: cn
|
||||
- `=`: 对齐 `===`, `==`, `!=`, `>=` 等
|
||||
- `&`: 对齐 `&`
|
||||
- `¦`: 对齐 `¦`
|
||||
- `|`: 对齐 `|`
|
||||
- `;`: 对齐 `;`
|
||||
- `:`: 对齐 `:`
|
||||
- `,`: 对齐 `,`
|
||||
@ -55,6 +56,8 @@ lang: cn
|
||||
- `]`: 对齐 `]`
|
||||
- `}`: 对齐 `}`
|
||||
- `)`: 对齐 `)`
|
||||
- `[SPC]`: 对齐 `[SPC]`
|
||||
- `o`: 对齐 `+ - * / % ^` 等
|
||||
|
||||
| 快捷键 | 功能描述 |
|
||||
| ------------ | ------------------------------------ |
|
||||
|
@ -1553,62 +1553,63 @@ In highlight symbol transient state:
|
||||
|
||||
Text related commands (start with `x`):
|
||||
|
||||
| Key Bindings | Descriptions |
|
||||
| ------------- | -------------------------------------------------------------------- |
|
||||
| `SPC x a &` | align region at & |
|
||||
| `SPC x a (` | align region at ( |
|
||||
| `SPC x a )` | align region at ) |
|
||||
| `SPC x a [` | align region at \[ |
|
||||
| `SPC x a ]` | align region at ] |
|
||||
| `SPC x a {` | align region at { |
|
||||
| `SPC x a }` | align region at } |
|
||||
| `SPC x a ,` | align region at , |
|
||||
| `SPC x a .` | align region at . (for numeric tables) |
|
||||
| `SPC x a :` | align region at : |
|
||||
| `SPC x a ;` | align region at ; |
|
||||
| `SPC x a =` | align region at = |
|
||||
| `SPC x a ¦` | align region at ¦ |
|
||||
| `SPC x a |` | align region at | |
|
||||
| `SPC x a a` | align region (or guessed section) using default rules (TODO) |
|
||||
| `SPC x a c` | align current indentation region using default rules (TODO) |
|
||||
| `SPC x a l` | left-align with evil-lion (TODO) |
|
||||
| `SPC x a L` | right-align with evil-lion (TODO) |
|
||||
| `SPC x a r` | align region using user-specified regexp (TODO) |
|
||||
| `SPC x a m` | align region at arithmetic operators `(+-*/)` (TODO) |
|
||||
| `SPC x c` | count the number of chars/words/lines in the selection region |
|
||||
| `SPC x d w` | delete trailing whitespaces |
|
||||
| `SPC x d SPC` | Delete all spaces and tabs around point, leaving one space |
|
||||
| `SPC x g l` | set lanuages used by translate commands (TODO) |
|
||||
| `SPC x g t` | translate current word using Google Translate |
|
||||
| `SPC x g T` | reverse source and target languages (TODO) |
|
||||
| `SPC x i c` | change symbol style to `lowerCamelCase` |
|
||||
| `SPC x i C` | change symbol style to `UpperCamelCase` |
|
||||
| `SPC x i i` | cycle symbol naming styles (i to keep cycling) |
|
||||
| `SPC x i -` | change symbol style to `kebab-case` |
|
||||
| `SPC x i k` | change symbol style to `kebab-case` |
|
||||
| `SPC x i _` | change symbol style to `under_score` |
|
||||
| `SPC x i u` | change symbol style to `under_score` |
|
||||
| `SPC x i U` | change symbol style to `UP_CASE` |
|
||||
| `SPC x j c` | set the justification to center |
|
||||
| `SPC x j f` | set the justification to full (TODO) |
|
||||
| `SPC x j l` | set the justification to left |
|
||||
| `SPC x j n` | set the justification to none (TODO) |
|
||||
| `SPC x j r` | set the justification to right |
|
||||
| `SPC x J` | move down a line of text (enter transient state) |
|
||||
| `SPC x K` | move up a line of text (enter transient state) |
|
||||
| `SPC x l d` | duplicate line or region (TODO) |
|
||||
| `SPC x l s` | sort lines (TODO) |
|
||||
| `SPC x l u` | uniquify lines (TODO) |
|
||||
| `SPC x o` | use avy to select a link in the frame and open it (TODO) |
|
||||
| `SPC x O` | use avy to select multiple links in the frame and open them (TODO) |
|
||||
| `SPC x t c` | swap (transpose) the current character with the previous one |
|
||||
| `SPC x t w` | swap (transpose) the current word with the previous one |
|
||||
| `SPC x t l` | swap (transpose) the current line with the previous one |
|
||||
| `SPC x u` | set the selected text to lower case (TODO) |
|
||||
| `SPC x U` | set the selected text to upper case (TODO) |
|
||||
| `SPC x w c` | count the number of occurrences per word in the select region (TODO) |
|
||||
| `SPC x w d` | show dictionary entry of word from wordnik.com (TODO) |
|
||||
| `SPC x TAB` | indent or dedent a region rigidly (TODO) |
|
||||
| Key Bindings | Descriptions |
|
||||
| --------------- | -------------------------------------------------------------------- |
|
||||
| `SPC x a &` | align region at & |
|
||||
| `SPC x a (` | align region at ( |
|
||||
| `SPC x a )` | align region at ) |
|
||||
| `SPC x a [` | align region at \[ |
|
||||
| `SPC x a ]` | align region at ] |
|
||||
| `SPC x a {` | align region at { |
|
||||
| `SPC x a }` | align region at } |
|
||||
| `SPC x a ,` | align region at , |
|
||||
| `SPC x a .` | align region at . (for numeric tables) |
|
||||
| `SPC x a :` | align region at : |
|
||||
| `SPC x a ;` | align region at ; |
|
||||
| `SPC x a =` | align region at = |
|
||||
| `SPC x a ¦` | align region at ¦ |
|
||||
| `SPC x a |` | align region at | |
|
||||
| `SPC x a [SPC]` | align region at [SPC] |
|
||||
| `SPC x a a` | align region (or guessed section) using default rules (TODO) |
|
||||
| `SPC x a c` | align current indentation region using default rules (TODO) |
|
||||
| `SPC x a l` | left-align with evil-lion (TODO) |
|
||||
| `SPC x a L` | right-align with evil-lion (TODO) |
|
||||
| `SPC x a r` | align region using user-specified regexp (TODO) |
|
||||
| `SPC x a o` | align region at operators `+-*/` |
|
||||
| `SPC x c` | count the number of chars/words/lines in the selection region |
|
||||
| `SPC x d w` | delete trailing whitespaces |
|
||||
| `SPC x d SPC` | Delete all spaces and tabs around point, leaving one space |
|
||||
| `SPC x g l` | set lanuages used by translate commands (TODO) |
|
||||
| `SPC x g t` | translate current word using Google Translate |
|
||||
| `SPC x g T` | reverse source and target languages (TODO) |
|
||||
| `SPC x i c` | change symbol style to `lowerCamelCase` |
|
||||
| `SPC x i C` | change symbol style to `UpperCamelCase` |
|
||||
| `SPC x i i` | cycle symbol naming styles (i to keep cycling) |
|
||||
| `SPC x i -` | change symbol style to `kebab-case` |
|
||||
| `SPC x i k` | change symbol style to `kebab-case` |
|
||||
| `SPC x i _` | change symbol style to `under_score` |
|
||||
| `SPC x i u` | change symbol style to `under_score` |
|
||||
| `SPC x i U` | change symbol style to `UP_CASE` |
|
||||
| `SPC x j c` | set the justification to center |
|
||||
| `SPC x j f` | set the justification to full (TODO) |
|
||||
| `SPC x j l` | set the justification to left |
|
||||
| `SPC x j n` | set the justification to none (TODO) |
|
||||
| `SPC x j r` | set the justification to right |
|
||||
| `SPC x J` | move down a line of text (enter transient state) |
|
||||
| `SPC x K` | move up a line of text (enter transient state) |
|
||||
| `SPC x l d` | duplicate line or region (TODO) |
|
||||
| `SPC x l s` | sort lines (TODO) |
|
||||
| `SPC x l u` | uniquify lines (TODO) |
|
||||
| `SPC x o` | use avy to select a link in the frame and open it (TODO) |
|
||||
| `SPC x O` | use avy to select multiple links in the frame and open them (TODO) |
|
||||
| `SPC x t c` | swap (transpose) the current character with the previous one |
|
||||
| `SPC x t w` | swap (transpose) the current word with the previous one |
|
||||
| `SPC x t l` | swap (transpose) the current line with the previous one |
|
||||
| `SPC x u` | set the selected text to lower case (TODO) |
|
||||
| `SPC x U` | set the selected text to upper case (TODO) |
|
||||
| `SPC x w c` | count the number of occurrences per word in the select region (TODO) |
|
||||
| `SPC x w d` | show dictionary entry of word from wordnik.com (TODO) |
|
||||
| `SPC x TAB` | indent or dedent a region rigidly (TODO) |
|
||||
|
||||
#### Text insertion commands
|
||||
|
||||
|
@ -35,7 +35,7 @@ This layer provides many edit key bindings for SpaceVim, and also provides more
|
||||
## Key bindings
|
||||
|
||||
| Key bindings | Descraptions |
|
||||
| -------------------- | ------------------------------- |
|
||||
| -------------------- | -------------------------------- |
|
||||
| `SPC x a {delimiter}` | align content based on delimiter |
|
||||
|
||||
**default delimiters**
|
||||
@ -43,6 +43,7 @@ This layer provides many edit key bindings for SpaceVim, and also provides more
|
||||
- `=`: align `===`, `==`, `!=`, `>=` etc.
|
||||
- `&`: align `&`
|
||||
- `¦`: align `¦`
|
||||
- `|`: align `|`
|
||||
- `;`: align `;`
|
||||
- `:`: align `:`
|
||||
- `,`: align `,`
|
||||
@ -53,9 +54,13 @@ This layer provides many edit key bindings for SpaceVim, and also provides more
|
||||
- `]`: align `]`
|
||||
- `}`: align `}`
|
||||
- `)`: align `)`
|
||||
- `[SPC]`: align `[SPC]`
|
||||
- `o`: align `+ - * / % ^` etc.
|
||||
|
||||
| Key bindings | Descraptions |
|
||||
| ------------ | ------------------------------- |
|
||||
| `SPC x j c` | set the justification to center |
|
||||
| `SPC x j l` | set the justification to left |
|
||||
| `SPC x j r` | set the justification to right |
|
||||
| Key bindings | Descraptions |
|
||||
| ------------ | ------------------------------------ |
|
||||
| `SPC x j c` | set the justification to center |
|
||||
| `SPC x j f` | set the justification to full (TODO) |
|
||||
| `SPC x j l` | set the justification to left |
|
||||
| `SPC x j n` | set the justification to none (TODO) |
|
||||
| `SPC x j r` | set the justification to right |
|
||||
|
Loading…
Reference in New Issue
Block a user