NeoVim Config on Apple Silicon

NeoVim

I want to use neovim as my build environment for C++.

Couple of pre-requisites before you even start.

  • Install XCode (Download from the AppStore)
  • Install the command line tools xcode-select --install
  • Install brew from brew.sh

Installing

Though you can install NeoVim by package from neovim.io I don't recommend this. This is because it will install an application built with the Intel CPU instruction set (this runs because of the emulation mode). This is fine for most operations, but when you use NeoVim as an IDE, it will build the code for the Intel processor. The better option is to install NeoVim from Brew.sh as this will install the appropriate version of NeoVim for the current CPU.

Since I use the lazy package manager I also install luarocks at the same time.

brew install neovim
brew install luarocks

Config

Color Themes

You can find a good set of color themes here:

Cursor Visibility

I found that the cursor is not always very visible. I use the following command in my config to make the cursor visible in light and dark themes.

vim.cmd([[ set guicursor=n-v-c:block,i-ci-ve:ver25,r-cr:hor20,o:hor50,a:blinkwait700-blinkoff400-blinkon250-Cursor/lCursor,sm:block-blinkwait175-blinkoff150-blinkon175 ]])

Tree Sitter

Tree sitter is a language parser that is extremely fast.

Once you have installed it (via your package manager) into NeoVim. You can install additional parsers for specific languages with :TSInstall

:TSInstall c
:TSInstall cpp
:TSInstall java
:TSInstall python

Language Server

Related Posts

C++ Wrapper for Socket

The last two articles examined the "C Socket" interface provided by the OS. In this article, I wrap this functionality in a simple C++ class to provide guaranteed closing and apply a consistent except

Read More

Common Mistakes

### 1: using namespace Every new developer who comes to C++ always starts writing code like this: #### myfirstprog.cpp ```c #include <iostream> using namespace std; ``` It seems reasonable, and e

Read More

Control Flow

So far, we have created basic programs that perform a single task without making any decisions. Most (all but the most trivial) programming languages provide decision-making constructs (Conditional B

Read More