SearchParty icon indicating copy to clipboard operation
SearchParty copied to clipboard

vim: highlight and search

Open Anton-Wessel opened this issue 5 years ago • 1 comments

I have written my own vim script code in order to highlight (not move cursor) all matches of the selected aerea in character visual, after all vmap to a key; this with the special feature that the first one match, the original location, is highlighted with a different color than all other matches. My code is not yet finished because the vim command matchaddpos() does not work correcly. And because I am not happy that matchaddpos() is based on a string but not charactetwise on the current buffer, does not accept byte offset in the file for positions.

Now in this moment I have found "dahu/SearchParty" code for similar goals. Fine. Where can I read how to download, how to install it into vim, how to use it? [email protected]

Anton-Wessel avatar Jan 25 '21 14:01 Anton-Wessel

If you are not familiar with adding plugins to Vim, I recommend using the Pathogen (https://github.com/tpope/vim-pathogen) plugin manager. Read the instructions there to learn how to set it up and start adding plugins. In the beginning of that page he suggests using Vim 8.1's new builtin package manager (:help packages) but the Pathogen instructions are a simpler way to begin with plugins. You can easily switch to the builtin way once you're more comfortable with plugins.

As for using SearchParty, it has builtin help. Just type :help SearchParty after the plugin is installed. I hope SearchParty helps you find what you're after. And if the plugin itself isn't to your liking, you might find ideas and solutions from its code to help finish your own search and highlight script. Good luck.

dahu avatar Jan 25 '21 21:01 dahu