When Life Gives You Time Off Install and Configure Neovim
Priyanshu Verma

Priyanshu Verma @priyanshuverma

About: I am a technologist

Location:
India
Joined:
Dec 22, 2022

When Life Gives You Time Off Install and Configure Neovim

Publish Date: Jun 4
20 8

Hello. So here’s what happened. I recently found out — almost accidentally — that I had summer vacations. Not the planned kind with beaches and iced tea, but the kind that sneaks up on you and leaves you staring at the wall asking, “Now what?”

Naturally, I had two options: waste time or waste time in a way that looks productive. I chose the latter. That’s how I stumbled into setting up Neovim.

If you don’t know what Neovim is… well, don’t worry, you’re probably happier that way. But if you’re curious (or just here for the chaos), let me walk you through how I went from zero to semi-obsessed with a glorified terminal text editor.

Why Neovim? (And What Even Is It?)

So here’s the thing — I recently started learning Go (aka Golang, aka "Google’s gift to minimalists"), and while going through a couple of tutorials, I noticed something... odd. A bunch of the devs in those videos weren’t using the usual suspects like VSCode or JetBrains. Nope. They were in vim. Like, full-on terminal-only, blinking-cursor, keyboard-ninja mode.

That alone didn’t convince me. But it did tickle my curiosity.

What’s so special about this ancient-looking editor that people still use it in 2025?

After a bit of Googling and Reddit lurking, I stumbled upon Neovim — the younger, cooler cousin of Vim. Neovim promised modern features, better plugin support, async everything, and a rabbit hole so deep that it practically dares you to fall in. So obviously, I took the bait.

I didn’t really need a new text editor. But I needed something to justify avoiding real responsibilities during summer. Neovim seemed perfect.

First Encounter: A Blank Screen and an Existential Crisis

Installing Neovim — or so I thought — was supposed to be the easy part.

A simple sudo apt install neovim, right?

Well, not for me.

I'm on WSL (Windows Subsystem for Linux), and when I ran:

sudo apt install neovim
Enter fullscreen mode Exit fullscreen mode

I got hit with this:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package neovim is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'neovim' has no installation candidate
Enter fullscreen mode Exit fullscreen mode

What does this mean? Basically: “Neovim? Never heard of it.”

Apparently, Neovim isn’t in the default Ubuntu repo on WSL. Great.

So I headed over to the Neovim GitHub like any lost soul would and followed the official install steps:

curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux-x86_64.tar.gz
sudo rm -rf /opt/nvim
sudo tar -C /opt -xzf nvim-linux-x86_64.tar.gz
Enter fullscreen mode Exit fullscreen mode

Then I added it to my PATH and cleaned up:

rm nvim-linux-x86_64.tar.gz
export PATH="$PATH:/opt/nvim-linux-x86_64/bin"
Enter fullscreen mode Exit fullscreen mode

Finally, I typed neovim and hit Enter.

...“Command not found.”

Of course.

Turns out, the command is actually nvim.

Seriously? Who decided that?

Anyway — I typed nvim this time, and boom — it opened.

Well, “opened” is generous. What I saw was a blank terminal. No UI, no buttons, not even a helpful hint. Just a blinking cursor and the haunting silence of a terminal waiting for your next move.

After a deep breath and remembering that :q is the exit command, I hit i to go into insert mode, typed something random, hit Esc, and then typed :q.

Instead of quitting, it slapped me with this:

E162: No write since last change for buffer "[No Name]"
Press ENTER or type command to continue
Enter fullscreen mode Exit fullscreen mode

I had no idea what that meant, but I definitely knew I didn’t like it.

This is the moment I panicked.

And like every sane human, I Googled: “how to exit Vim.”

There it was — my first real Neovim lesson:

:q!
Enter fullscreen mode Exit fullscreen mode

The magic command to force quit.

I was in.

Well, technically, I was out — but you get the point.
You're doing a great job capturing the honest, fun chaos of learning Neovim. The tone and personality are strong — it’s like reading the journal of someone falling into a beautiful rabbit hole. Below is your draft enhanced for flow, clarity, and a touch of polish while preserving your voice and humor.

Next up: Configuring It to Make It Feel Like Home

To configure Neovim, I stumbled upon NvChad — mostly because I liked the name. It sounded like the kind of setup that might high-five you after a successful config. So, I pulled it in:

git clone -b v2.0 https://github.com/NvChad/NvChad ~/.config/nvim --depth 1
Enter fullscreen mode Exit fullscreen mode

When I ran nvim, I realized it still wasn’t globally available. So I added Neovim to my PATH and gave it a friendly nickname while I was at it:

