Tip
This is a neovim 0.12 setup, the previous <0.12 version is at the https://github.com/onjin/nvim/tree/0.11.
To switch previous main into the newest run:
$ git reset --hard origin/main
Small personal Neovim setup built around native vim.pack, LSP, fast search, and simple file navigation.
- Neovim with
vim.pack gitrg- formatters you want to use:
stylua,prettier,black,air - optional LSP tools:
lua-language-server,bash-language-server,uvx ty,uvx ruff
You can use the generated single-file config without cloning the whole repo.
Save it as your main config:
curl -fsSL https://raw.githubusercontent.com/onjin/nvim/main/init_compact.lua -o ~/.config/nvim/init.luaOr run Neovim directly with it from any path:
curl -fsSL https://raw.githubusercontent.com/onjin/nvim/main/init_compact.lua -o /tmp/init_compact.lua
nvim -u /tmp/init_compact.luaRun this config without cloning the repo or writing it into ~/.config/nvim:
nix run github:onjin/nvimBy default this launcher uses its own isolated base directory at ~/.local/share/onjin-nvim.
That means it writes to:
~/.local/share/onjin-nvim/config~/.local/share/onjin-nvim/data~/.local/share/onjin-nvim/state~/.local/share/onjin-nvim/cache~/.local/share/onjin-nvim/tree-sitter-parsers
This also keeps the tree-sitter CLI config under the same isolated root, so it does not depend on ~/.config/tree-sitter/config.json.
To use a different base directory, override it explicitly:
ONJIN_NVIM_HOME=/tmp/onjin-nvim nix run github:onjin/nvimClone this repo to:
~/.config/nvimThen start Neovim. Plugins are declared in init.lua and lua/plugins/*.lua.
To generate a self-contained single-file version of this config, run:
./compact.shThis creates init_compact.lua, which bundles local modules from lua/ and runtime files such as plugin/ and ftplugin/.
,is the leader key-opens the file explorer (oil.nvim)<leader>s- prefix for file search, i.e.:<leader>sfsearch files<leader>sglive grep in git-tracked files<leader>sGlive grep withrg
<leader>f- prefix for finders, i.e.:<leader>fk- find keymaps
<leader>t- prefix for toggles, i.e.:<leader>ta- togglevim.opt.autocomplete; defaultoffjust use<ctrl-x><ctrl-o>and friends<leader>tb- toggle light/dark theme
<leader>g- prefix Git/GH CLI pickers, i.e.:<leader>gi- gh issue list<leader>gp- gh pr list<leader>gs- git status
glfformat the current buffergrdjump to definition<leader>?shows buffer-local keymaps- in insert mode:
<C-x><C-u>opens generated values completion (uuid1-7,ulid, date/time)<C-g>kopens generated values menu (vim.ui.select)<C-x>1..7insertsuuid1..uuid7<C-x>uinsertsulid<C-x>dinserts date (YYYY-MM-DD)<C-x>tinserts datetime (YYYY-MM-DD HH:MM:SS)<C-x>iinserts ISO datetime (YYYY-MM-DDTHH:MM:SS+TZ:TZ)
TSInsall [python]- to install required tree sitter queries for certain languages
snacks.nvimfor pickers and togglesquicker.nvimfor editablequickfixwindow as bufferoil.nvimfor directory editing as buffer- native LSP with Lua, Bash, Java, and Python support
conform.nvimfor formatting- Treesitter, Catppuccin, mini status/tab line, and todo highlighting
Run the compact config with isolated XDG_* directories:
./test-compact.shRun the local flake the same way:
./test-flake.shBoth scripts avoid loading ~/.config/nvim. On the first run they may still need network access, because vim.pack installs plugins into isolated XDG_DATA_HOME.