Configuring vim

Editing the command line is often a must and is part of a developer's everyday life. Setting up common options that make life easier in the editor give us the reliability and consistency we need, a little like scripting itself. We will set some useful options in the vi or vim editor file, $HOME/.vimrc.

The options we set are detailed in the following list:

  • set showmode: Ensures we see when we are in insert mode
  • set nohlsearch: Does not highlight the words that we have searched for
  • set autoindent: We indent our code often; this allows us to return to the last indent level rather than the start of a new line on each line break
  • set tabstop=4: Sets a tab to be four spaces
  • set expandtab: Converts tabs to spaces, which is useful ...

Get Mastering Linux Shell Scripting now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.