I have the following function in a vim plugin:
fu! HOLSelect(l,r) let l:cursor = getpos(".") if search(a:l,"Wbc") == 0 return endif normal v if search(a:r,"W") == 0 normal <ESC> call setpos('.', l:cursor) return endif call search(a:r,"ce") endf
I am trying to understand it without a deep vimscript knowledge.
When it is called the following way:
nn <silent> <LocalLeader>a :call HOLSelect('Triviality\\|Theorem','Proof')<CR>-Vo+
It visually selects the region between (not including) the lines
Proof. These stand on their own in the file:
Theorem ∀ P. P ==> P Proof rw 
I see two
search calls but it is not clear how it selects the region between the two endpoints.
Could you explain how this function selects the region's two endpoints between
Proof and passes it on?