dev-guides

Neovim (NvChad) Workflow

Similar to the Vim workflow guide, this document aims to help you set up a robust developer environment using Neovim and NvChad. Neovim is a refactor of Vim that allows for easier configuration and plugin management (often using Lua), and NvChad is a pre-configured config that makes Neovim look and act like an IDE while retaining the speed of Vim.

By the end of this guide, you will have:

Host Machine Setup

Since you will likely be SSHing into the VM or working locally, having a good terminal on your host machine (your laptop/desktop OS) is critical.

1. Terminal Emulator

You need a modern terminal emulator that supports true color and correct font rendering.

2. Nerd Font

NvChad relies heavily on icons which are not present in standard fonts. You must install a “Nerd Font” on your host machine and configure your terminal to use it.

  1. Go to Nerd Fonts and download a font (e.g., JetBrainsMono Nerd Font or Hack Nerd Font).
  2. Install the font:
    • macOS: Double-click the .ttf files in the downloaded zip and click “Install”.
    • Windows: Select all .ttf files, right-click, and choose “Install”.
    • Linux: Move font files to ~/.local/share/fonts and run fc-cache -fv.
  3. Configure your terminal: Open your terminal’s settings (Preferences > Profiles > Text) and select the Nerd Font you just installed.

Guest VM Setup

The following steps should be performed inside your Linux environment (e.g., the class VM).

Neovim & Ripgrep

We need a recent version of Neovim (>= 0.9.0) and Ripgrep. We recommend using snap for the easiest installation on Ubuntu/Debian-based VMs.

$ sudo snap install nvim --classic
$ sudo apt install ripgrep 

Build Tools

Ensure you have the basic build tools installed:

$ sudo apt install build-essential git curl

NvChad Installation

NvChad provides a “starter” configuration that you can clone and customize.

  1. Delete your existing Neovim config (if any PLEASE BACK THESE UP IF YOU HAVE EXISTING CONFIGS):
    $ rm -rf ~/.config/nvim
    $ rm -rf ~/.local/share/nvim
    $ rm -rf ~/.local/state/nvim
    $ rm -rf ~/.cache/nvim
    
  2. Clone the NvChad starter repository:
    $ git clone https://github.com/NvChad/starter ~/.config/nvim
    
  3. Start Neovim:
    $ nvim
    

    NvChad will automatically install plugins and setup the environment. During the first launch, say “N” (No) if asked to install example custom config, as we want a clean slate to add our own.

Cscope Setup

Cscope allows you to browse C code efficiently. We will integrate it into NvChad.

1. Install Cscope

Install the tool itself:

$ sudo apt install cscope

2. Configure Cscope in NvChad

We will use the dhananjaylatkar/cscope_maps.nvim plugin. In NvChad v2.5, plugins are managed via lazy.nvim in the lua/plugins/ directory.

Create a new file ~/.config/nvim/lua/plugins/cscope.lua:

local function find_cscope_out()
  local buf = vim.api.nvim_buf_get_name(0)
  local start = (buf ~= "" and vim.fs.dirname(buf)) or vim.loop.cwd()

  return vim.fs.find("cscope.out", { path = start, upward = true })[1]
end

return {
  {
    "dhananjaylatkar/cscope_maps.nvim",
    lazy = false,
    dependencies = { "nvim-telescope/telescope.nvim" },
    config = function()
      require("cscope_maps").setup({
        prefix = "<leader>c",
        cscope = {
          exec = "cscope",
          picker = "telescope",
          db_file = find_cscope_out() or (vim.loop.cwd() .. "/cscope.out"),
        },
      })
    end,
  },
}

Restart Neovim (:q and then nvim). The plugin should install automatically (if it does not, please open vim and type :Lazy install).

Usage

Generating the Database

In your kernel or project root directory, you still need to generate the cscope database.

$ cd <path-to-homework-assignment>
$ make cscope

Or manually:

$ cscope -b -q -k

Key Mappings

With the configuration above, your Cscope mappings will start with <leader>c (Layout is usually Space + c).

Wait for the telescope window to pop up with your results!

Fin

You now have a modern, high-performance editor setup for OS development. Explore NvChad’s documentation to learn more about themes, mappings, and customization.

Demo:

Neovim


Acknowledgements

The guide was created by the following TAs of COMS W4118 Operating Systems I, Spring 2026, Columbia University: