Setup Vim (Astro Vim) on a Macbook

Posted on Jul 31, 2022

Overview

Use the following steps to have a decent vim installation relatively quickly on a Macbook with a M1 / M2 chipset

Brew installation

Brew is a package manager for MacOS which makes it very easy to install packages. I highly recommend this package manager on MacOS. Its worth the effort to get it installed you will thank yourself later on.

From www.brew.sh -

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Sample command using brew -

brew install wget

Install NeoVim

Neovim is our base vim install. Install Neovim using the command -

brew install neovim

Install Astro Vim

AstroNvim is an aesthetic and feature-rich neovim config that is extensible and easy to use with a great set of plugins. Install AstroNvim by using the commands

git clone https://github.com/AstroNvim/AstroNvim ~/.config/nvim

nvim +PackerSync

Setup Astro Vim

Make a backup of your existing nvim configuration -

mv ~/.config/nvim ~/.config/nvimbackup

Install LSP

Enter :LspInstall followed by the name of the server you want to install
Example: :LspInstall pyright

Install language parser

Enter :TSInstall followed by the name of the language you want to install
Example: :TSInstall python

Manage plugins

Run :PackerClean to remove any disabled or unused plugins
Run :PackerSync to update and clean plugins

Update AstroNvim

Run :AstroUpdate to get the latest updates from the repository

Install NerdFonts

Follow this step to install your desired fonts and so font glyphs are rendered correctly

Firacode is my current favourite ♥️

Fonts can be downloaded from https://www.nerdfonts.com/font-downloads

Optional requirements

These are other optional packages which can be installed -

ripgrep - live grep telescope search (leader + fw)

lazygit - git ui toggle terminal (leader + tl or leader + gg)

NCDU - disk usage toggle terminal (leader + tu)

Htop - process viewer toggle terminal (leader + tt)

Python - python repl toggle terminal (leader + tp)

Node - node repl toggle terminal (leader + tn)