A hand-rolled, uv-native Neovim setup for Python and AI/ML work, wrapped in a cute pink light theme with a Nyan-cat statusline. Neovim 0.12+, lazy.nvim.
- π§ LSP β pyrefly (Meta's type checker) for types & hover + ruff for lint / code actions / import sorting
- π Hover-on-idle β rest on a symbol for 3s (or
<leader>ch) to pop its definition in a corner window that never covers your code;<leader>cHtoggles it - π¨ Format β ruff via conform.nvim, format-on-save
- β‘ Completion β blink.cmp with GitHub Copilot in the menu
- π€ AI β copilot.lua + CopilotChat (browser login, no API key)
- π Jupyter / data science β molten + jupytext + image.nvim (inline plots)
- π Debug / test β nvim-dap + dap-python + neotest (pytest), all on the uv venv
- π Markdown β render-markdown live rendering (tables, callouts, LaTeX math), vim-table-mode auto-tables, marksman LSP
- πͺ Windows Β· tabs Β· terminal β quick splits (
<leader>w), tabs (<leader><Tab>), and a toggleable bottom-split terminal on~ - π³ Treesitter, Telescope, oil, gitsigns, which-key, trouble, todo-comments, mini.*
- π¦ uv everywhere β every Python tool targets the project's
.venvautomatically
Theme: a faithful port of webfreak's "Cute Pink Light" VS Code theme. Nyan cat: the position indicator is based on nyan-modoki.vim (a port of nyan-mode.el).
| Tool | Why | Install (macOS) |
|---|---|---|
| Neovim β₯ 0.12 | nvim-treesitter main branch |
brew upgrade neovim |
| tree-sitter CLI β₯ 0.26.1 | builds TS parsers (main branch) |
brew install tree-sitter-cli (plain tree-sitter formula is library-only) β or prebuilt binary β ~/.local/bin |
| uv | Python env + running | curl -LsSf https://astral.sh/uv/install.sh | sh |
| ripgrep, fd | Telescope | brew install ripgrep fd |
| Node β₯ 22 | Copilot | brew install node |
| A Nerd Font | icons | brew install --cask font-jetbrains-mono-nerd-font |
| ImageMagick | inline images + math | brew install imagemagick |
| Graphics terminal | inline plots + math images | brew install --cask ghostty (or kitty) |
LaTeX (pdflatex) |
typeset math images | MacTeX / BasicTeX, or brew install --cask mactex-no-gui |
| marksman (optional) | Markdown LSP (links/headings) | brew install marksman |
| utftex / pylatexenc (optional) | text-math fallback (non-graphics terminals) | brew install utftex (2D) or uv tool install pylatexenc (latex2text) |
Inline images (notebook plots) need a terminal speaking the kitty graphics protocol β Ghostty or kitty (WezTerm needs the
sixelbackend). In Terminal.app / iTerm2 images won't render, but text output still works.
# This repo IS your nvim config β clone it to ~/.config/nvim
git clone <your-repo-url> ~/.config/nvim
# Python language tools (uv puts them on PATH)
uv tool install pyrefly
uv tool install ruff
# Optional: richer Markdown (LSP completion + math rendering)
brew install marksman # link / heading / reference completion
uv tool install pylatexenc # `latex2text` β renders LaTeX math (or utftex)
# First launch installs all plugins, then:
nvim
# :Lazy sync β install/update plugins
# :Copilot auth β sign in to GitHub Copilot (browser)
# :checkhealth β verify rg / fd / node / providersThe config resolves one interpreter for every Python tool β the active
$VIRTUAL_ENV, else the project's .venv (uv's default), found by walking up
for .venv / pyproject.toml / uv.lock / .git. No source .venv/bin/activate
needed; just launch nvim from inside the project.
uv init my-project && cd my-project
uv add numpy pandas # runtime deps
uv add --dev debugpy pytest ipython ipykernel # dev tooling used by this config
nvim main.py| Key | Action |
|---|---|
<leader>rr |
Run current file via uv run (bottom terminal) |
<leader>ri |
Open uv run ipython REPL |
<leader>rs |
uv sync |
<leader>ra |
uv add <pkg> (prompts) |
After creating/changing the venv (
uv sync), run:LspRestartso pyrefly/ruff re-resolve it. To pin the interpreter explicitly, add topyproject.toml:[tool.pyrefly] python-interpreter-path = ".venv/bin/python"
molten is a Python remote plugin; its host needs pynvim + jupyter_client.
Use a dedicated venv (kept separate from your projects). Until you do this,
:UpdateRemotePlugins will warn β that's expected.
# 1. Dedicated Neovim Python host (init.lua auto-detects this path)
python3 -m venv ~/.virtualenvs/neovim
~/.virtualenvs/neovim/bin/python -m pip install \
pynvim jupyter_client cairosvg pnglatex plotly kaleido nbformat ipykernel pillow
# 2. Per-project kernel (run inside your uv project)
uv add --dev ipykernel
uv run python -m ipykernel install --user --name my-project --display-name "Python (my-project)"Then in Neovim: :UpdateRemotePlugins (once), restart, open a .py/.ipynb,
<localleader>mi to pick the kernel, and evaluate cells with <localleader>e /
<localleader>rl. .ipynb files open as # %%-delimited Python (full LSP) via
jupytext, and saved cell outputs round-trip.
Open any .md and it renders in-buffer β headings, lists, code blocks, tables,
callouts, and LaTeX math ($β¦$ / $$β¦$$). Prose soft-wraps with spell-check on.
Math renders as real typeset images via snacks.image:
each formula is compiled with pdflatex and shown inline through the kitty graphics
protocol β so it needs a graphics terminal (Ghostty/kitty) + ImageMagick + a LaTeX
compiler. render-markdown handles everything else (headings, tables, callouts β¦).
| Key | Action |
|---|---|
<leader>mr |
Toggle live rendering (render-markdown) |
<leader>mt |
Toggle table mode β then typing a pipe auto-builds & aligns tables |
<leader>mT |
Tableize a visual selection (CSV/TSV β table) |
Optional installs unlock the extras (everything else works without them):
brew install marksman # LSP: link / heading / reference completion
brew install utftex # text-math fallback: 2D fraction bars, matrices, β«/β/β
uv tool install pylatexenc # `latex2text` β flat text-math fallbackImage math (the default) needs a kitty-graphics terminal,
magick, and a LaTeX compiler (pdflatex/tectonic) β all driven by snacks.image, which conceals the source and shows the rendered formula inline. Prefer text math instead (any terminal, no images)? Setlatex = { enabled = true }inlua/plugins/markdown.luaandimage = { math = { enabled = false } }inlua/plugins/snacks.lua; text converters are tried in order βutftex(nice 2D) thenlatex2text. Either path needs thelatextreesitter parser (built by thetree-sitterCLI). With no renderer at all, math shows as raw$β¦$source.
Leader = Space, localleader = \. <leader>? shows buffer-local maps; which-key
hints every prefix.
| Prefix | Group | Highlights |
|---|---|---|
<leader>f |
find | ff files Β· fg grep Β· fb buffers Β· fr recent Β· / in-buffer |
<leader>c |
code / lsp | cr rename Β· ca action Β· co organize Β· cf format Β· cd diag Β· ch/cH hover popup |
<leader>r |
run / uv | rr run Β· ri ipython Β· rs sync Β· ra add |
<leader>t |
test | tt nearest Β· tf file Β· td debug Β· ts summary Β· to output |
<leader>d |
debug | db breakpoint Β· dc continue Β· du UI Β· dn test method |
<leader>a |
AI (copilot) | aa chat Β· am models Β· ap prompts Β· aq quick Β· (visual) ae/af/at/ar |
<leader>h |
git hunk | hs stage Β· hr reset Β· hp preview Β· hb blame Β· ]c/[c nav |
<leader>x |
diagnostics | xx Trouble Β· xX buffer Β· ]d/[d jump |
<leader>w |
window | wv split-v Β· ws split-h Β· wc close Β· wo only |
<leader><Tab> |
tabs | n new Β· c close Β· ]/[ next/prev Β· o only |
<leader>m |
markdown | mr render Β· mt table-mode Β· mT tableize |
~ |
terminal | toggle a bottom-split shell β persists, respawns after exit |
<localleader> |
Jupyter | mi init Β· e eval-op Β· rl line Β· rr re-eval Β· os output Β· ]x/[x cells |
gd K grn gra |
LSP | definition Β· hover Β· rename Β· code action (0.11 defaults) |
- |
oil | edit the filesystem as a buffer |
init.lua leaders, host, load config/, bootstrap lazy, apply theme
lua/config/ options Β· keymaps Β· autocmds Β· python (uv resolver + run/repl)
lua/cute/ colorscheme (init) Β· lualine theme Β· nyan component
lua/plugins/ one file per concern (lsp, completion, copilot, dap, β¦)
colors/cute.lua :colorscheme cute entrypoint
- Theme: edit the palette in
lua/cute/init.lua. Prefer a maintained theme? Swap thecolorschemecall ininit.luafor catppuccin (latte) or rose-pine (dawn). - Per-machine tweaks: create
lua/config/local.lua(git-ignored) andrequire("config.local")frominit.lua. - More LSP servers: add
vim.lsp.config(name, {...})+vim.lsp.enable(name)inlua/plugins/lsp.lua.
MIT.