Permalink
Browse files

Add <Plug> mappings for highlighting fixed range

  • Loading branch information...
1 parent f282610 commit fc8dfac390418dd6d6481b5692d7b134bfe19f2a @junegunn committed Jun 7, 2015
Showing with 15 additions and 1 deletion.
  1. +9 −1 README.md
  2. +4 −0 autoload/limelight.vim
  3. +2 −0 plugin/limelight.vim
View
@@ -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
@@ -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
@@ -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>

0 comments on commit fc8dfac

Please sign in to comment.