Submit your Linux news story here.

How to set Vi mode in Zshell to increase productivity

The Z shell (Zsh) is a free and open source Linux/Unix shell that can be used as an interactive login shell and as a powerful command interpreter for shell scripting. This guide shows how to setup better vi mode in ZSH.

From the blog:

Many Vim users don’t realize that their shell offers a Vi mode, but both Zshell and Bash do. I’ve been a big fan of Vim for many years now and use it exclusively for all editing work I do. In addition to using Vim for code I also write all my blog post in Vim with vim-pencil and goyo.vim. I only recently decided to switch to Vi mode in my Zsh and Bash shells. While I was happy to move away from Emacs mode, which is the default in Zsh and Bash, I was disappointed with the key mappings present in Zsh’s Vi mode. Many of the features I’d come to love from Zsh’s Emacs mode were gone. After some tinkering and reading several blog posts (links at the bottom of the page) I figured out how to add these features back into Vi mode.

I found that oh-my-zsh offers a Vi mode plugin but I gave up using it when I realized it didn’t offer many of the things I needed. It also made doing some of the customizations I cover in this blog post much harder to do.