The Computer Oracle

Select text in iTerm using keyboard

--------------------------------------------------
Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
and get $2,000 discount on your first invoice
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Thinking It Over

--

Chapters
00:00 Select Text In Iterm Using Keyboard
00:12 Accepted Answer Score 82
01:19 Answer 2 Score 8
01:58 Answer 3 Score 28
02:17 Thank you

--

Full question
https://superuser.com/questions/93573/se...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#osxsnowleopard #keyboardshortcuts #iterm

#avk47



ACCEPTED ANSWER

Score 82


Yes! In iTerm2, do this:

From the relevant documentation

  1. Cmd-F
  2. Type some text that matches part of what you want to copy.
  3. When you have a partial match on what you want to copy, you can expand the selection.

Press tab to grow it one word to the right; press shift-tab to grow it one word to the left.

As soon as you press tab or shift-tab, it is copied to the clipboard. You can press option-Enter to immediately paste the selection and close the find bar at once.

You could also assign custom keys in Prefs -> Keys. (Source)

move selection forward by word

move selection backward by word

Similarly settings can also be used to move line selection.

Alternatively, the autocorrect feature reduces the need for copy-paste. Just type the start of some text that is either on the screen or you have copy-pasted recently and press cmd-;. A popup window appears and you can choose from there. Autocorrect works best for a single word, though.

(I updated this answer to reflect new features in iTerm 3.0. Thanks to @sfarzy for the suggested edits)




ANSWER 2

Score 28


You can use "Edit->Copy Mode" by default Shift+Cmd+C, In there you can use VIM-like shortcuts:

/ will allow you to search, v to select, And while selecting you can use $ to move to the end of the line and finally the good ol' Cmd + C to copy.




ANSWER 3

Score 8


From the iTerm2 documentation:

Text Selection

There are two ways to select text to copy to the clipboard: you can use the mouse, or you can use the find feature's "mouseless copy" feature. Text selection by mouse is described later in General Usage section.

To select text without using the mouse, press cmd-f to open the find field. Enter the beginning of the text you wish to copy and the find feature will select it in your window. Then press tab and the end of the selection will advance by a word. To move the beginning of the selection to the left, press shift-tab. At most one line of text can be selected this way.