33

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 mouse? For example let's say I got this email on the page [email protected]. 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 m[email protected] 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?

3 Answers 3

30

If you specifically want to search for mailto but then select 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).

8
  • So basically, the answer is visual mode, plus vi-like word navigation shortcuts.
    – ijoseph
    Apr 28, 2018 at 3:05
  • 1
    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! Aug 31, 2019 at 19:21
  • itectec.com/superuser/… Is this answer from here? Aug 23, 2021 at 20:42
  • @jasonleonhard this looks like a dodgy site that will display other sites content without permission or reference just for their own benefit. Aug 25, 2021 at 5:19
  • 1
    @Kennet Celeste Try forward slash and then Esc. Dec 6, 2021 at 15:28
3

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: / mailto Enter v ee ow

2

You might find the directions for Vimium Visual Mode helpful:

https://github.com/philc/vimium/wiki/Visual-Mode

They also include Caret Mode. They are the same as vim in general, though perhaps not as full featured or customizable, as you would expect.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .