Custom Neovim configuration designed to enhance development productivity. It includes tools such as LSP, DAP, autocompletion, fuzzy finding, Tree-sitter, tmux integration, ChatGPT, and more. Plugin management is handled using lazy.nvim. Requires Neovim 0.11 or newer.
This configuration has been extensively tested on macOS and Linux (Debian/Ubuntu). Minor issues may occur on other platforms.
Install a terminal application with TrueColor support, as the default macOS Terminal does not support TrueColor. On macOS (or Ubuntu), you can install, for example, WezTerm, a terminal emulator built with Rust that uses Lua for configuration, using Homebrew or APT.
brew install weztermInstall a Nerd Font, such as JetBrainsMono Nerd Font, on macOS using
brew install font-jetbrains-mono-nerd-fontFor Ubuntu, manually install the JetBrainsMono Nerd Font from
https://www.nerdfonts.com/font-downloads and cache it using fc-cache -fv.
If using Neovide, you must configure it to use the JetBrainsMono Nerd Font to
get the font and the icons to render.
Warning
Installing the font from https://www.jetbrains.com/lp/mono/ will install
without icons. This makes some plugins, like render-markdown.nvim fail to
render icons in Neovide.
Install Neovim using your preferred package manager. For example, on macOS, execute
brew install nvimNext, install the custom configuration. On UNIX-like systems, execute
mv ~/.config/nvim ~/.config/nvim.bak
mv ~/.local/share/nvim ~/.local/share/nvim.bak
mv ~/.local/state/nvim ~/.local/state/nvim.bak
git clone https://github.com/softwareqinc/nvim-sq ~/.config/nvim --depth 1Adapt accordingly for other OS-es. Finally, launch Neovim by executing
nvimThis configuration is written entirely in Lua, is documented, and self-contained. The main configuration file is init.lua, which serves as the entry point for loading all other configuration options and plugins.
Plugins are located under lua/plugins.
Key mappings can be found in lua/core/keymaps.lua.
Options are located in lua/core/options.lua.
A collection of snippets for various programming/scripting languages can be found under lua/snippets.
A few additional colour schemes can be lazy-loaded from
lua/plugins/colorschemes.lua.
Edit the
init.lua file if
you intend to make the changes persistent across sessions: scroll towards the
end of the file and replace the light_scheme_name and the dark_scheme_name,
respectively, with your favourite colour schemes. Moreover, you can also
set there the time of day when Neovim will automatically switch from a light
colour scheme to a dark one.
If you prefer a GUI Neovim client, consider Neovide. On macOS, install it with
brew install neovideThe Neovide configuration is located under lua/neovide.
From Neovim, run :checkhealth in case you are getting warnings/errors
and/or there are missing packages required for this configuration.
If curl is not available on your system (it is installed by default on
macOS), install it, as it is required by some plugins internally. On
Ubuntu/Debian Linux, you can install it with
sudo apt install curl
When starting Neovim on macOS, you may get a message about
gnu-sed being required. Install it (on
macOS) with
brew install gnu-sedIf Tree-sitter is missing, install it
(requires Rust) with
cargo install tree-sitter-cliIf npm is missing, install it (on macOS)
with
brew install npmIf lazygit is missing, install it
(on macOS) with
brew install lazygitIf the Neorg plugin fails to install or does not work properly, ensure that you have Lua or LuaJIT installed on your system. For installation instructions, follow Neorg's Kickstart.
The
ChatGPT plugin
assumes that the OpenAI API key is available as a text file in
$HOME/OpenAIkey.txt; modify accordingly on your system.
We assume that you have installed and configured GnuPG
accordingly (brew install gpg2 gnupg on macOS). Next, install
pinentry
for your platform, on macOS with
brew install pinetry-macFinally, execute
echo "use-agent" >> $HOME/.gnupg/gpg.conf
echo "pinentry-program $(brew --prefix)/bin/pinentry-mac" >> $HOME/.gnupg/gpg-agent.conf
gpgconf --reload gpg-agentThe steps above are mandatory, as otherwise Neovim will not be able to interactively ask for passphrases when trying to encrypt and/or decrypt.
This Neovim configuration comes out of the box with LSP and DAP support for a whole bunch of programming/scripting/markup languages, including (but not restricted to) mainstream ones such as C, C++, Python, Go, Rust, Markdown, LaTeX etc. Below we list potential issues that you may encounter for some specific languages.
To enable Julia support, install Julia (on macOS) with
curl -fsSL https://install.julialang.org | shNext, to enable full LSP integration, execute in a shell
julia --project=$HOME/.julia/environments/nvim-lspconfig -e 'using Pkg; Pkg.add("LanguageServer"); Pkg.add("SymbolServer"); Pkg.add("StaticLint")'Go binaries produced on macOS arm64 may not be code-signed properly. See golang/go#63997.
To fix, run
codesign -f -s - ~/.local/share/nvim/mason/packages/gopls/goplsEnsure that ghcup is installed, see
https://www.haskell.org/ghcup/install.