Skip to content

kitkatdafu/nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌸 cute.nvim β€” a Python / AI-ML Neovim config

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>cH toggles 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 .venv automatically

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).


Requirements

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 sixel backend). In Terminal.app / iTerm2 images won't render, but text output still works.

Install

# 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 / providers

uv workflow

The 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 :LspRestart so pyrefly/ruff re-resolve it. To pin the interpreter explicitly, add to pyproject.toml:

[tool.pyrefly]
python-interpreter-path = ".venv/bin/python"

Jupyter / molten setup

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.

Markdown

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 fallback

Image 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)? Set latex = { enabled = true } in lua/plugins/markdown.lua and image = { math = { enabled = false } } in lua/plugins/snacks.lua; text converters are tried in order β€” utftex (nice 2D) then latex2text. Either path needs the latex treesitter parser (built by the tree-sitter CLI). With no renderer at all, math shows as raw $…$ source.

Keymaps

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

Layout

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

Customizing

  • Theme: edit the palette in lua/cute/init.lua. Prefer a maintained theme? Swap the colorscheme call in init.lua for catppuccin (latte) or rose-pine (dawn).
  • Per-machine tweaks: create lua/config/local.lua (git-ignored) and require("config.local") from init.lua.
  • More LSP servers: add vim.lsp.config(name, {...}) + vim.lsp.enable(name) in lua/plugins/lsp.lua.

License

MIT.

About

🌸 A cute, uv-native Neovim config for Python & AI/ML β€” pyrefly + ruff, blink.cmp + GitHub Copilot, Jupyter notebooks, DAP + neotest, and a pink theme with a Nyan-cat statusline 🐱

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages