henrik/vim-indexed-search — pull request #2 by jondkinney (2013-08-30 06:39:12+00:00)
Title: Add option keep cursor on initial result

This is my first vimscript work at all. It's pretty simple, although not very DRY. I tried to make a function that simply pressed the N key and call out to that function in place of the version of the command on line 98, but I wasn't sure how to make that work.

Do you do `return N` or `return 'N'`. Perhaps `execute N` or `exe 'N'`. Anyway, it'd be a lot cleaner with a function, but this does work for my purposes.

Oh, and the point is so that I can hit * on a word and not have Vim jump to the next result. I want to keep my screen where it is, maybe see how many instances of that keyword there are in the file, and I'll go to the next (or maybe previous) result when I'm good and ready :)

I don't jump directly backwards from a keyword very often so I didn't bother to do this same thing for the # character, but it might be worthwhile if you or someone else wants to add it.

Thanks,
Jon