Skip to content
Okm165Public

About

Minimal single-file Neovim 0.12 config: native LSP, completion and diagnostics, fzf-lua, gitsigns, neo-tree, diffview-plus and an OpenCode agent bridge. ASCII only, no Nerd Font needed.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

36 Commits

Folders and files

Repository files navigation

nvim - minimal single-file Neovim 0.12 config

One file: init.lua. Native LSP, completion, diagnostics, commenting. ASCII only - no Nerd Font needed. Built for an OpenCode + herdr workflow over SSH.

Plugins (12): tokyonight, nvim-lspconfig, which-key, fzf-lua, gitsigns, neo-tree (+nui, plenary), persistence, opencode.nvim, diffview-plus, nvim-diff-review-opencode-plugin. Everything else is built in.

Leader is Space: press it and pause for the grouped menu (Find, Git, Code, Buffer, OpenCode, Session). Space f c = any command, Space f k = any keymap. Opening nvim restores this directory's session, otherwise it shows the file tree (nvim <dir> opens the tree too).

Install

git clone https://github.com/Okm165/nvim ~/.config/nvim
bash ~/.config/nvim/bootstrap.sh   # deps -> nvim -> plugins -> LSP -> herdr

Needs Neovim 0.12+ (the config uses vim.pack); the script installs it if missing or older. Language servers come from scripts/install-lsp.sh (no mason).

Three files live outside the repo:

  • ~/.config/opencode/opencode.json - add "plugin": ["opencode-nvim-diff-review"].
  • ~/.config/herdr/config.toml - sound off, toasts via herdr, prefix-free Ctrl+Alt chords.
  • ~/.agents/skills/herdr - npx skills add herdrdev/herdr --skill herdr -g.

