Select text in iTerm using keyboard
Yes! In iTerm2, do this:
From the relevant documentation
- Cmd-F
- Type some text that matches part of what you want to copy.
- 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)
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)
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.