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

Add mapping for jump to url

This commit is contained in:
wsdjeg 2017-06-02 22:33:19 +08:00
parent 5d49b133d9
commit 432192e739
2 changed files with 13 additions and 6 deletions

View File

@ -72,9 +72,8 @@ function! SpaceVim#layers#default#config() abort
call SpaceVim#mapping#space#def('nmap', ['j', 'J'], '<Plug>(easymotion-s2)', 'jump to a suite of two characters', 0) call SpaceVim#mapping#space#def('nmap', ['j', 'J'], '<Plug>(easymotion-s2)', 'jump to a suite of two characters', 0)
call SpaceVim#mapping#space#def('nnoremap', ['j', 'k'], 'j==', 'go to next line and indent', 0) call SpaceVim#mapping#space#def('nnoremap', ['j', 'k'], 'j==', 'go to next line and indent', 0)
call SpaceVim#mapping#space#def('nmap', ['j', 'l'], '<Plug>(easymotion-bd-jk)', 'jump to a line', 0) call SpaceVim#mapping#space#def('nmap', ['j', 'l'], '<Plug>(easymotion-bd-jk)', 'jump to a line', 0)
call SpaceVim#mapping#space#def('nmap', ['j', 'u'], '<Plug>(easymotion-bd-jk)', 'jump to a line', 0)
call SpaceVim#mapping#space#def('nmap', ['j', 'v'], '<Plug>(easymotion-bd-jk)', 'jump to a line', 0) call SpaceVim#mapping#space#def('nmap', ['j', 'v'], '<Plug>(easymotion-bd-jk)', 'jump to a line', 0)
call SpaceVim#mapping#space#def('nmap', ['j', 'w'], '<Plug>(easymotion-bd-jk)', 'jump to a line', 0) call SpaceVim#mapping#space#def('nmap', ['j', 'w'], '<Plug>(easymotion-bd-w)', 'jump to a word', 0)
call SpaceVim#mapping#space#def('nmap', ['j', 'q'], '<Plug>(easymotion-bd-jk)', 'jump to a line', 0) call SpaceVim#mapping#space#def('nmap', ['j', 'q'], '<Plug>(easymotion-bd-jk)', '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', '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', 'o'], "i\<cr>\<esc>k$", 'open-line', 0)
@ -90,6 +89,9 @@ function! SpaceVim#layers#default#config() abort
call SpaceVim#mapping#space#def('nnoremap', ['w', 'R'], 'call call(' call SpaceVim#mapping#space#def('nnoremap', ['w', 'R'], 'call call('
\ . string(s:_function('s:previous_window')) . ', [])', \ . string(s:_function('s:previous_window')) . ', [])',
\ 'rotate windows backward', 1) \ 'rotate windows backward', 1)
call SpaceVim#mapping#space#def('nnoremap', ['j', 'u'], 'call call('
\ . string(s:_function('s:jump_to_url')) . ', [])',
\ 'jump to url', 1)
endfunction endfunction
let s:file = SpaceVim#api#import('file') let s:file = SpaceVim#api#import('file')
@ -193,3 +195,8 @@ else
return function(substitute(a:fstr, 's:', s:_s, 'g')) return function(substitute(a:fstr, 's:', s:_s, 'g'))
endfunction endfunction
endif endif
function! s:jump_to_url() abort
let g:EasyMotion_re_anywhere = 'http[s]*://'
call feedkeys("\<Plug>(easymotion-jumptoanywhere)")
endfunction

View File

@ -650,9 +650,9 @@ Key Binding | Description
`SPC j k` | jump to next line and indent it using auto-indent rules `SPC j k` | jump to next line and indent it using auto-indent rules
`SPC j l` | jump to a line with avy (easymotion) `SPC j l` | jump to a line with avy (easymotion)
`SPC j q` | show the dumb-jump quick look tooltip (TODO) `SPC j q` | show the dumb-jump quick look tooltip (TODO)
`SPC j u` | jump to a URL in the current buffer (TODO) `SPC j u` | jump to a URL in the current window
`SPC j v` | jump to the definition/declaration of an Emacs Lisp variable (TODO) `SPC j v` | jump to the definition/declaration of an Emacs Lisp variable (TODO)
`SPC j w` | jump to a word in the current buffer (easymotion)(TODO) `SPC j w` | jump to a word in the current buffer (easymotion)
##### Joining and splitting ##### Joining and splitting
@ -810,9 +810,9 @@ Key | Description
### c/c++ support ### c/c++ support
1. code completion: autocompletion and fuzzy match. 1. code completion: autocompletion and fuzzy match.
![2017-02-01_1359x720](https://cloud.githubusercontent.com/assets/13142418/22505960/df9068de-e8b8-11e6-943e-d79ceca095f1.png) ![completion-fuzzy-match](https://cloud.githubusercontent.com/assets/13142418/22505960/df9068de-e8b8-11e6-943e-d79ceca095f1.png)
2. syntax check: Asynchronous linting and make framework. 2. syntax check: Asynchronous linting and make framework.
![2017-02-01_1359x722](https://cloud.githubusercontent.com/assets/13142418/22506340/e28b4782-e8ba-11e6-974b-ca29574dcc1f.png) ![syntax-check](https://cloud.githubusercontent.com/assets/13142418/22506340/e28b4782-e8ba-11e6-974b-ca29574dcc1f.png)
### go support ### go support