Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ or just the search pattern:

let g:vim_search_pulse_mode = 'pattern'

and whether or not to allow not pulsing the same pattern/line (1 is default)

let g:vim_search_pulse_disable_if_same_line_pattern = 1

If you want to set your own mappings, do:

let g:vim_search_pulse_disable_auto_mappings = 1
Expand All @@ -51,6 +55,7 @@ the following global variable. For example:

let g:vim_search_pulse_duration = 400


The colors used by the pulse are `[237, 238, 239, 240, 241]` (gray scale) by
default. A color map can be found at:
http://www.calmar.ws/vim/256-xterm-24bit-rgb-color-chart.html
Expand Down
3 changes: 3 additions & 0 deletions autoload/search_pulse.vim
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@ func! s:IsLineTooLong()
endf

func! s:IsPatternOnTheSameLine()
if !g:vim_search_pulse_disable_if_same_line_pattern
return
endif
if !exists('s:old_line')
let s:old_line = line('.')

Expand Down
4 changes: 4 additions & 0 deletions doc/search-pulse.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ or just the search pattern:

let g:vim_search_pulse_mode = 'pattern'

and whether or not to allow not pulsing the same pattern/line (1 is default)

let g:vim_search_pulse_disable_if_same_line_pattern = 1

If you want to set your own mappings, do:

let g:vim_search_pulse_disable_auto_mappings = 1
Expand Down
25 changes: 25 additions & 0 deletions plugin/search_pulse.vim
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ nnoremap
\ <silent>
\ <SID>Pulse :call search_pulse#Pulse()<cr>

if !has_key(g:, 'vim_search_pulse_disable_if_same_line_pattern')
let g:vim_search_pulse_disable_if_same_line_pattern = 1
endif

if get(g:, 'vim_search_pulse_disable_auto_mappings') != 0
finish
endif
Expand All @@ -23,3 +27,24 @@ nmap # #<Plug>Pulse
" Pulses cursor line on first match
" when doing search with / or ?
cmap <silent> <expr> <enter> search_pulse#PulseFirst()

if get(g:, 'vim_search_pulse_disable_auto_extended_mappings') != 0
finish
endif

nmap <c-o> <c-o><Plug>Pulse
nmap <c-i> <c-i><Plug>Pulse
nmap G G<Plug>Pulse
nmap H H<Plug>Pulse
nmap M M<Plug>Pulse
nmap L L<Plug>Pulse
nmap ( (<Plug>Pulse
nmap ) )<Plug>Pulse
nmap [[ [[<Plug>Pulse
nmap ]] ]]<Plug>Pulse
nmap `[ `[<Plug>Pulse
nmap `] `]<Plug>Pulse
nmap { {<Plug>Pulse
nmap } }<Plug>Pulse
nmap zj zj<Plug>Pulse
nmap zk zk<Plug>Pulse