How to use vimium to select text from a page

10

4

Background

I'm a religious fanatical devoted believer of vimium. It speeds up my internet usage like nothing else. I'm also (naturally) a heavy user of vim itself.

Question

How can I actually select a certain text in a screen using vimium without using a keyboard? For example let's say I got this email on the page mail@mail.com. Is there a way i can for example search for that term first of all, then using vimium highlight the rest of the term as if I'm using a cursor?

so a more practical example mailto@verycomplicatedandlonganduglydomainthatiwontsearachfor.com so i simply search for mailto, then as that gets highlighted, i can move the cursor to the end of the term or at least highlight one word at a time. Idas?

abbood

Posted 2017-08-02T11:56:38.910

Reputation: 702

Answers

10

If you specifically want to search for 'mailto' but then sellect 'verycomplicatedandlong...' i.e. search one string in order to find the second (unknown) string, which you then want to select.

/ mailto Enter / veryl Enter v ww y

Shortcut explanation.
/ - Enter search mode.
mailto - Literal search string.
Enter - Normal mode.
/ - Now that you know your second search string, enter search mode again.
veryl - Literal search string.
Enter - Enter normal mode (optionally you can use nN to find other instances of the same search string).
v - Enter visual mode.
ww - Select two words (domain and TLD) or use hl to select one character at a time.
y - yank (copy).

Filip Nikolov

Posted 2017-08-02T11:56:38.910

Reputation: 105

So basically, the answer is visual mode, plus vi-like word navigation shortcuts. – ijoseph – 2018-04-28T03:05:27.103

This just changed my life... I used it to copy some summary text from a page, which I then pasted into a new bookmark. Now when I press "b", I can quick-find using bits of that summary text! – micahscopes – 2019-08-31T19:21:18.093

0

As a slight improvement on Filip's answer, I would suggest searching for mailto like he suggested, but then going into visual mode right away, then using w or e to select text to the end of the address and then using ow to switch to the marker at the beginning of the word and moving it forward. So the full command would be: /mailtoveeeow

Blake Ryan Celestian

Posted 2017-08-02T11:56:38.910

Reputation: 1