1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-24 02:10:05 +08:00

Add g* etc

This commit is contained in:
wsdjeg 2017-06-11 22:14:32 +08:00
parent 2be0b8b67c
commit b207d64764
3 changed files with 28 additions and 3 deletions

View File

@ -301,8 +301,6 @@ function! SpaceVim#default#SetMappings() abort
call SpaceVim#mapping#def('nnoremap <silent>', 'q', ':<C-u>call zvim#util#SmartClose()<cr>',
\ 'Smart close windows',
\ 'call zvim#util#SmartClose()')
call SpaceVim#mapping#def('nnoremap <silent>', 'gf', ':call zvim#gf()<CR>', 'Jump to a file under cursor', '')
call SpaceVim#mapping#def('nnoremap <silent>', 'gd', ':call SpaceVim#mapping#gd()<CR>', 'Goto declaration', '')
endfunction
fu! s:tobur(num) abort

View File

@ -6,11 +6,28 @@ function! SpaceVim#mapping#g#init() abort
nnoremap g<c-g> g<c-g>
let g:_spacevim_mappings_g['&'] = ['call feedkeys("g&", "n")', 'repeat last ":s" on all lines']
nnoremap g& g&
let g:_spacevim_mappings_g['#'] = ['call feedkeys("\<Plug>(incsearch-nohl-g#)")', 'search under cursor']
let g:_spacevim_mappings_g['#'] = ['call feedkeys("\<Plug>(incsearch-nohl-g#)")', 'search under cursor backward']
let g:_spacevim_mappings_g['*'] = ['call feedkeys("\<Plug>(incsearch-nohl-g*)")', 'search under cursor forward']
let g:_spacevim_mappings_g['/'] = ['call feedkeys("\<Plug>(incsearch-stay)")', 'stay incsearch']
let g:_spacevim_mappings_g['$'] = ['call feedkeys("g$", "n")', 'go to rightmost character']
nnoremap g$ g$
let g:_spacevim_mappings_g['e'] = ['call feedkeys("ge", "n")', 'go to end of previous word']
nnoremap ge ge
let g:_spacevim_mappings_g['<'] = ['call feedkeys("g<", "n")', 'last page of previous command output']
nnoremap g< g<
let g:_spacevim_mappings_g['f'] = ['call feedkeys("gf", "n")', 'edit file under cursor']
nnoremap gf gf
let g:_spacevim_mappings_g['j'] = ['call feedkeys("gj", "n")', 'move cursor down screen line']
nnoremap gj gj
let g:_spacevim_mappings_g['k'] = ['call feedkeys("gk", "n")', 'move cursor up screen line']
nnoremap gk gk
let g:_spacevim_mappings_g['u'] = ['call feedkeys("gu", "n")', 'make motion text lowercase']
nnoremap gu gu
let g:_spacevim_mappings_g['U'] = ['call feedkeys("gU", "n")', 'make motion text uppercase']
nnoremap gU gU
let g:_spacevim_mappings_g['d'] = ['call SpaceVim#mapping#gd()', 'goto definition']
call SpaceVim#mapping#def('nnoremap <silent>', 'gd', ':call SpaceVim#mapping#gd()<CR>', 'Goto declaration', '')
endfunction

View File

@ -871,6 +871,16 @@ Key Binding | Description
`g'` | like `'`, but without changing the jumplist
`ge` | go backwards to the end of the previous word
`g+` | go to newer text state
`g<` | last page of previous command output
`gf` | edit file under cursor
`gF` | edit file under cursor with linenr
`gj` | move cursor down screen line
`gk` | move cursor up screen line
`gu` | Make `motion` text lowercase
`gU` | Make `motion` text uppercase
<!--gf gF ga gj gk gT gu gU g<c-f> g<-->
### Auto-saving