Like, if you open Terminal.app on Mac some of these still work because it's the shell and not iTerm. Some of these are not directly related to iTerm and are just "shell features". FunctionĮnter Character Selection Mode in Copy ModeĬopy actions goes into the normal system clipboard which you can paste like normal. There's no need to Copy to the clipboard if you have General > Selection > Copy to pasteboard on selection enabled. Ever find yourself holding down the Delete key on the command line Heres a way to work faster. I instead just mouse select (which copies to the clipboard) and paste. Delete Entire Word in Terminal and iTerm2. Moving by word on a line (this is a shell thing but passes through fine)Ĭursor Jump with Mouse (shell and vim - might depend on config)Ĭopy and Paste with iTerm without using the mouse (go to beginning of current line) but that doesn't work in the shell. ![]() For example ⌘ Left Arrow is usually the same as Home Keys and Mac equivalents don't always work. It works in many contexts.Ī lot of shell shortcuts work in iterm and it's good to learn these because arrow keys, home/end Instead of typing exit, just get this in muscle memory. In general, use this instead of typing clear over and over. If you use ⌘ K, this is telling iTerm to clear the screen which might have the same result or do something terrible (like when using a TUI like top or htop. This is telling the shell to do it instead of an explicit command like clear or cls in DOS. Especially when your last command was wrong by a single typo or something. Ctrl as modifier might also work on mac and non-mac keyboards/shells/apps. This takes you off the home row but it's easy to rememberįast way to jump by words to correct a typo or "run again" with minor changes to last command. Ctrl-R is faster if you know the string you are looking for. Use this with command history to repeat commands and changing one thing at the end!Ĭycle and browse your history with up and down. Use this to start over typing without hitting Ctrl-C Hopefully some of these improve your work life. There is also more than one way to do a thing so adopt what you like best. There are many shortcuts out there but I use these quite a bit. But that doesnt work as expected out of the box with Terminal or iTerm2. These will usually work in Bash/Zsh/Fish on Mac and on Linux. But often it would be better to delete one word at a time, as you can in most text editing programs on Mac. These are just common shell shortcuts unrelated to iTerm itelf. These might be helpful to getting you faster with the shell. ![]() ⌘ Left Arrow (I usually move by tab number) ![]() ⌘ Shift Enter (use with fullscreen to temp fullscreen a pane!)Ĭtrl ⌘ Arrow (given you haven't mapped this to something else) ⌘ Alt Shift and then drag the pane from anywhere ⌘ Shift D (mnemonic: shift is a wide horizontal key) 'Edit'->'Profile Preferences'->'Terminal Bell' checkbox.⌘ backtick (true of all mac apps and works with desktops/mission control) Now one annoyance on my system is that this particular combination caused the terminal emulator to issue a beep each time the command was issued, this I remedied by disabling the ![]() The ~/.zshrc should be re-sourced after these two commands are appended to it with: Then this sequence is given to bindkey in the ~/.zshrc file for persistance, as the first argument, and is bound, meaning that the keystroke in argument one will execute a particular editor command (or widget in zsh terms), to the widget, which in the first line of the above example is forward-word. For example the results of pressing should be interpreted like so: $ catġ 3 = I'm not sure about this one, but it should logically mean The key codes for a sequence can be obtained using cat and pressing the desired sequence. 'Ctrl U is most likely because youve got the cursor at the end of the line' of course i mean when my cursor is in the middle.'And what would you like the ctrl left/right to do' usually ctrl left arrow : skip word going left etc. under tmux this substitution is necessary for me, however without tmux it is required that no substitution be made and [ = [ Where \e = The escape-key-sequence(as documented under section 4.1.1)Īnd [ = O (uppercase O as documented under section 4.2.1), in some cases. I can't speak for iTerm but these are the keybindings I used to solve this problem under GNOME Terminal, on Fedora 19, running ZSH 5.0.7 with Oh-my-zsh: bindkey "\e[1 3C" forward-word
0 Comments
Leave a Reply. |