In Terminal, I can simply to cmd
+up arrow
. How can I do this in iTerm2? I've tried the cmd
+shift
+up arrow
option, but it doesn't work reliably, especially when there is a currently running process.
To learn about the keyboard shortcuts in the new content editor, see Keyboard shortcut functions. To reverse your last action, press CTRL+Z. You can reverse more than one action. To reverse your last Undo, press CTRL+Y.
Split Panes iTerm2 allows you to divide a tab into many rectangular "panes", each of which is a different terminal session. The shortcuts cmd-d and cmd-shift-d divide an existing session vertically or horizontally, respectively. You can navigate among split panes with cmd-opt-arrow or cmd-[ and cmd-].
CTRL-A / HOME : Move to the beginning of a line.
Ctrl+W: Cut the word before the cursor, adding it to the clipboard. Ctrl+K: Cut the part of the line after the cursor, adding it to the clipboard. Ctrl+U: Cut the part of the line before the cursor, adding it to the clipboard. Ctrl+Y: Paste the last thing you cut from the clipboard.
You can do this with Shell Integration! By default, iTerm2 is not fully integrated with the shell (e.g. Bash) itself. It doesn't really know which lines are prompt and which are output, so it wouldn't know what line to jump you back to as the previous prompt. If you install shell integration, it'll automatically add a mark at each prompt line and you'll be able to cycle up and down with Command-Shift-Up Arrow
and Command-Shift-Down Arrow
respectively. On my machine this worked even while a process was running.
In Preferences
> Keys
you can change the default keybindings back to what you're used to. Double click on Command-Up Arrow
, change the Action to Select Menu Item...
, and set the menu item to Edit
> Marks and Annotations
> Previous Mark/Annotation
. Repeat with Next Mark/Annotation
for Command-Down Arrow
.
EDITED 2020-03-30: It appears Mark
and Annotation
were separated into different menu items in a recent update. You should now use Next Mark
instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With