Back to browse
GitHub Repository

Automatically fold logging and debug-print statements in Neovim to declutter your code. Works with nvim-origami.

4 starsLua

Fold-logging.nvim – fold logging and debug-print statements in Neovim

by markosn·Jun 21, 2026·2 points·0 comments

AI Analysis

●●SolidNiche GemCozy

Composes logging folds on top of existing Treesitter folds instead of replacing them.

Strengths
  • Fold composition preserves your existing expr-based folding setup rather than overriding it.
  • Quickfix list command shows all detected logging calls for easy navigation.
  • Built-in Python rules cover print, pprint, and standard logging levels out of the box.
Weaknesses
  • Only Python supported by default; other languages require manual Lua pattern configuration.
  • Narrow utility for a specific workflow that many developers don't encounter daily.
Target Audience

Neovim users who write Python or other languages with debug logging

Similar To

nvim-origami · vim-foldexpr plugins

Post Description

I made this because I often keep debug logs and print statements around while working, but I don’t want them to dominate the file when I’m reading or reviewing code.

fold-logging.nvim adds folds for logging/debug-print statements while leaving normal code folds alone. Python is built in for now, and other languages can be added with Treesitter call node types and Lua patterns.

It currently supports commands to fold, unfold, toggle, refresh, and list detections in quickfix.

I’d be interested in feedback on whether the detection rules are lacking, and which languages would be worth supporting by default.

Similar Projects