Skip to content

jakelogemann/nvim

Repository files navigation

✨ Jake’s Neovim — fast, friendly, batteries‑included

Neovim 0.9+ macOS lazy.nvim Blink.cmp Treesitter DAP Ollama License: MIT

A lean Neovim setup that stays out of your way while giving you a modern IDE feel. It’s built on lazy.nvim and tuned for Go, Rust, Lua, YAML, Markdown, and general scripting. Thoughtful defaults, a clean UI, and a few bespoke modules (AI prompts, lightweight git signs, code screenshots, etc.) help you get into flow quickly.

Target: Neovim 0.9+ (great on 0.10). Primary platform: macOS (portable elsewhere).


Why use this config?

  • Fast startup with on‑demand plugin loading.
  • Discoverable keymaps and a friendly UI.
  • Strong language tooling without bloat (LSP, completion, debug, sessions).
  • Local AI workflows (review, enhance, summarize) that work on selections.
  • Sensible custom helpers: Go commands, quick terminal runner, code snapshotting.

What’s inside (high level)

Custom modules included: welcome screen · comment toggler · freeze (code → image) · git signs · Go commands · terminal runner · virtcolumn.


Quick start

mkdir -p ~/.config/nvim
cd ~/.config/nvim
git clone https://github.com/jakelogemann/nvim .
nvim

First launch bootstraps lazy.nvim and installs plugins.

Recommended system packages: git, ripgrep, curl; language toolchains as needed (go, rustup, node, python3). Optional: ollama for AI and freeze for screenshots.


Everyday usage (a tiny tour)

  • Explore files: press - (or <leader>e) to open Oil in the current directory. Open your config dir with <leader>,.
  • Search files/grep/buffers: ⟨leader⟩ff, ⟨leader⟩/, ⟨leader⟩, via Snacks.
  • Git workflows: :Neogit for a full UI; open/close diff view with ⟨leader⟩gd / ⟨leader⟩gq.
  • LSP: rename ⟨leader⟩lr, code actions ⟨leader⟩la, hover K, diagnostics float ⟨leader⟩ld.
  • Debug: ⟨leader⟩d… for common actions (continue, step, toggle UI). Quick toggles also on F1–F5.
  • Comments: toggle with ⟨leader⟩c (line or visual selection).
  • Run current file: ⟨leader⟩xx (dispatches for Go/Rust/Python/Shell).
  • AI prompts: :Ollama or ⟨leader⟩o{p|e|c|r|s} to prompt/enhance/change/review/summarize.
  • Plugin management: ⟨leader⟩Vl Lazy UI, ⟨leader⟩Vs sync, ⟨leader⟩Vu update, ⟨leader⟩Vp profile, ⟨leader⟩Vm Mason UI, ⟨leader⟩Vi edit init.lua, ⟨leader⟩VM open mason.log.
  • Terminals: ⟨leader⟩Tt toggle a floating terminal (ToggleTerm), ⟨leader⟩Tn open a new terminal (Snacks).
  • Project config & sessions: ⟨leader⟩pc Neoconf UI. Sessions: ⟨leader⟩Sl load, ⟨leader⟩SL load last, ⟨leader⟩Ss select, ⟨leader⟩Sd stop saving.

Tip: press ⟨leader⟩ to discover groups via which‑key.


Language tooling

LSP servers are installed and configured through mason.nvim and mason‑lspconfig with nvim‑lspconfig. YAML schemas are pre‑mapped via SchemaStore. Inlay hints are enabled when the server supports them. :Format is available per buffer.

Completion is powered by blink.cmp with snippet support from friendly‑snippets. Lua development gains typed completions via lazydev. Copilot can be toggled with :Copilot enable|disable if desired.

Debugging is ready out of the box with nvim‑dap, UI via dap‑ui, Go helpers via dap‑go, and inline values from nvim‑dap‑virtual‑text (with simple secret‑redaction).


Local AI (Ollama)

Use :Ollama to pick a prompt or the ⟨leader⟩o… shortcuts. Works on a visual selection or whole file. Streaming output appears in a floating window with accept (Ctrl‑Enter), retry (Ctrl‑R), and quit (q). For best results, run the Ollama daemon (ollama serve). The integration will try to start it if not running.


Code screenshots (Freeze)

Install the freeze CLI to render pretty images of code:

  • :Freeze — snapshot the whole buffer or a visual range (:'<,'>Freeze).
  • :FreezeLine — snapshot the current line.

File names are templated (timestamp, filename, start/end lines) and can auto‑open on macOS.


Sessions (persistence.nvim)

Sessions are lightweight and branch‑aware by default. The session options are tuned for reliability (saving window sizes/positions, folds, terminals, and the current working directory).

  • Load session: ⟨leader⟩Sl
  • Load last session: ⟨leader⟩SL
  • Select session: ⟨leader⟩Ss
  • Stop saving in this workspace: ⟨leader⟩Sd

Notes

  • Sessions are saved only when at least one file buffer is open (need = 1).
  • Storage location: :echo stdpath('state') .. '/sessions'.
  • Session saving is paused when you run :PersistenceStop.

Minimal git signs

A tiny built‑in module draws + additions, ~ changes, and - deletions with smart placement. It’s fast, debounced, and safe on large files. Toggle with :GitSignsToggle or ⟨leader⟩zg.


Options & layout

Notable choices (see plugin/options.lua): modern command line (cmdheight=0), global statusline, conceal by default (toggle ⟨leader⟩zc), persistent undo, and sane splits. Nerd Font icons are expected.

Project structure at a glance:

init.lua                — bootstrap lazy + core modules
lua/custom/plugins/     — plugin specs (UI, LSP, cmp, tools, etc.)
plugin/*.lua            — runtime config and custom features (auto‑sourced)
lua/custom/*.lua        — bespoke modules (comment, utils)
lua/freeze.lua          — freeze CLI wrapper
spell/                  — spelling & thesaurus

Troubleshooting

  • Missing syntax or LSP? Open :Mason and ensure tools are installed.
  • No AI responses? Verify ollama serve and a model are available.
  • Git signs missing? Make sure you’re inside a git repo and the file is tracked.
  • Startup slower than expected? Temporarily enable profiling (if the optional profiler is present).
  • Sessions not saving? Ensure at least one file buffer is open. You can temporarily disable saving with ⟨leader⟩Sd.

Screenshots

Welcome screen Welcome Screen.

Completion menu (blink.cmp) Completion via blink.

Inline documentation / hover Inline documentation.


License

Custom Lua in this repo is MIT unless noted. Each third‑party plugin remains under its own license.


Happy hacking! 🛠️

About

my NeoVim config

Topics

Resources

Stars

Watchers

Forks