Skip to content
Tutorials Center
My learning

Topics

Lesson 2 of 36 ยท Getting Started

Installing Vim and Neovim, and Running vimtutor

Install Vim or Neovim on Windows, macOS and Linux, check which features your build has, find your config files, and learn from vimtutor and :help.

Before you can practice, you need a working Vim. The good news is that it is available on every platform and often already installed. This lesson covers installing Vim and Neovim, checking what your build supports, finding your configuration files, and the two built-in teachers: vimtutor and :help.

Is Vim already installed?

Open a terminal and run:

Terminal
vim --version | head -n 3
nvim --version | head -n 3

If a command is not found, install it. If vim exists but is called vi, that is usually a minimal build; you want the full one.

Installing

Pick the package manager you already use.

Terminal
# Debian and Ubuntu
sudo apt install vim neovim

# Fedora
sudo dnf install vim-enhanced neovim

# Arch
sudo pacman -S vim neovim

# macOS with Homebrew
brew install vim neovim

# Windows with winget
winget install vim.vim
winget install Neovim.Neovim

# Windows with Scoop
scoop install vim neovim

On Windows the installers add a graphical gvim plus the terminal vim. You can also use Vim inside WSL (Windows Subsystem for Linux), where the Linux commands above apply and the experience matches servers you will meet later.

Neovim has releases for all platforms on its GitHub page, and an AppImage for Linux if your repository version is old. Plugins in chapter 7 often need Neovim 0.10 or newer, so check the version after installing.

Which features does your build have?

Vim is compiled with optional features. vim --version prints them with + (present) or - (missing). Two matter right away:

  • +clipboard lets you copy to and from the system clipboard (chapter 4).
  • +python3 or +lua allow scripting-based plugins.

The stand-in below parses a pasted feature line and reports what you will be missing. It is not Vim; it is a checker for the text Vim prints.

JS Feature line checker (stand-in)

Press Run (or Ctrl + Enter) to see the console output here.

No output.

If clipboard is missing on Linux, install a package such as vim-gtk3, or use Neovim, which talks to the clipboard through helper programs like wl-copy or xclip and does not need a special build.

Where configuration lives

You will configure Vim in chapter 6. For now just know where the files go.

JS Config path table (stand-in)

Press Run (or Ctrl + Enter) to see the console output here.

No output.

You can always ask Vim itself. Inside the editor, :echo $MYVIMRC prints the file Vim loaded, and in Neovim :echo stdpath("config") prints the config folder.

The files may not exist yet. Vim runs perfectly without one; you create the file when you first need a setting.

Starting, opening and quitting

Terminal
vim notes.txt        # open (or create) a file
vim +10 notes.txt    # open at line 10
vim -R notes.txt     # read-only
vim -u NONE notes.txt  # skip config entirely (great for testing)
nvim -u NONE notes.txt

Inside Vim, :q quits, :w writes, and :wq does both. The next lesson turns that into a real first edit. If you ever get stuck and just want out, Esc then :q! quits and discards changes.

vimtutor: your first teacher

Vim ships with an interactive lesson. In a terminal run:

Terminal
vimtutor

It opens a text file with seven short lessons you edit as you read. Do it. It takes about thirty minutes, and doing it twice, a day apart, is the single best thing you can do for muscle memory. Neovim has nvim plus :Tutor. If your system lacks the command, the file is also reachable inside Vim with :help tutor.

Press Esc, then :q! to leave without saving; the tutorial works on a temporary copy, so you cannot hurt anything.

The built-in manual: :help

Vim's documentation is excellent and ships with the editor. Use it constantly.

  • :help opens the main page. Ctrl-] follows a link, Ctrl-o goes back.
  • :help w explains the w motion. :help i_CTRL-w explains Ctrl-w in Insert mode. Prefixes tell you the mode: i_ Insert, v_ Visual, c_ Command-line, : for ex commands, 'x' for options.
  • :helpgrep word searches all help text; :help user-manual is a full book.
  • :q closes the help window (it is a normal split window; chapter 5 explains those).

Naming a topic precisely is half the battle, and tab completion helps: type :help text-obj and press Tab.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What does a minus sign before a feature in vim --version mean, for example -clipboard?

    • means compiled in, - means missing from this build.
  2. 2. Which file is the main Vim configuration file on Linux and macOS?

    Vim reads ~/.vimrc (or ~/.vim/vimrc). Neovim reads ~/.config/nvim/init.lua or init.vim.
  3. 3. How do you start Vim without loading any configuration?

    The -u NONE flag skips vimrc and plugins, which is useful to test whether a problem comes from your config.
  4. 4. What does :help i_CTRL-w refer to?

    The i_ prefix marks Insert mode; v_ is Visual and c_ is Command-line.

Summary

  • Install Vim or Neovim with your package manager; check --version for +clipboard.
  • Config lives in ~/.vimrc (Vim) or ~/.config/nvim/init.lua (Neovim); Windows uses other folders.
  • vim -u NONE starts with a clean slate.
  • vimtutor teaches the basics interactively; :help is the complete manual.
  • Help tags carry a mode prefix such as i_ or v_.

Next: Your First Edit: Open, Type, Save, Quit