mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-03 02:40:05 +08:00
Add highlight state
This commit is contained in:
parent
d236e77e2f
commit
133b921c0f
@ -285,6 +285,8 @@ function! SpaceVim#mapping#space#init() abort
|
||||
"Symbol
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['s', 'e'], 'call SpaceVim#plugins#iedit#start()',
|
||||
\ 'start iedit mode', 1, 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['s', 'h'], 'call SpaceVim#plugins#highlight#start()',
|
||||
\ 'highlight all symbols', 1)
|
||||
" Getting help
|
||||
let g:_spacevim_mappings_space.h.d = {'name' : '+help-describe'}
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['h', 'd', 'b'],
|
||||
|
41
autoload/SpaceVim/plugins/highlight.vim
Normal file
41
autoload/SpaceVim/plugins/highlight.vim
Normal file
@ -0,0 +1,41 @@
|
||||
"=============================================================================
|
||||
" highlight.vim --- highlight mode for SpaceVim
|
||||
" Copyright (c) 2016-2017 Shidong Wang & Contributors
|
||||
" Author: Shidong Wang < wsdjeg at 163.com >
|
||||
" URL: https://spacevim.org
|
||||
" License: MIT license
|
||||
"=============================================================================
|
||||
|
||||
|
||||
function! SpaceVim#plugins#highlight#start()
|
||||
let state = SpaceVim#api#import('transient_state')
|
||||
call state.set_title('Highlight Transient State')
|
||||
call state.defind_keys(
|
||||
\ {
|
||||
\ 'layout' : 'vertical split',
|
||||
\ 'left' : [
|
||||
\ ],
|
||||
\ 'right' : [
|
||||
\ ],
|
||||
\ }
|
||||
\ )
|
||||
call state.open()
|
||||
|
||||
endfunction
|
||||
|
||||
|
||||
|
||||
" function() wrapper
|
||||
if v:version > 703 || v:version == 703 && has('patch1170')
|
||||
function! s:_function(fstr) abort
|
||||
return function(a:fstr)
|
||||
endfunction
|
||||
else
|
||||
function! s:_SID() abort
|
||||
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
|
||||
endfunction
|
||||
let s:_s = '<SNR>' . s:_SID() . '_'
|
||||
function! s:_function(fstr) abort
|
||||
return function(substitute(a:fstr, 's:', s:_s, 'g'))
|
||||
endfunction
|
||||
endif
|
Loading…
Reference in New Issue
Block a user