Makes an excellent starting point for your own custom prompt.Support VI-mode indication by reverse prompt symbol (Zsh 5.3+).Shows the current path in the title and the current folder & command when a process is running.Username and host only displayed when in an SSH session or a container. You can un-assign K as the shortcut for Clear Buffer by assigning a different key combination (e.g.Command execution time will be displayed if it exceeds the set threshold.Prompt character turns red if the last command didn’t exit with 0.Indicates when you have unpushed/unpulled git commits with up/down arrows.Shows git branch and whether it’s dirty (with a *).Now when iTerm is open, you'll see that service. A hotkey is a keypress that iTerm2 responds to even if another application is active. Save it as clear-all-scrollback-buffers-in-current-iterm-window. Put in a single Run Applescript action, and paste in the code from above. Set 'Service Receives' to 'no input' and select 'iTerm.app' as the application. Author went through the whole Unicode range to find it. To bind that to a keyboard shortcut: Open Automator and create a new Service. Comes with the perfect prompt character. Pure gives you a minimalist prompt if you are using the z-shell. If you have enabled sudo authentication with Touch ID you will also need to set Preferences -> Advanced -> Allow sessions to survive logging out and back in to No in iTerm2 preferences. Open up iTerm2 preferences (⌘ + ,) -> Profiles -> Keys -> Click on + icon (add new Keyboard shortcut). iTerm is not set up to work with these shortcuts by default but here’s how you set them up: You might be familiar with shortcuts to skip a word (⌥) or go to start/end of the line (⌘). If you’re using BASH instead of ZSH you can add export CLICOLOR=1 line to your ~/.bash_profile file for nice coloring of listings.Source Code Pro can be downloaded using Homebrew brew tap homebrew/cask-fonts & brew install -cask font-source-code-pro Change the font to 14pt Source Code Pro Lite.Change the cursor text and cursor color to yellow make it more visible.Go to profiles -> Default -> Terminal -> Check silence bell to disable the terminal session from making any sound.Set hot-key to open and close the terminal to command + option + i.Here are some suggested settings you can change or set, they are all optional. ITerm2 should automatically pick it up and notify you but you can also set the theme by navigating to Preferences > Profiles > Colors > Color Presets: Snazzy. Optionally, if you still want to use option instead of ctrl + shift, you can use option + ⟵ and option + ⟶ when assigning the keyboard shortcut to jump words and option + delete when assigning the keyboard shortcut for deleting words.(curl -Ls > /tmp/ermcolors & open /tmp/ermcolors ) Then for the Action select Send Hex Code and use the code 17 in the field. Then, in the Action dropdown, select Send Escape Sequence and enter the same letter ( b or f) as the keyboard shortcut you entered.ĭo it for the other key and that’s all there is to it! How To Assign Ctrl + Shift + Delete To Delete Whole WordsĪssign a keyboard shortcut, in the same way as above, and use ctrl + shift + delete as the Keyboard Shortcut. You must find other keys, preferably some that work everywhere (CLI, GUI, Mac, Win, Linux).:h mapleader is a good start. Whether iTerm uses up all the Cmd+ shortcuts or not is irrelevant. In the Keyboard Shortcut field, push the keys ctrl + shift + b or ctrl + shift + f and you should see something like ^⬆︎B or ^⬆︎F. Its impossible to map the command key in CLI Vim because the only Vim that supports it is MacVim in its GUI form. Select the + button at the bottom to add a new shortcut. To assign the shortcut open the iTerm preferences and choose the keys tab. Now we can skip entire words on the command line interface by holding down the left key and hitting or. How To Use Ctrl + Shift + f and Ctrl + Shift + b To Jump Words After we are done, we may need to restart the iTerm to be able to use the changes that we just made. If you don’t use those keyboard shortcuts they will take time to get used to, but I like them particularily because I don’t have to lift my hands off of home row to reach the arrow keys. If you use ctrl + b and ctrl + f to navigate cursor, I recommend give these steps a try. I found this to be easier to use given the placement of capslock (which should be your ctrl!) and shift on the keyboard, compared to option. I’m already used to using ctrl + f and ctrl + b to move the cursor forward and backward in terminal and, instead of option, decided to give ctrl + shift a try. I tried it for a while and found the option key to be placed in such a weird position on the Apple keyboards that I wouldn’t use option and often forget about it while in the “programming zone”. I really feel like I’m missing out on being able to jump words when working in terminal and found some blogs on how to do it by using option.
0 Comments
Leave a Reply. |