My Neovim config, one file under 1000 lines.
Assumes macOS and Neovim 0.11+.
Install dependencies:
brew install neovim ripgrep fzf bat git-delta gnu-sed fd rg lazygit zoxideOptionally backup existing neovim state:
mv ~/.config/nvim ~/.config/nvim-backup
mv ~/.local/share/nvim ~/.local/share/nvim-backup
mv ~/.cache/nvim ~/.cache/nvim-backup
Or just remove it:
rm -rf ~/.config/nvim ~/.local/share/nvim ~/.cache/nvim
Then:
mkdir ~/.config && cd ~/.config
git clone https://github.com/nickcernis/neovim-config nvimOptionally set the theme for bat to match Neovim, so that preview colours match:
mkdir -p "$(bat --config-dir)/themes"
cd "$(bat --config-dir)/themes"
curl -O https://raw.githubusercontent.com/folke/tokyonight.nvim/main/extras/sublime/tokyonight_night.tmTheme
bat cache --build # also re-run this if you see caching issues after bat upgrades
bat --list-themes | grep tokyo # should output "tokyonight_night"
echo '--theme="tokyonight_night"' > "$(bat --config-dir)/config"Note: The upstream theme has a very dark lineHighlight color (#00000030) that makes
the highlighted line nearly invisible in fzf-lua previews. To fix this, edit
~/.config/bat/themes/tokyonight_night.tmTheme and change line 38 from:
<key>lineHighlight</key>
<string>#00000030</string>to:
<key>lineHighlight</key>
<string>#283457</string>Then rebuild the cache with bat cache --build.
<space> f pto find files in current project.<space> f fto find lines in current file (similar to swiper in Emacs).<space> f gto search text in current project (backed by ripgrep).<space><tab>for last buffer. (Repeat to alternate between two files.)<space> f bor<space> f tfor buffer/'tab' list, then Ctrl-x to close buffer.<space> f yfor LSP symbols list.<space> g sfor git status, left to stage, right to unstage.<space> f cfor recent changes.<space> f jfor recent jumps.<space> f rfor recent file browser.<space> f <space>for last fuzzy search with entered text retained.<space> jto jump by typed word.sfor flash jump by character (letter targets after first typed character).Sfor flash jump based on treesitter.dsordSto delete until typed character.<space> rto find-replace across project (uses Grug Find and Replace).<space> f ufor undo tree, enter to revert to selected change.<space> f zfor project switcher (requires zoxide, expects Ghostty to open in new window).
<space> eto toggle the file tree ('explore'). (Thenato create,rto rename,dto delete,?for help,<space> eto close.)Ctrl-kto go back in jump list (also reopens closed buffers).Ctrl-jto go forward, :FzfLua jumps for a visual view.
Ctrl-wto close the buffer.Ctrl-qto save all and quit.
I use these in normal mode in place of the default Ctrl-w window commands, since I map Ctrl-w to close buffer:
<space> w vto split vertically.<space> w sto split horizontally.<space> w hto move cursor left.<space> w lto move cursor right.<space> w rto rotate buffers between window.<space> w d|xto close the window.<space> b d|xto close the buffer.
<space> g cfor commit list.<space> g bfor branches, type new branch name and control-a to create from current.<space> g sfor status (uncommitted files).<space> g hfor hunks (good to navigate to recently changed location).<space> g oto open current line or range in GitHub in your browser.<space> g pfor a list of GitHub PRs (uses GitHub CLI).<space> h pto preview a git hunk.<space> h rto reset a git hunk.<space> h Rto reset the current buffer.<space> h sto stage the hunk.<space> h Sto stage the buffer.
Kto show LSP hints.glto show LSP issues.gdto go to definition and Ctrl-o to return.grto show references and :q to exit.F2to rename current cursor position.F4for code actions on the current cursor position.Ctrl-;to format the current buffer or selection. (Formatters configured in 'conform' block in init.lua.)
:Lazyto update/install plugins.:FzfLuafor all FzfLua pickers.:Masonto manage LSP servers.:LspInfois sometimes useful, as is:LspInstall.
Managed with Lazy, which gives us a lockfile, automatic caching and bytecode compilation, and a UI with load times.
:Lazy summons the plugin UI.
Things to explore:
- Maybe try https://github.com/coder/claudecode.nvim
- Format pasted code when it's pasted. https://github.com/ConradIrwin/vim-bracketed-paste
- https://github.com/wfxr/forgit with https://github.com/ray-x/forgit.nvim.
- Disable or adjust swap file handling? https://neovim.io/doc/user/recover.html
I use panes or tabs instead of Neovim's terminal emulation. Long-running
terminal processes in Neovim itself reduce editor performance for me. (If I open
a toggleterm, then run yes and
toggle the terminal closed, Neovim movements and edits lag for me.)
I use git and GitHub CLI in the terminal, as well as lazygit in a separate long-running terminal tab.
- Plugin ideas: https://neovimcraft.com/
- More plugin ideas: https://github.com/rockerBOO/awesome-neovim
- The semi-official starter config: https://github.com/nvim-lua/kickstart.nvim/blob/master/init.lua
- Opinionated starter distribution using custom plugins: https://nvchad.com/Features
- Less opinionated starter distributions using off-the-shelf plugins: https://astronvim.github.io/ and https://www.lunarvim.org/