Command line tools, vim and various

Speed up zsh

  • https://registerspill.thorstenball.com/p/how-fast-is-your-shell
  • https://htr3n.github.io/2018/07/faster-zsh/#macos-optimisations
  • https://gist.github.com/ctechols/ca1035271ad134841284
  • https://blog.jonlu.ca/posts/speeding-up-zsh
  • https://github.com/htr3n/zsh-config/blob/master/zlogin
  • https://askubuntu.com/questions/438150/why-are-scripts-in-etc-profile-d-being-ignored-system-wide-bash-aliases/438170#438170
  • https://askubuntu.com/questions/879364/differentiate-interactive-login-and-non-interactive-non-login-shell/879400#879400
  • https://blog.flowblok.id.au/2013-02/shell-startup-scripts.html
  • https://linux.die.net/man/1/zshcontrib

Split it in to categories!

Keybindings for terminal

Open the iTerm preferences ⌘+, and navigate to the Profiles tab (the Keys tab can be used, but adding keybinding to your profile allows you to save your profile and sync it to multiple computers) and keys sub-tab and enter the following:

Delete all characters left of the cursor

⌘+←Delete Send Hex Codes:

  • 0x18 0x7f – Less compatible, doesn't work in node and won't work in zsh by default, see below to fix zsh (bash/irb/pry should be fine), performs desired functionality when it does work.
  • 0x15 – More compatible, but typical functionality is to delete the entire line rather than just the characters to the left of the cursor.

Delete all characters right of the cursor

⌘+fn+←Delete or ⌘+Delete→ Send Hex Codes:

  • 0x0b

Delete one word to left of cursor

⌥+←Delete Send Hex Codes:

  • 0x01b 0x08

Delete one word to right of cursor

⌥+fn←Delete or ⌥+Delete→ Send Hex Codes:

  • 0x01b 0x64

Move cursor to the front of line

⌘+← Send Hex Codes:

  • 0x01

Move cursor to the end of line

⌘+→ Send Hex Codes:

  • 0x05

Move cursor one word left

⌥+← Send Hex Codes:

  • 0x1b 0x62

Move cursor one word right

⌥+→ Send Hex Codes:

  • 0x1b 0x66

Undo

⌘+z Send Hex Codes:

  • 0x1f

Redo

Typically not bound in bash, zsh or readline, so we can set it to a unused hexcode which we can then fix in zsh.

⇧+⌘+Z or ⌘+y Send Hex Codes:

  • 0x18 0x1f

Stolen from: http://stackoverflow.com/questions/6205157/iterm2-how-to-get-jump-to-beginning-end-of-line-in-bash-shell#answer-29403520