Is it possible to use vim key bindings in iterm2?

8,810

I'm surprised you haven't yet found out about

set -o vi

This enables the vi editing mode in Bash (to make this permanent put the command in your ~/.bashrc file). Greg's Wiki has a short summary, and here's a Unix & Linux question about its advantages.

This setting is for the Bash shell, regardless of the terminal (who's purpose is to provide a container for typing and seeing text (plus selecting and pasting with the mouse) - apart from tabbed windows and some global window management, it shouldn't interfere with what's running inside it).

To enable this for some more (terminal-based) applications that use the readline library for input, you can put this into ~/.inputrc

# Do what "set -o vi" does in Bash to whatever uses readline.
set editing-mode vi
Share:
8,810

Related videos on Youtube

user1283776
Author by

user1283776

Updated on September 18, 2022

Comments

  • user1283776
    user1283776 over 1 year

    I want to use w for next word and b for previous word. If I could do more than that I would be even happier.

    I use bash if that matters.