Amos Blog

NeoVim Installation

ยท by Amos

NeoVim

After some consideration, I decided to install NeoVim on my new MacBook Pro. Having used it sporadically at home and work before, I wanted to give it another shot. This post shares my experience installing NeoVim and creating a minimal configuration tailored to my needs.

My Previous Attempt

The last time I installed NeoVim, I followed an excellent blog post by Josean Martinez. Alongside the blog and a YouTube video, I managed to replicate the setup on my MacMini. However, I didnโ€™t fully understand parts of the configuration, especially some pluginsโ€”this was mostly my lack of knowledge rather than unclear instructions.

The main issue was ending up with a fully working config I barely understood. I realized this painfully when trying to set up VimTex, a plugin for working with LaTeX. Since Iโ€™m not a developer or programmer, my primary use of NeoVim is to write and edit text files, HTML, CSS, and mostly LaTeX documents. My goal was a working setup to create and edit .tex files with all the power of NeoVim, including snippets.

I still use VSCode alongside NeoVim. Although integrating Vim with VSCode can be frustrating, VSCode meets most of my needs. When I finally got VimTex working in NeoVim, I saw its great potential to speed up my workflow and leverage superior snippet functionality (which doesnโ€™t work well for me on VSCode with Vim emulation). However, I burned out on configuration and didnโ€™t replicate these settings at work, so I ended up with a working NeoVim setup I rarely used at home and mainly reverted to VSCode.

A New Mac, a New Try

A couple of months ago, I got a new laptop and adopted a minimalist philosophy: keep things clean and lean. I installed software mostly via Homebrew and limited Microsoft apps (still have to use Teams for university). I also restrained myself from installing too many new apps unless compelling.

So the question was: Should I install NeoVim again and try to get VimTex working?

With some weeks off work, I decided to give it a proper tryโ€”but I took a different approach this time.

Following TJ DeVries’ excellent video, I used Kickstart as a base instead of starting from scratch. The documentation was fantastic; reading through the init.lua file with its clear comments helped me understand rather than blindly copy configurations.

I tweaked the setup and reorganized plugins to minimize code I understood little or nothing about. This is my final file structure:

.
โ”œโ”€โ”€ doc
โ”‚ย ย  โ”œโ”€โ”€ kickstart.txt
โ”‚ย ย  โ””โ”€โ”€ tags
โ”œโ”€โ”€ init.lua
โ”œโ”€โ”€ lazy-lock.json
โ”œโ”€โ”€ lua
โ”‚ย ย  โ”œโ”€โ”€ custom
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ core
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ init.lua
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ keymaps.lua
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ options.lua
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ plugins
โ”‚ย ย  โ”‚ย ย      โ”œโ”€โ”€ alpha.lua
โ”‚ย ย  โ”‚ย ย      โ”œโ”€โ”€ autopairs.lua
โ”‚ย ย  โ”‚ย ย      โ”œโ”€โ”€ blink.lua
โ”‚ย ย  โ”‚ย ย      โ”œโ”€โ”€ bufferline.lua
โ”‚ย ย  โ”‚ย ย      โ”œโ”€โ”€ colorscheme.lua
โ”‚ย ย  โ”‚ย ย      โ”œโ”€โ”€ conform.lua
โ”‚ย ย  โ”‚ย ย      โ”œโ”€โ”€ guess-indent.lua
โ”‚ย ย  โ”‚ย ย      โ”œโ”€โ”€ indent_line.lua
โ”‚ย ย  โ”‚ย ย      โ”œโ”€โ”€ lazydev.lua
โ”‚ย ย  โ”‚ย ย      โ”œโ”€โ”€ lspconfig.lua
โ”‚ย ย  โ”‚ย ย      โ”œโ”€โ”€ mini.lua
โ”‚ย ย  โ”‚ย ย      โ”œโ”€โ”€ nvim-tree.lua
โ”‚ย ย  โ”‚ย ย      โ”œโ”€โ”€ telescope.lua
โ”‚ย ย  โ”‚ย ย      โ”œโ”€โ”€ todo-comments.lua
โ”‚ย ย  โ”‚ย ย      โ”œโ”€โ”€ treesitter.lua
โ”‚ย ย  โ”‚ย ย      โ”œโ”€โ”€ vimtex.lua
โ”‚ย ย  โ”‚ย ย      โ””โ”€โ”€ which-key.lua
โ”‚ย ย  โ””โ”€โ”€ kickstart
โ”‚ย ย      โ”œโ”€โ”€ health.lua
โ”‚ย ย      โ””โ”€โ”€ plugins
โ”‚ย ย          โ”œโ”€โ”€ debug.lua
โ”‚ย ย          โ”œโ”€โ”€ gitsigns.lua
โ”‚ย ย          โ”œโ”€โ”€ lint.lua
โ”‚ย ย          โ””โ”€โ”€ neo-tree.lua
โ”œโ”€โ”€ node_modules
โ”‚ย ย  โ””โ”€โ”€ tree-sitter-cli
โ”‚ย ย      โ”œโ”€โ”€ cli.js
โ”‚ย ย      โ”œโ”€โ”€ dsl.d.ts
โ”‚ย ย      โ”œโ”€โ”€ install.js
โ”‚ย ย      โ”œโ”€โ”€ LICENSE
โ”‚ย ย      โ”œโ”€โ”€ package.json
โ”‚ย ย      โ”œโ”€โ”€ README.md
โ”‚ย ย      โ””โ”€โ”€ tree-sitter
โ”œโ”€โ”€ package-lock.json
โ”œโ”€โ”€ package.json
โ””โ”€โ”€ README.md

I kept the Kickstart files separate from my custom folder. Most plugins were initially called inside init.lua, but I created individual .lua files for each plugin I somewhat understood. The result is a reasonable, working configuration.

VimTex Setup

The last piece was installing VimTex. The original EJmastnack tutorial is very helpful, but it targets VimScript, and since my config is in Lua, some adaptation was necessary.

A Small Hiccup

I ran into a hiccup using Treesitter for LaTeX syntax highlighting. Apparently, tree-sitter-cli must be installed manually via npm to build LaTeX support (oddly, this step isnโ€™t required for BibTeX). If I need to do this again, the command that solved it was:

npm install -g tree-sitter-cli

#neovim #latex #software