1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-04-13 14:59:10 +08:00

Add SPC x c

This commit is contained in:
wsdjeg 2017-07-19 07:09:41 +08:00
parent 2c8b4c6cbc
commit b1ebe04d44
2 changed files with 24 additions and 15 deletions

View File

@ -47,6 +47,9 @@ function! SpaceVim#layers#edit#config() abort
let g:_spacevim_mappings_space.x.a = {'name' : '+align'}
let g:_spacevim_mappings_space.x.d = {'name' : '+delete'}
let g:_spacevim_mappings_space.x.i = {'name' : '+change symbol style'}
nnoremap <silent> <Plug>CountSelectionRegion :call <SID>count_selection_region()<Cr>
xnoremap <silent> <Plug>CountSelectionRegion :<C-u>call <SID>count_selection_region()<Cr>
call SpaceVim#mapping#space#def('nmap', ['x', 'c'], '<Plug>CountSelectionRegion', 'cunt in the selection region', 0, 1)
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 /)', 'align region at )', 1)
@ -119,6 +122,8 @@ function! SpaceVim#layers#edit#config() abort
call SpaceVim#mapping#space#def('nnoremap', ['i', 'l', 's'], 'call call('
\ . string(s:_function('s:insert_lorem_ipsum_sentence')) . ', [])',
\ 'insert lorem-ipsum sentence', 1)
let g:_spacevim_mappings_space.x.g = {'name' : '+translate'}
call SpaceVim#mapping#space#def('nnoremap', ['x', 'g', 't'], 'Ydc', 'translate current word', 1)
endfunction
function! s:lowerCamelCase() abort
@ -232,6 +237,10 @@ function! s:parse_symbol(symbol) abort
endif
endfunction
function! s:count_selection_region() abort
call feedkeys("gvg\<c-g>\<Esc>", 'ti')
endfunction
function! s:delete_extra_space() abort
if !empty(getline('.'))

View File

@ -1180,26 +1180,26 @@ Key Binding | Description
`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
`SPC x a c` | align current indentation region using default rules
`SPC x a l` | left-align with evil-lion
`SPC x a L` | right-align with evil-lion
`SPC x a r` | align region using user-specified regexp
`SPC x a m` | align region at arithmetic operators `` (+-*/) ``
`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` | cunt 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 languages used by translate commands
`SPC x g l` | set languages used by translate commands (TODO)
`SPC x g t` | translate current word using Google Translate
`SPC x g T` | reverse source and target languages
`SPC x i c` | change symbol style to lowerCamelCase
`SPC x i C` | change symbol style to UpperCamelCase
`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 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
`SPC x j l` | set the justification to left