Essential Keybindings For Bash, Fish and Zsh
Channel: DistroTube
Date: 2022-07-26

One of the most useful features of the Bash shell (Fish and Zsh too!) is the built-in keybindings that can greatly speed up your terminal workflow.

By default, your shell uses Emacs-style keybindings, but you can change to Vim-like bindings if you prefer.  The following are the commands to change to Vi-bindings (and back to Emacs-bindings).

BASH: set -o vi (set -o emacs)
ZSH : bindkey -v (bindkey -e)
FISH : fish_vi_key_bindings (fish_default_key_bindings)

The following commands were shown in this video.  Listed are the Emacs-bindings followed by the Vim-bindings in parentheses:

CTRL-a (0 or ^) jump to beginning of line
CTRL-e ($) jump to end of line

CTRL-f (h) move forward one char
CTRL-b (l) move backward one char

ALT-f (w) move forward one word
ALT-b (b) move backward one word
2w, 2b...in Vi-mode

CTRL-k (d$) delete from this point to the end of the line
CTRL-u (d0) delete from beginning of the line to this point
CTRL-y (u) undo

CTRL-w (db) delete a word backwards
ALT-d  (dw) delete a word forwards

Alt-. to past last command argument
Or just type !!, !$ in the command line

CTRL-p (k) move to prev command in history
CTRL-n (j) move to next command in history

CTRL-l to clear terminal
CTRL-d to exit the shell

WANT TO SUPPORT THE CHANNEL? 
💰 Patreon: https://www.patreon.com/distrotube 
💳 Paypal: https://www.youtube.com/redirect?event=channel_banner&redir_token=QUFFLUhqazNocEhiaGFBT1l1MnRHbnlIcHFKbXJWVnpQd3xBQ3Jtc0tsLVZJc19YeFlwZ2JqbXVOa3g0Skw4TVhTV2otNm1tM3A1bUNnamh3S2V6OGQtLTBnSjBxYTlvUXMxeEVIS3o4US10NENHMUQ3STk2a01FOFBhUnZjZFctMEhFUTg1TVctQmFfVUdxZXJ4TDl0azlYNA&q=https%3A%2F%2Fwww.paypal.com%2Fcgi-bin%2Fwebscr%3Fcmd%3D_donations%26business%3Dderek%2540distrotube%252ecom%26lc%3DUS%26item_name%3DDistroTube%26no_note%3D0%26currency_code%3DUSD%26bn%3DPP%252dDonationsBF%253abtn_donateCC_LG%252egif%253aNonHostedGuest
🛍️ Amazon: https://amzn.to/2RotFFi
👕 Teespring: https://teespring.com/stores/distrotube

DONATE CRYPTO:
💰 Bitcoin: 1Mp6ebz5bNcjNFW7XWHVht36SkiLoxPKoX
🐶 Dogecoin: D5fpRD1JRoBFPDXSBocRTp8W9uKzfwLFAu
📕 LBC: bMfA2c3zmcLxPCpyPcrykLvMhZ7A5mQuhJ

DT ON THE WEB:
🕸️ Website: http://distrotube.com/
📁 GitLab: https://gitlab.com/dwt1  
🗨️ Mastodon: https://fosstodon.org/@distrotube
👫 Reddit: https://www.reddit.com/r/DistroTube/
📽️ LBRY/Odysee: https://odysee.com/@DistroTube:2

FREE AND OPEN SOURCE SOFTWARE THAT I USE:
🌐 Brave Browser - https://brave.com/dis872 
📽️ Open Broadcaster Software: https://obsproject.com/
🎬 Kdenlive: https://kdenlive.org
🎨 GIMP: https://www.gimp.org/
💻 VirtualBox: https://www.virtualbox.org/
🗒️ Doom Emacs: https://github.com/hlissner/doom-emacs

Your support is very much appreciated. Thanks, guys!