Glam Prestige Journal

Bright entertainment trends with youth appeal.

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.

3 Answers

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
0

For Fish shell users, put the command fish_vi_key_bindings into your config. Default location is: ~/.config/fish/config.fish

For more details, see answer:

I'm surprised it is mentioned here, so I'll mention it for completeness' sake. Also for the zsh shell, the way of setting vi keybinding is different from bash.

In zsh vi keybinding are set with:

bindkey -v

For a gentle introduction, you can read here. After which, the official documentation should look less intimidating.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy