Add <Plug> mappings for highlighting fixed range

This commit is contained in:
Junegunn Choi
2015-06-07 21:37:48 +09:00
parent f282610943
commit fc8dfac390
3 changed files with 15 additions and 1 deletions

View File

@@ -18,7 +18,15 @@ Usage
- `Limelight!! [0.0 ~ 1.0]`
- Toggle Limelight
You can also invoke `:Limelight` for a visual range.
### Limelight for a selected range
You can invoke `:Limelight` for a visual range. There are also `<Plug>`
mappings for normal and visual mode for the purpose.
```vim
nmap <Leader>l <Plug>(Limelight)
xmap <Leader>l <Plug>(Limelight)
```
### Options

View File

@@ -266,6 +266,10 @@ function! limelight#execute(bang, visual, ...) range
endif
endfunction
function! limelight#operator(...)
'[,']call limelight#execute(0, 1)
endfunction
let &cpo = s:cpo_save
unlet s:cpo_save

View File

@@ -23,3 +23,5 @@
command! -nargs=? -bar -bang -range Limelight <line1>,<line2>call limelight#execute(<bang>0, <count> > 0, <f-args>)
nnoremap <silent> <Plug>(Limelight) :set opfunc=limelight#operator<CR>g@
xnoremap <silent> <Plug>(Limelight) :Limelight<CR>