mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 17:50:04 +08:00
Add SPC j c
key binding (#4443)
This commit is contained in:
parent
46869748f5
commit
b80606aec5
@ -17,6 +17,7 @@ let s:SYS = SpaceVim#api#import('system')
|
||||
let s:FILE = SpaceVim#api#import('file')
|
||||
let s:MESSAGE = SpaceVim#api#import('vim#message')
|
||||
let s:CMP = SpaceVim#api#import('vim#compatible')
|
||||
let s:NOTI = SpaceVim#api#import('notify')
|
||||
|
||||
|
||||
function! SpaceVim#layers#core#plugins() abort
|
||||
@ -149,7 +150,9 @@ function! SpaceVim#layers#core#config() abort
|
||||
call SpaceVim#mapping#space#def('nmap', ['j', 'w'], '<Plug>(easymotion-overwin-w)', 'jump-to-a-word', 0)
|
||||
call SpaceVim#mapping#space#def('nmap', ['j', 'q'], '<Plug>(easymotion-overwin-line)', 'jump-to-a-line', 0)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['j', 'n'], "i\<cr>\<esc>", 'sp-newline', 0)
|
||||
" call SpaceVim#mapping#space#def('nnoremap', ['j', 'o'], "i\<cr>\<esc>k$", 'open-line', 0)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['j', 'c'], 'call call('
|
||||
\ . string(s:_function('s:jump_last_change')) . ', [])',
|
||||
\ 'jump-to-last-change', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['j', 's'], 'call call('
|
||||
\ . string(s:_function('s:split_string')) . ', [0])',
|
||||
\ 'split-sexp', 1)
|
||||
@ -461,6 +464,16 @@ let g:string_info = {
|
||||
\ },
|
||||
\ }
|
||||
|
||||
function! s:jump_last_change() abort
|
||||
let [bufnum, lnum, col, off] = getpos("'.")
|
||||
let [_, l, c, _] = getpos('.')
|
||||
if lnum !=# l && c != col && lnum !=# 0 && col !=# 0
|
||||
call setpos('.', [bufnum, lnum, col, off])
|
||||
else
|
||||
call s:NOTI.notify('no change position!', 'WarningMsg')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:split_string(newline) abort
|
||||
if s:is_string(line('.'), col('.'))
|
||||
let save_cursor = getcurpos()
|
||||
|
@ -1732,16 +1732,17 @@ Denite/Unite 是一个强大的信息筛选浏览器,这类似于 Emacs 中的
|
||||
|
||||
| 快捷键 | 功能描述 |
|
||||
| --------- | ------------------------------------------------ |
|
||||
| `SPC j 0` | 跳至行首,并且在原始位置留下标签,以便跳回 |
|
||||
| `SPC j $` | 跳至行尾,并且在原始位置留下标签,以便跳回 |
|
||||
| `SPC j 0` | 跳至行首,并且在原始位置留下标签,以便跳回 |
|
||||
| `SPC j b` | 向后回跳 |
|
||||
| `SPC j f` | 向前跳 |
|
||||
| `SPC j d` | 跳至当前目录某个文件夹 |
|
||||
| `SPC j c` | 跳至前一个修改位置 |
|
||||
| `SPC j D` | 跳至当前目录某个文件夹(在另外窗口展示文件列表) |
|
||||
| `SPC j d` | 跳至当前目录某个文件夹 |
|
||||
| `SPC j f` | 向前跳 |
|
||||
| `SPC j i` | 跳至当前文件的某个函数,使用 Denite 打开语法树 |
|
||||
| `SPC j I` | 跳至所有 Buffer 的语法树(TODO) |
|
||||
| `SPC j j` | 跳至当前窗口的某个字符 (easymotion) |
|
||||
| `SPC j J` | 跳至当前窗口的某两个字符的组合 (easymotion) |
|
||||
| `SPC j j` | 跳至当前窗口的某个字符 (easymotion) |
|
||||
| `SPC j k` | 跳至下一行,并且对齐下一行 |
|
||||
| `SPC j l` | 跳至某一行 (easymotion) |
|
||||
| `SPC j q` | show the dumb-jump quick look tooltip (TODO) |
|
||||
|
@ -1730,14 +1730,15 @@ The `SPC j` prefix is for jumping, joining and splitting.
|
||||
|
||||
| Key Bindings | Descriptions |
|
||||
| ------------ | --------------------------------------------------------------------------------- |
|
||||
| `SPC j 0` | go to the beginning of line (and set a mark at the previous location in the line) |
|
||||
| `SPC j $` | go to the end of line (and set a mark at the previous location in the line) |
|
||||
| `SPC j 0` | go to the beginning of line (and set a mark at the previous location in the line) |
|
||||
| `SPC j b` | jump backward |
|
||||
| `SPC j f` | jump forward |
|
||||
| `SPC j c` | jump to last change |
|
||||
| `SPC j d` | jump to a listing of the current directory |
|
||||
| `SPC j D` | jump to a listing of the current directory (other window) |
|
||||
| `SPC j i` | jump to a definition in buffer (denite outline) |
|
||||
| `SPC j f` | jump forward |
|
||||
| `SPC j I` | jump to a definition in any buffer (denite outline) |
|
||||
| `SPC j i` | jump to a definition in buffer (denite outline) |
|
||||
| `SPC j j` | jump to a character in the buffer (easymotion) |
|
||||
| `SPC j J` | jump to a suite of two characters in the buffer (easymotion) |
|
||||
| `SPC j k` | jump to next line and indent it using auto-indent rules |
|
||||
|
Loading…
Reference in New Issue
Block a user