Find

  • Space f f/g/b/r/h files / grep / buffers / recent / help; Space / searches the buffer.
  • Pickers: <Tab> marks, alt-a toggles all, Ctrl-q sends the picks to the quickfix list (walk it with ]q / [q).
  • LSP: gd definition, K hover, gra actions, grn rename, grr refs, gri implementation, grt type, grx codelens, gO symbols, ]d / [d diagnostics; Ctrl-s in insert mode shows signature help.
  • Space c d explains the current line, Space c f formats the buffer.

Select and copy

OSC 52: any yank lands in your local machine's clipboard. Paste into nvim with p.

  • v chars, V lines, Ctrl-v blocks; o swaps ends, gv reselects.
  • Text objects: viw word, vip paragraph, vif function, vi( vi" vit.
  • Syntax-aware selection (built in): an grows to the parent node, in shrinks; yan yanks the node, y2an its parent. van then go sends exactly one function call to the agent. In visual mode an / in resize the selection and ]n / [n jump between nodes.
  • Whole file ggVGy; copy the path with :let @+ = expand('%:p').

Windows, buffers, editing

  • Ctrl-h/j/k/l move focus (tree <-> code); Space e toggles the tree.
  • ]b / [b next / prev buffer; Space b d closes one; Space w saves.
  • Esc clears the highlight; n / N and Ctrl-d / Ctrl-u stay centered.
  • Visual < / > indent and keep the selection; <Esc><Esc> leaves terminal mode.
  • Built-ins worth knowing: Ctrl-o / Ctrl-i jump back / forward, g; / g, walk the change list, * / # search the word under the cursor, % matches a bracket, ; / , repeat f / t, Ctrl-^ toggles the alternate buffer, "0p pastes the last yank without clobbering it, ZZ saves and quits.

Git

  • ]c / [c hunks, Space g p/s/r/b preview / stage / reset / blame. Select lines first to stage or reset a partial hunk; ih is a hunk text object, so goih sends a whole hunk to the agent.
  • Space g d diffs the working tree against the index, Space g D against the last commit, Space g x closes. The view is inline unified: one window, - old lines above + new lines, no side-by-side. <Tab> / <S-Tab> files, <leader>b toggles the file list, g? help.

Agent (OpenCode)

  • go sends the selection or motion with no prompt (fastest); goo sends the line.
  • Space o a opens a prompt pre-filled with @this:; Space o s opens the prompt menu (explain, review, test, implement, optimize, document, fix) as a fuzzy picker.
  • Placeholders: @this, @buffer, @buffers, @diagnostics, @quickfix, @visible, @marks.
  • When the agent proposes an edit, a diff opens in Neovim: ]c / [c move, dp / do accept / reject one hunk, da / dr the whole request, q closes.

Tree and sessions

  • Tree (Space e): nothing is hidden - dotfiles, gitignored and .git all show. Enter open, a add, r rename, d delete, T trash, u undo, U restore, ]g / [g next / prev git change, ? help, q close.
  • Sessions auto-save per directory and restore on launch: Space q s restore, Space q S pick, Space q l last, Space q d skip saving this one.

The flow: herdr + OpenCode + Neovim

herdr is the cockpit, Neovim the editor and diff bridge, OpenCode the conversation in a pane.

herdr. Prefix Ctrl+b, plus prefix-free Ctrl+Alt chords: h/j/k/l panes, c tab, [ / ] tabs, d split right, Shift+d split down, z zoom. Ctrl+b 1/2/3 switches tab, Ctrl+b q detaches (never :q), Ctrl+b g opens the Goto picker (/ searches, b/w/i/d filter blocked/working/idle/done), and Ctrl+b [ is copy mode (v select, y copy, q leave). After editing herdr's config: herdr server reload-config.

OpenCode pane. Its own leader is Ctrl+x, with its own which-key on Ctrl+Alt+k: Ctrl+x a agents, Tab / Shift+Tab cycle agent, Ctrl+x m models, Ctrl+x n / l sessions, Ctrl+p commands, Esc interrupts, Ctrl+j adds a newline, Ctrl+x y copies messages. With a subagent, Right / Left cycle child sessions and Up returns to the parent.

The loop. ssh box && cd ~/repo && herdr -> Ctrl+b 1 edit tab -> find with Space f f / Space f g -> select and send with go -> Ctrl+b 2 watch it work -> accept the diff (dp / do, da / dr, q) -> Space g s -> commit.

Notes

  • OSC 52 is copy-only: yanking works over SSH; pasting from your local clipboard into nvim does not. Use a herdr pane for that direction.
  • Tree delete: d always works, T (trash) needs the file on $HOME's filesystem.
  • KDE owns Ctrl+Alt+l - rebind that herdr chord or use the prefix. herdr also takes Ctrl+Alt+d and Ctrl+Alt+[ / ], shadowing OpenCode's half-page-down and which-key group nav; PageUp / PageDown still scroll.
  • :checkhealth shows only expected warnings (no icons by design, no snacks).

Cheat sheet

herdr:  Ctrl+b c/v/- hjkl np 1..9 z g w [ b ?   (detach: Ctrl+b q)
        prefix-free: Ctrl+Alt h/j/k/l panes, c tab, [ ] tabs, d split, z zoom
opencode: Ctrl+x a agent list  Tab cycle  Esc interrupt  Ctrl+p commands  Ctrl+Alt+k help
hints:  Space, pause (which-key, grouped)  Space f c commands  Space f k keymaps
files:  Space f f/g/b/r   Space / buffer   tree: Space e   windows: Ctrl-h/j/k/l
picker: Tab mark  alt-a all  Ctrl-q to quickfix  Enter open
select: an grow / in shrink to the syntax node   yan yanks it   van + go sends it
save:   Space w            buffers: ]b [b   close: Space b d
session:Space q s restore / S pick / l last / d don't-save
lsp:    gd K gra grn grr gO   diag: ]d [d  Space c d   format: Space c f   gcc
git:    ]c [c   Space g s/r/p/b   diff: Space g d/D/x   goih sends a hunk
agent:  Space o a/s   go (selection)  goo (line)   review diff: dp/do da/dr q

License

MIT - see LICENSE.

About

Minimal single-file Neovim 0.12 config: native LSP, completion and diagnostics, fzf-lua, gitsigns, neo-tree, diffview-plus and an OpenCode agent bridge. ASCII only, no Nerd Font needed.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages