All Articles

Configuring Vim

Creating a vim configuration file

  • Create a file in your home directory called .vimrc

    cd ~
    touch .vimrc

    You can, of course, use vim to edit your .vimrc file:

    vi .vimrc
  • Add the settings commands you prefer to the file. Here are the ones I currently use.

    "Lines that start with double quote are comments
    "Syntax highlighting
    syntax on
    "Stuff about tabs
    set tabstop=4
    set softtabstop=4
    set expandtab
    "Turn on line numbering
    set number
    "Put a visible cursor line under the current line
    set cursorline
    "Auto indent next line to the same level
    set autoindent
    "Search lookahead, highlighting, etc
    set incsearch
    set hlsearch
  • Every time you start vim it will read and apply the settings in this file.