How to select text for copy and paste in Chrome by keyboard not using the mouse?

I have some online tutorial open in my Google chrome. It tells me to run some commands in a terminal.

My current workflow is to select the necessary parts via mouse, and insert the copied text via middle mouse click in a terminal.

I want to to avoid using the mouse at most instances, so I want to highlight text on a web page by only using the keyboard instead. I want for the text to be automatically saved into the buffer similar to mouse selection, yet even then being able to ctr+c without selecting text with the mouse would be fine.

Is there a mode in Chrome for that purpose?


Solution 1:

As I am a user of vimium, it turns out I had the capabilities already shipped with it even though I wasn't aware that it existed.

  • Search the starting point by: /yourSeach
  • Press enter.
  • Enable visual mode via: v, and visual mode on a line basis via Shift + V
  • Select text by vim navigation keys, aka: h, j, k, l, b, e, w, $ (I especially like shift + w, as it goes to the end of the next word)
  • Yank via y

You now can switch the context and paste the text via Ctrl+V

There also seems to be a caret mode, yet as of yet I somtimes don't see the current place of the cursor, which is why I prefer the search-first approach as of now.

Solution 2:

Use the arrow keys to navigate the page.

To highlight text on a page with a keyboard use Shift and a direction, up is up a line down is down a line. Left is left one character and right is right one character.

Copy is Ctrl + C and paste is Ctrl + V.

The only way I could find to move the selection cursor is using find to highlight the first word of the text you want to copy, press Ctrl + F, type your word, to highlight it in the page and press ESC to leave find then use the Shift plus arrows to highlight the rest.

Finally to swap from Chrome to a Terminal use Alt + Tab

Solution 3:

There's an Google supported extension called Caret Browsing among other extensions to improve accessability.

It toggles via F7 like in Firefox. Though I still find text selection to be a bit flunky on some pages, it works for most basic use cases.