echo 'export PATH="$PATH:/opt/nvim-linux-x86_64/bin"' >> ~/.zshrc
echo 'alias vim="nvim"' >> ~/.zshrc
source ~/.zshrc
Enter fullscreen mode Exit fullscreen mode

Now I can just type vim and it opens Neovim like a charm.

When NvChad launched, it brought up what looked like a package manager asking me to install a bunch of things. I pressed i, and off it went — downloading plugins and setting up the vibe.

Once it finished, I restarted Neovim and immediately changed the color theme. The keymap for this was refreshingly intuitive. The important thing to understand is the leader key, which is <space> by default. Pressing it in normal mode (not insert!) opens up a mini keymap menu at the bottom.

To change the theme:

<space> + t + h
Enter fullscreen mode Exit fullscreen mode

A beautiful little theme selector popped up, and I picked my favorite. Instantly, the UI felt like mine.


Learning the Basics (It Feels Like a Game)

So far, here’s what I’ve picked up about using Neovim:

Modes

  • NORMAL mode — for navigating and running commands. (Esc)

  • INSERT mode — for writing text. (i)

Movement (aka the Game Begins)

Instead of arrow keys, Neovim encourages hjkl for movement:

  • h — left

  • j — down

  • k — up

  • l — right

It's weirdly satisfying. Like I’m playing a keyboard-only game.

(Neovim: The Roguelike Editor™?)

I found this and more inside the built-in tutorial:

:Tutor
Enter fullscreen mode Exit fullscreen mode

Keymaps I Use Now

I’ll refer to the leader key (<space>) as <lk> from now on.

  • <lk> + h — open a new terminal

  • <Ctrl> + n — toggle file explorer

  • <Tab> — switch between open files

  • :w — save the file

  • <lk> + x — close currently opened file

Inside the file explorer:

  • a — add a new file

  • r — rename a file

  • d — delete a file

  • dd — delete a line at the cursor

It’s all starting to click. The muscle memory is slowly forming. And every time I don’t reach for the mouse, I feel a tiny spark of pride.

Plugins and LSPs: Making It Actually Useful

Now that I know how to move around without rage-quitting, it's time to make Neovim actually useful for coding.

Here's my current plugin wishlist — essential tools to help me survive:

  • Auto format on save

  • LSP support (language servers for Go, JavaScript, etc.)

  • Copilot (yes, I sold my soul for AI auto-complete)

  • Time tracker (for accountability and/or guilt)

  • Discord Rich Presence (because I want people to know I’m tweaking my dotfiles at 2 AM)

Let’s Start Adding the Essentials

To test things out in a real-world scenario, I decided to open one of my Next.js projects — it just felt right to see how Neovim behaves with an actual codebase. Navigating was simple enough: I jumped into the project directory and ran vim.

And... boom. The interface opened — but instead of icons, I was greeted with mysterious question marks scattered across the UI. Classic font mismatch.

No worries — I quickly traced the issue back to my terminal fonts not being compatible with Neovim’s fancy icon setup. The solution? Nerd Fonts. After some browsing, I chose 0xProto Nerd Font, installed it, and set it as the default font in my terminal.

Problem solved. The icons rendered beautifully, and Neovim suddenly felt alive.

Getting Auto-Completion Working (The LSP Journey Begins)

With my project open, I quickly noticed the lack of auto-completion — something I’d grown dependent on. No popups, no suggestions... just silence. Time to bring in the cavalry: a Language Server Protocol (LSP) for TypeScript.

To get started, I needed to tweak Neovim’s configuration. I headed to my config folder — and naturally, used Neovim itself to edit it:

cd ~/.config/nvim && vim
Enter fullscreen mode Exit fullscreen mode

A blank screen greeted me. If you’ve followed along, you’ll know how to open the file tree (check the previous section if not). Once inside the tree, I navigated to:

lua/custom/chadrc.lua
Enter fullscreen mode Exit fullscreen mode

Inside that file, I added:

M.plugins = "custom.plugins"
Enter fullscreen mode Exit fullscreen mode

This line tells Neovim to look for our plugin configurations in a custom file.

Next, I saved the changes (:w in INSERT mode) and created a new file:

lua/custom/plugins.lua
Enter fullscreen mode Exit fullscreen mode

Inside this file, I scaffolded a basic structure:

local plugins = {}
return plugins
Enter fullscreen mode Exit fullscreen mode

Now that the foundation was set, it was time to add the real hero: nvim-lspconfig. I edited plugins.lua and added the following inside the plugins table:

