![]() ![]() $ echo 'bindkey "^X^_" redo' > ~/.zshrc # reload your. $ echo 'bindkey "^X\\x7f" backward-kill-line' > ~/.zshrc # adds redo $ echo 'bindkey "^U" backward-kill-line' > ~/.zshrc # binds hex 0x18 0x7f with deleting everything to the left of the cursor 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įor zsh, you can setup binding for the not yet functional ⌘+←Delete and ⇧+⌘+Z/⌘+y by running: # changes hex 0x15 to delete everything to the left of the cursor, ⌥+fn←Delete or ⌥+Delete→ Send Hex Codes: 0x1b 0圆4 ⌘+fn+←Delete or ⌘+Delete→ Send Hex Codes: 0x0bĠx1b 0x08 Breaks in Elixir's IEX, seems to work fine everywhere elseĠx17 Works everywhere, but doesn't stop at normal word breaks in IRB and will instead delete until it sees a literal space. I personally use this and then overwrite my zsh bindkey for ^U to delete only stuff to the left of the cursor (see below).Ġx18 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.ĭelete all characters right of the cursor 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:Ġx15 More compatible, but functionality sometimes is to delete the entire line rather than just the characters to the left of the curser. I verified that this works in ZSH, Bash, node, python -i, iex and irb/pry sessions (using rb-readline gem for readline, but should work for all). ![]() I see there's a lot of good answers already, but this should provide the closest to native OSX functionality as possible in more than just your shell. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |