Skip to content

Commit

Permalink
to make 'g:interestingWordsDefaultMappings' work -and- correct readme…
Browse files Browse the repository at this point in the history
… doc
  • Loading branch information
Shane-XB-Qian committed Jun 24, 2020
1 parent 2128a82 commit 8c74ce1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,15 @@ Finally, if you don't want to toggle every single highlighted word and want to c

The plugin comes with those default mapping, but you can change it as you like:

`let g:interestingWordsDefaultMappings = 0` if to disable default mapping

```vimscript
nnoremap <silent> <leader>k :call InterestingWords('n')<cr>
vnoremap <silent> <leader>k :call InterestingWords('v')<cr>
nnoremap <silent> <leader>K :call UncolorAllWords()<cr>
nnoremap <silent> n :call WordNavigation('forward')<cr>
nnoremap <silent> N :call WordNavigation('backward')<cr>
nnoremap <silent> n :call WordNavigation(1)<cr>
nnoremap <silent> N :call WordNavigation(0)<cr>
```

Thanks to **@gelguy** it is now possible to randomise and configure your own colors
Expand Down
4 changes: 2 additions & 2 deletions plugin/interestingwords.vim
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,11 @@ function! s:Random(n)
return float2nr(floor(a:n * timestamp/100))
endfunction

if !exists('g:interestingWordsDefaultMappings')
if !exists('g:interestingWordsDefaultMappings') || g:interestingWordsDefaultMappings != 0
let g:interestingWordsDefaultMappings = 1
endif

if !hasmapto('<Plug>InterestingWords')
if g:interestingWordsDefaultMappings && !hasmapto('<Plug>InterestingWords')
nnoremap <silent> <leader>k :call InterestingWords('n')<cr>
vnoremap <silent> <leader>k :call InterestingWords('v')<cr>
nnoremap <silent> <leader>K :call UncolorAllWords()<cr>
Expand Down

0 comments on commit 8c74ce1

Please sign in to comment.