- Lua 87.3%
- TeX 12.2%
- Shell 0.5%
| after/ftplugin | ||
| lsp | ||
| lua/weeheavy | ||
| mkcheatsheet | ||
| .luarc.json | ||
| CHEATSHEET.md | ||
| CHEATSHEET.pdf | ||
| init.lua | ||
| lazy-lock.json | ||
| nerdfont_symbol_ref.md | ||
| README.md | ||
| sample.png | ||
My Neovim configuration
Motivation
After doing my first steps with https://github.com/nvim-lua/kickstart.nvim, I decided to roll my own, custom, "lightweight" Neovim configuration in order to better understand Neovim and its configuration/customization, package managers, plugins etc. and have my own config that only includes parts I need. More on the "why's" are explained in my blog post.
Installation
- Install Neovim 0.12 or newer
- Install the dependencies documented in
init.lua - Clone this Git repository to
~/.config/nvimon macOS or Linuxc:\Users\foobar\AppData\Local\nvimon Windows
Finishing touches
- Create a
$HOME/.ignorefile and add big, useless directories to it, so ripgrep, fd can ignore those. Ideas:Pictures/ Music/ Applications/ dotnet/ opt/miniconda3/ Library/ .cache/ .vscode/ .git/ .local/ .m2/ .npm/ - Install Mason LSP/linter/formatters from the table down below
Speed
It's not too important. Still, I try to balance increasing startup time with the usefullness of a plugin.
Output from lazy.nvim profiling (:Lazy profile) on a MacBook Pro M2 Max,
macOS 15 on Neovim 0.12.0.
Start and open init.lua
Around 15% of the plugins are lazy-loaded.
LazyStart 12.28ms
LazyDone 61.96ms (+49.68ms)
UIEnter 122.07ms (+60.11ms)
Starting without a file
Around 45% of the plugins are lazy-loaded.
LazyStart 13.51ms
LazyDone 64.8ms (+51.29ms)
UIEnter 84.97ms (+20.17ms)
Plugins
| Name | Purpose | URL |
|---|---|---|
| SchemaStore.nvim | JSON schemas | https://github.com/b0o/SchemaStore.nvim |
| aerial.nvim | Code outline | https://github.com/stevearc/aerial.nvim |
| blink.cmp | Fuzzy code completion | https://github.com/Saghen/blink.cmp |
| ccc.nvim | Color picker/color highlight | https://github.com/uga-rosa/ccc.nvim |
| conform.nvim | Formatter configuration, replacement for null-ls |
https://github.com/stevearc/conform.nvim |
| diffview.nvim | Git diff viewer/stager | https://github.com/sindrets/diffview.nvim |
| flash.nvim | Navigation and Treesitter selection w/ search labels | https://github.com/folke/flash.nvim |
| gitsigns.nvim | Git change indicator | https://github.com/lewis6991/gitsigns.nvim |
| kanso | Theme | https://github.com/webhooked/kanso.nvim |
| lazy.nvim | Package manager | https://github.com/folke/lazy.nvim |
| lualine.nvim | Status line | https://github.com/nvim-lualine/lualine.nvim |
| mason.nvim | Install/manage LSP/DAP servers, linters and formatters | https://github.com/williamboman/mason.nvim |
| mini.nvim | Picker, icons, show trailing whitespace, textobject nav | https://github.com/echasnovski/mini.nvim |
| nvim-lint | Narrow-scope linter plugin to use via Neovim diagnostic framework | https://github.com/mfussenegger/nvim-lint |
| nvim-treesitter | Parser/syntax highlighting | https://github.com/nvim-treesitter/nvim-treesitter |
| nvim-treesitter-context | Shows current line context | https://github.com/nvim-treesitter/nvim-treesitter-context |
| nvim-treesitter-textobjects | ? | https://github.com/nvim-treesitter/nvim-treesitter-textobjects |
| oil.nvim | file explorer, (bulk file creation/rename) | https://github.com/stevearc/oil.nvim |
| rose-pine | Theme | https://github.com/rose-pine/neovim |
| snipe.nvim | Buffer navigation | https://github.com/leath-dub/snipe.nvim |
| todo-comments.nvim | Highlight NOTE:, FIXME: inline and via trouble.nvim |
https://github.com/folke/todo-comments.nvim |
| trouble.nvim | pretty diagnostics, references, quickfix and location list | https://github.com/folke/trouble.nvim |
| which-key.nvim | Shows contextual key bindings | https://github.com/folke/which-key.nvim |
Looks
This is how it looks like:
Mason essentials
This lists the LSPs/linter/formatters I consider ok for my use cases. Tools may
support more languages than I document in the "Language" column. The formatters
installed through Mason are then configured in conform.nvim.
| Type | Language | Name | Benefits | Issues |
|---|---|---|---|---|
| Formatter | YAML | yamlfmt | ||
| Formatter | many | prettier | See docs | |
| Formatter | Python | isort | Sorts imports | |
| Formatter | Python | ruff | ||
| Formatter | TOML | taplo | ||
| Formatter | Lua | stylua | ||
| LSP | Ansible | ansible-language-server | Ansible knowhow | See yaml.ansible in prefs.lua |
| LSP | Bash | bash-language-server | Incorporates ShellCheck | |
| LSP | Go | gopls | ||
| LSP | Markdown | marksman | Autocompletes links | issues/327 |
| LSP | Docker Compose | docker-compose-language-service | ||
| LSP | Docker | dockerfile-language-server | ||
| LSP | HTML | html-lsp | ||
| LSP | JSON | json-lsp | ||
| LSP | Python | ruff | ||
| LSP | Lua | stylua | ||
| LSP | CSS | tailwindcss-language-server | ||
| LSP | TOML | taplo | ||
| LSP | Terraform/OpenTofu | tflint | ||
| LSP | Terraform/OpenTofu | terraform-ls | HashiCorp | |
| LSP | YAML | yaml-language-server | ||
| Linter | Ansible | ansible-lint | yamllint vs. ansible-lint | |
| Linter | Git commits | commitlint | Conventional Commits | |
| Linter | JSON | jsonlint | ||
| Linter | Terraform/OpenTofu | tflint | ||
| Linter | Text | proselint | See source | |
| Linter | Text | write-good | See source | |
| Linter | YAML | yamllint | yamllint vs. ansible-lint | |
| Linter | many | gitleaks | ||
| Linter | Python | ruff | ||
| Linter | Bash | shellcheck |
Key bindings
See CHEATSHEET
Open issues/TODOs
- https://github.com/axkirillov/hbac.nvim
- solution to search-replace visual blocks
- https://github.com/aliqyan-21/wit.nvim
