Permalink
Browse files

Add g:limelight_priority

Can be used not to overrule hlsearch. Close #21.
  • Loading branch information...
1 parent 487515a commit 4d637595238b353e142449d33119f0b101e33ab8 @junegunn committed Jul 30, 2015
Showing with 7 additions and 2 deletions.
  1. +4 −0 README.md
  2. +3 −2 autoload/limelight.vim
View
@@ -54,6 +54,10 @@ let g:limelight_paragraph_span = 1
" and each paragraph starts with indentation
let g:limelight_bop = '^\s'
let g:limelight_eop = '\ze\n^\s'
+
+" Highlighting priority (default: 10)
+" Set it to -1 not to overrule hlsearch
+let g:limelight_priority = -1
```
Goyo.vim integration
@@ -87,9 +87,10 @@ endfunction
function! s:hl(startline, endline)
let w:limelight_match_ids = get(w:, 'limelight_match_ids', [])
- call add(w:limelight_match_ids, matchadd('LimelightDim', '\%<'.a:startline.'l'))
+ let priority = get(g:, 'limelight_priority', 10)
+ call add(w:limelight_match_ids, matchadd('LimelightDim', '\%<'.a:startline.'l', priority))
if a:endline > 0
- call add(w:limelight_match_ids, matchadd('LimelightDim', '\%>'.a:endline.'l'))
+ call add(w:limelight_match_ids, matchadd('LimelightDim', '\%>'.a:endline.'l', priority))
endif
endfunction

0 comments on commit 4d63759

Please sign in to comment.