{
  "neovim/nvim-lspconfig",
  config = function()
    require "plugins.configs.lspconfig"
    require "custom.configs.lspconfig"
  end,
},
Enter fullscreen mode Exit fullscreen mode

This configuration loads the built-in LSP setup while also pointing to our custom overrides.

Creating Our LSP Config

Now to wire up our actual configuration. I created a new folder and file:

  • Folder: lua/custom/configs

  • File: lspconfig.lua

(If you’re in Neovim’s file tree, you can press <Ctrl> + n to open the tree, move the cursor to custom, press a, and type configs/lspconfig.lua.)

In lspconfig.lua, I wrote the following:

local on_attach = require("plugins.configs.lspconfig").on_attach
local capabilities = require("plugins.configs.lspconfig").capabilities

local lspconfig = require("lspconfig")

local servers = {"tsserver", "tailwindcss", "eslint"}

for _, lsp in ipairs(servers) do
  lspconfig[lsp].setup {
    on_attach = on_attach,
    capabilities = capabilities,
  }
end
Enter fullscreen mode Exit fullscreen mode

This sets up LSPs for TypeScript, Tailwind CSS, and ESLint. The best part? It’s extendable. I can easily plug in support for Rust or Go later by just appending to the servers list.

Installing Language Servers with Mason

Installing language servers manually is tedious, so I reached for Mason.nvim to automate the job.

Back in plugins.lua, I added:

{
  "mason-org/mason.nvim",
  opts = {
    ensure_installed = {
      "eslint-lsp",
      "prettierd",
      "tailwindcss-language-server",
      "typescript-language-server",
    },
  },
},
Enter fullscreen mode Exit fullscreen mode

After saving, I relaunched Neovim and ran:

:MasonInstallAll
Enter fullscreen mode Exit fullscreen mode

Voilà! Language servers downloaded and ready to go. At this point, TypeScript and Tailwind auto-completion were working like magic.

Adding Formatting with Prettier

However, auto-completion alone isn’t enough — we need formatting too. Even though we had installed prettierd, it wasn’t doing its job yet.

Enter: none-ls.nvim — the plugin that bridges formatters and linters to Neovim.

In plugins.lua, I added:

{
  "nvimtools/none-ls.nvim",
  event = "VeryLazy",
  opts = function()
    return require "custom.configs.none-ls"
  end,
},
Enter fullscreen mode Exit fullscreen mode

Time for one last config file. I created:

lua/custom/configs/none-ls.lua
Enter fullscreen mode Exit fullscreen mode

Inside it, I added:

local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
local null_ls = require("null-ls")

local opts = {
  sources = {
    null_ls.builtins.formatting.prettierd,
  },
  on_attach = function(client, bufnr)
    if client.supports_method("textDocument/formatting") then
      vim.api.nvim_clear_autocmds({
        group = augroup,
        buffer = bufnr,
      })
      vim.api.nvim_create_autocmd("BufWritePre", {
        group = augroup,
        buffer = bufnr,
        callback = function()
          vim.lsp.buf.format({ bufnr = bufnr })
        end,
      })
    end
  end,
}

return opts
Enter fullscreen mode Exit fullscreen mode

This hook listens for file saves and auto-formats the code using prettierd. Exactly what we need for a smooth dev experience.

And just like that, LSP support is fully integrated — from completion to formatting. My Neovim setup just leveled up.

Let’s Bring in AI ✨ (and Some Visual Flair)

Now that LSP and formatting are handled, it's time to supercharge my workflow — with AI!

🧠 Adding GitHub Copilot

Integrating Copilot with Neovim is surprisingly simple. I opened up my trusty plugins.lua file once again and added the following plugin definition to the list:

{
  "github/copilot.vim",
  event = "InsertEnter",
}
Enter fullscreen mode Exit fullscreen mode

This tells Neovim to lazily load Copilot the moment I enter INSERT mode.

After saving the file, I restarted Neovim and ran:

:Copilot setup
Enter fullscreen mode Exit fullscreen mode

This initialized Copilot and connected it to GitHub. If for some reason it didn’t load automatically, I nudged it manually:

:Lazy load copilot.vim
Enter fullscreen mode Exit fullscreen mode

Just like that — Copilot was ready to start pairing with me. Smart suggestions, code completions, and a boost in productivity — unlocked!

Syntax Highlighting with Treesitter

With Copilot onboard, it was time to make the editor more readable and pleasing to the eyes. For that, I turned to Treesitter — the gold standard for syntax highlighting and parsing.

Again, I popped into plugins.lua and added:

