Neovim 101 — Code Outline

Visualize and navigate the source code.

alpha2phi
5 min readSep 30, 2022
Neovim 101 — Code Outline

In this article, let’s go through the different solutions that allow us to visualize and easily navigate the source code.

This article is part of the Neovim 101 series.

The Neovim configuration files are available in this repository.

Getting Started

As programmers, we always need to jump around to find or view where identifiers are defined and used. By default, Vim provides a way to do this. With the Tree-sitter and LSP features provided by Neovim, this has been made even easier for us.

In this article, we will go through the different ways to visualize and navigate the source code.

Tags

Traditionally Vim uses tags to jump around to find the identifiers.

A tag is a location where an identifier is defined. An example is a function definition in a C or C++ program. A list of tags is kept in a tags file. This can be used by Vim to directly jump from any place to the tag, the place where an identifier is defined.

To generate the tag file, we need to install and use universal-ctags.

Let’s go through an example. In the screenshot below, we use the ctags command to generate…

--

--

alpha2phi

Software engineer, Data Science and ML practitioner.