My Neovim configuration
  • Lua 87.6%
  • TeX 11.9%
  • Shell 0.5%
Find a file
Oliver Ladner 480a5c2fff usability improvements
- add autocmds to highlight yanking and disabling line numbers in Oil
- lsp-zero: fix 'gd' command by setting 'preserve_mappings' to false
- lualine: show clock, simplify statusline, shorten mode name
- oil: decrease float window size, add 'q' hotkey to close window
- prefs: show line numbers again, disable additional mode showing
- add todo-comments.nvim
- remap: add keymap to find all TODOs/FIXME/XXX etc.
2024-03-05 21:32:07 +01:00
lua/weeheavy usability improvements 2024-03-05 21:32:07 +01:00
CHEATSHEET.md usability improvements 2024-03-05 21:32:07 +01:00
CHEATSHEET.pdf usability improvements 2024-03-05 21:32:07 +01:00
init.lua housekeeping 2024-03-05 21:26:01 +01:00
lazy-lock.json housekeeping 2024-03-05 21:26:01 +01:00
logo.png add Pandoc to create PDF cheat sheet 2024-03-05 09:32:10 +01:00
mkcheatsheet.sh add Pandoc to create PDF cheat sheet 2024-03-05 09:32:10 +01:00
README.md fix link to cheat sheet 2024-02-04 10:46:06 +01:00
sample.png updated screenshot 2023-11-28 13:15:03 +01:00
tmpl.tex add Pandoc to create PDF cheat sheet 2024-03-05 09:32:10 +01:00
vars.yml add Pandoc to create PDF cheat sheet 2024-03-05 09:32:10 +01:00

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 things I really need.

Installation

  1. Install Neovim 0.9.x
  2. Install macOS/Windows dependencies documented in init.lua
  3. Clone this Git repository to
    1. ~/.config/nvim when on macOS/Linux
    2. c:\Users\foobar\AppData\Local\nvim when on Windows

Finishing touches

  • Create a $HOME/.ignore file and add big, useless directories to it, so Telescope/ripgrep/fd can ignore those. My current list of files/directories is available in lua/weeheavy/plugins/telescope-fzf-native.lua
  • Install Mason LSP/linter/formatters in the table down

Speed

Output from lazy.nvim profiling (:Lazy profile) on a MacBook Pro M2 Max, macOS 14.0 (23A344).

Start and open init.lua

Around 25% of the plugins are lazy-loaded.

Startuptime: 100.58ms

Based on the actual CPU time of the Neovim process till UIEnter.
This is more accurate than `nvim --startuptime`.
  LazyStart 11.04ms
  LazyDone  25.69ms (+14.65ms)
  UIEnter   100.58ms (+74.89ms)

Starting with an empty file

Around 75% of the plugins are lazy-loaded.

Startuptime: 32.31ms

Based on the actual CPU time of the Neovim process till UIEnter.
This is more accurate than `nvim --startuptime`.
  LazyStart 10.71ms
  LazyDone  25.36ms (+14.65ms)
  UIEnter   32.31ms (+6.95ms)

Plugins

Name Purpose URL
lazy.nvim Package manager https://github.com/folke/lazy.nvim
telescope.nvim Find, Filter, Preview, Pick https://github.com/nvim-telescope/telescope.nvim
telescope-fzf-native.nvim Fuzzy finder for Telescope https://github.com/nvim-telescope/telescope-fzf-native.nvim
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
nightfox.nvim Theme with treesitter/lsp support https://github.com/EdenEast/nightfox.nvim
tokyonight.nvim Theme with treesitter/lsp support https://github.com/folke/tokyonight.nvim
lualine.nvim Status line https://github.com/nvim-lualine/lualine.nvim
nvim-web-devicons filetype glyphs (icons) for plugins https://github.com/nvim-tree/nvim-web-devicons
gitsigns.nvim Git change indicator https://github.com/lewis6991/gitsigns.nvim
which-key.nvim Shows contextual key bindings https://github.com/folke/which-key.nvim
indent-blankline.nvim Visual indentation guide https://github.com/lukas-reineke/indent-blankline.nvim
vim-illuminate Highlight similar words (w/ LSP, Treesitter, regex) https://github.com/RRethy/vim-illuminate
lsp-zero.nvim LSP for mere mortals https://github.com/VonHeikemen/lsp-zero.nvim
nvim-lspconfig Component of lsp-zero.nvim https://github.com/neovim/nvim-lspconfig
cmp-nvim-lsp Dependency of lsp-zero.nvim https://github.com/hrsh7th/cmp-nvim-lsp
conform.nvim Formatter configuration, replacement for null-ls https://github.com/stevearc/conform.nvim
mason.nvim Install/manage LSP/DAP servers, linters and formatters https://github.com/williamboman/mason.nvim
mason-lspconfig.nvim Bridges mason.nvim with the lspconfig plugin https://github.com/williamboman/mason-lspconfig.nvim
zen-mode.nvim Distraction-free coding for Neovim https://github.com/folke/zen-mode.nvim
twilight.nvim Dims inactive portions of the code you're editing https://github.com/folke/twilight.nvim

Looks

This is how it looks like:

My Neovim setup

Mason essentials

This lists the LSPs/linter/formatters I consider ok for my use cases. Tools may support many more languages than I document in the "Language" column. The formatters installed here are used via conform.nvim.

Type Language Name Benefits Issues
LSP Markdown marksman Autocompletes links n/a
Linter Ansible ansible-lint yamllint vs. ansible-lint
Linter YAML yamllint well, it's yamllint yamllint vs. ansible-lint
Formatter Markdown, YAML prettier Formats Markdown tables n/a
Formatter Lua stylua Formats Lua n/a

Key bindings

See CHEATSHEET

Open issues/TODOs