{
  "nvim-treesitter/nvim-treesitter",
  opts = function()
    local opts = require "plugins.configs.treesitter"
    opts.ensure_installed = {
      "lua",
      "javascript",
      "typescript",
      "tsx",
    }
    return opts
  end,
}
Enter fullscreen mode Exit fullscreen mode

I made sure to include tsx for React support, and of course, you can toss in other languages like rust and go if your stack demands it.

Now everything — from tags to braces — was beautifully color-coded and structured.

⏱️ Optional (But Cool): WakaTime for Coding Analytics

This one’s for the productivity nerds out there — like me. I love tracking how much time I actually spend coding, so I set up WakaTime, which gives me detailed insights into where my time goes.

To install the plugin, I added the following to (yes, again) plugins.lua:

{ "wakatime/vim-wakatime", lazy = false }
Enter fullscreen mode Exit fullscreen mode

After restarting Neovim, I simply ran:

:WakaTimeApiKey
Enter fullscreen mode Exit fullscreen mode

Then pasted in my API key from the WakaTime dashboard. Boom — time tracking was live. I could now see how long I spend inside Neovim, what languages I code in the most, and when I’m most productive.

With AI suggestions, beautiful syntax, and time-tracking all set up, Neovim was starting to feel less like a terminal — and more like an IDE.

Here's a polished and storytelling-enhanced version of your final section. It stays faithful to your technical steps, while improving clarity and flow:

Final Touch: Flexing on Discord with Rich Presence

For the final touch, I decided to bring in Discord Rich Presence so I can subtly flex my Neovim setup to friends — because why not?

After a bit of research, I learned that Discord RPC doesn't work out-of-the-box in WSL2 due to limitations in how it handles inter-process communication. It does work in WSL1, but I wanted to try getting it working in WSL2 anyway using a clever workaround.

Step 1: Add the Plugin

As always, I started by adding the plugin to my plugins.lua:

{ 'vyfor/cord.nvim', lazy = false }
Enter fullscreen mode Exit fullscreen mode

Then opened Neovim and ran:

:Cord update
Enter fullscreen mode Exit fullscreen mode

If it works at this point — you're golden. But like many WSL2 users, I hit a wall. So I followed these instructions to bridge Discord from WSL to Windows.

Step 2: Install Required Tools

You'll need two pieces:

  • socat — for socket redirection in WSL

  • npiperelay — to communicate with Windows named pipes

Start by installing socat inside your WSL terminal:

sudo apt install socat
Enter fullscreen mode Exit fullscreen mode

Then clone and build npiperelay for Windows:

git clone https://github.com/jstarks/npiperelay.git 
go install github.com/jstarks/npiperelay
Enter fullscreen mode Exit fullscreen mode

Now build it for Windows and place it somewhere accessible:

GOOS=windows go build -o /mnt/c/Users/<username>/go/bin/npiperelay.exe github.com/jstarks/npiperelay
Enter fullscreen mode Exit fullscreen mode

Replace <username> with your actual Windows username.

Create a symbolic link for convenience:

sudo ln -s /mnt/c/Users/<username>/go/bin/npiperelay.exe /usr/local/bin/npiperelay.exe
Enter fullscreen mode Exit fullscreen mode

Step 3: Hook into Your Neovim Launch

We now need to run socat and npiperelay each time we launch Neovim, so I created a wrapper function in my .bashrc (or .zshrc):

nvim() {
    if ! pidof socat > /dev/null 2>&1; then
        [ -e /tmp/discord-ipc-0 ] && rm -f /tmp/discord-ipc-0
        socat UNIX-LISTEN:/tmp/discord-ipc-0,fork \
            EXEC:"/usr/local/bin/npiperelay.exe //./pipe/discord-ipc-0" 2>/dev/null &
    fi

    if [ $# -eq 0 ]; then
        command nvim
    else
        command nvim "$@"
    fi
}
Enter fullscreen mode Exit fullscreen mode

This ensures the IPC bridge is set up only once, and works whether I run nvim directly or pass it files as arguments.

If you prefer, you can rename this function or alias it to something else.

Done!

That’s it — a full minimal Neovim config:

  • 📜 Syntax highlighting

  • 🤖 AI with Copilot

  • 🧠 LSP and formatting support

  • ⌛ Time tracking

  • 🕹️ Discord Rich Presence

Now I can code with AI assistance, auto-format on save, track my hours, and flex on Discord — all within a terminal. I wasted too much time setting this up, now I'm going to eat something.

Note: This guide reflects my personal setup and preferences. I am not affiliated with, promoting, or endorsing any of the tools or services mentioned. Please evaluate and use them based on your own requirements and discretion.

Follow me on GitHub @PriyanshuPz

Comments 8 total

Add comment