Neovim configuration
for an effective workflow on any machine (even headless)
The configuration is written in Lua as are most of the used plugins.
Config is based on but extended, modified and refactored
[TOC]
Neovim hyperextensible Vim-based text editor. It has Lua built-in functionality and 30% less source-code than Vim. This enables features on the command line that definitely improve your workflow on the command line and save you a ton of time. No other editor can compare.
- Vim is a good, fast text editor.
- IDEs are usually very practical for one or a couple of languages. So if you code in a different language, you will have to get familiar with a whole different setup. Neovim is highly extensible, and you can set it up for any language.
- It works on the command line on any machine, also on headless machines e.g. HPC.
- It is open source, free (both beer and freedom) and does not collect your telemetry data.
- etc.
- system-wide fuzzy file finding and grepping (nvim-telescope the best plugin out there)
- status bar (lualine.nvim)
- top bar (barbar.nvim
- highly customizable package management (lazy.nvim)
- incrementing/decrementing/toggle almost anything (dial.nvim)
- key mappings helper (which-key.nvim)
- syntax highlighting via regex for languages without nvim-treesitter
- developer icons (nvim-web-devicons)
- IMPORTANT: NEED ONE OR ALL PATCHED FONTS!
- database access (sql.nvim)
- colorschemes (nvcode-color-schemes.vim) check lua/plugins.lua for the full list
- commenting via Comment.nvim
-
- <span
style="color:green;font-weight:700;"
- language server protocol support (nvim-lspconfig
- Server install helper (mason.nvim, mason-lspconfig.nvim)
- Linter and formatter usage through null-ls.nvim
- Auto Completion engine (nvim-cmp)
- <span
style="color:green;font-weight:700;"
-
- <span
style="color:green;font-weight:700;"
ACTIVATE: enable git in user-settings
- function wrapper (Neogit in lua, vim-fugitive in vimL)
- gutter/git line info (gitsigns.nvim)
- NOTE: deactivate if it causes problems (seems to be an issue with older git versions)
- <span
style="color:green;font-weight:700;"
-
Language parsing features for ~60 languages (nvim-treesitter)
- <span
style="color:green;font-weight:700;"
ACTIVATE: Enable language_parsing in user-settings
- highlighting
- syntax tree structure
- indenting
- refactoring
- scope
- textobjects
- rainbow parenthesis
- commenting
- <span
style="color:green;font-weight:700;"
-
- Integrated for most languages (LuaSnip and friendly-snippets)
-
- Configurable debug adapter (nvim-dap
- install debuggers with mason.nvim
- Configurable debug adapter (nvim-dap
-
-
A framework for interacting with tests within NeoVim. (neotest
- Install test runners with mason.nvim
-
Python config via neotest-python
-
Vitest config via neotest-vitest
-
More testing tools integrated via neotest-vim-test
-
-
efficiency stuff (anything by tpope)
-
visual/UI stuff (anything by folke)
-
- Ranger file browser (rnvimr, requires ranger (and Ueberzug for media file rendering))
- Markdown renderer in Terminal Glow.nvim or in Browser nvim-markdown-preview
- neovim >=0.5 and its install requirements (check neovim build instructions)
- git (if it is an old version you may need to tweak packer.nvim config, check their GH)
- A patched font on the machine that is rendering your output (best install NerdFonts)
- fzf (for good fuzzy file finding)
- rg (for text matching, requires rust)
- sqlite3 (for database conns)
- python3 with pynvim package
- The entry barrier can be quite high. If you are new to Vim, I recommend start
you start with the vimtutor. Open neovim
nvim
and type:Tutor
. - Once you are familiar with vim movements and basic editing commands, you NEED to read vim-galore
- Start by only using it for basic tasks. Once you can move around, explore more functionality. Plugins are listed in plugins.lua
- Have a look at the command list and implement nvim-telescope to find and open files. Once that is implemented, move on.
- Explore the config and feel free to add/remove/change anything you want.
- Get familiar with the usual vim keys.
- Keymaps specific to this config can be found in here and here.
- The leader key (space for us) opens up a menu, that shows you some commands.
- Some mappings are listed below but the source of truth will be the above mentioned file.
- vim aims to make you use your whole keyboard but mostly the keys on your home row.
- vim commands follow a system (most of the time) An example:
- Think of the first letter of the action you want to perform e.g. d = delete. Think of the first letter of the the word describing where you want to perform the action (mostly i = in or a = around, t = 'til). Think of the subject for the action e.g. w = word, p = paragraph, l = letter. Ergo diw = delete in word. Another way is to use motion commands, instead of location and subject. This is how you perform basic actions.
The mnemomics for this config should extend that way of thinking. Say you want to fuzzy find a file in your curretn project and open it in vertical split (nvim-telescope). In normal mode, hit leader (space) to activate your personal mode. Think of the first letter of the action you want to perform (s = search). Think of the thing you want to search (f = file, s = symbols, t = text (grep), p = projects). space-sf will put you in file search mode. Use Ctrl-n/p to go to next/prev item in the list. Once you have a file selected, you can open it (Enter) in vertical split (Ctrl-v) or in horizontal split (Ctrl-x). This plugin can find literally anything for you. Here are some examples: Files, Text (grep, using ripgrep), Document/Workspace symbols (like tags but better, needs LSP or treesitter), git commits, git branches, items in your quickfix list, old files (recent files), marks, manpages (help), colorschemes, diagnostic errors (needs LSP).
- find best, minimal setup
- ship some patched fonts
- handle installation of dependencies
- figure out how to ship globally