https://github.com/wassimk/qf-formatter.nvim
Beautiful quickfix and location list formatting with diagnostic and LSP kind icons for Neovim
https://github.com/wassimk/qf-formatter.nvim
lua neovim neovim-plugin nvim quickfix
Last synced: 19 days ago
JSON representation
Beautiful quickfix and location list formatting with diagnostic and LSP kind icons for Neovim
- Host: GitHub
- URL: https://github.com/wassimk/qf-formatter.nvim
- Owner: wassimk
- License: mit
- Created: 2026-02-21T23:35:57.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2026-03-09T00:14:44.000Z (28 days ago)
- Last Synced: 2026-03-09T05:34:42.683Z (27 days ago)
- Topics: lua, neovim, neovim-plugin, nvim, quickfix
- Language: Lua
- Homepage:
- Size: 207 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# qf-formatter.nvim
Beautiful quickfix and location list formatting with diagnostic and LSP kind icons.

## π Requirements
- **Neovim 0.10+**
- **[Nerd Font](https://www.nerdfonts.com/)** for icon rendering
## π οΈ Installation
Install via your preferred plugin manager. The following example uses [lazy.nvim](https://github.com/folke/lazy.nvim).
```lua
{
'wassimk/qf-formatter.nvim',
event = 'VeryLazy',
opts = {}
}
```
## π» Features
- Formatted quickfix and location list entries: `filename βline:colβ [icon] text`
- Truncates long filenames with ellipsis
- Replaces `$HOME` with `~` in file paths
- Diagnostic icons for error, warning, info, and hint entries
- LSP kind icons (codicons) for document symbol entries
- Syntax highlighting for filenames, separators, line numbers, diagnostics, and LSP kinds
## π§ Configuration
The `setup()` function accepts an options table. All values are optional.
```lua
require('qf-formatter').setup({
filename_width = 32, -- max filename column width (default: 32)
})
```
### Highlight Groups
All highlights are defined with `default = true`, so your colorscheme always takes priority. Every group is prefixed with `QfFormatter` so you can customize the quickfix appearance without affecting the rest of Neovim.
**Quickfix structure:**
| Group | Default Link | Description |
|-------|-------------|-------------|
| `QfFormatterFilename` | `Directory` | Filename column |
| `QfFormatterSeparator` | `Delimiter` | `β` separators |
| `QfFormatterLineNr` | `LineNr` | Line and column numbers |
**Diagnostic icons:**
| Group | Default Link |
|-------|-------------|
| `QfFormatterError` | `DiagnosticSignError` |
| `QfFormatterWarn` | `DiagnosticSignWarn` |
| `QfFormatterInfo` | `DiagnosticSignInfo` |
| `QfFormatterHint` | `DiagnosticSignHint` |
**LSP kind icons:**
| Group | Default Link |
|-------|-------------|
| `QfFormatterKindClass` | `Type` |
| `QfFormatterKindColor` | `Special` |
| `QfFormatterKindConstant` | `Constant` |
| `QfFormatterKindConstructor` | `Function` |
| `QfFormatterKindEnum` | `Type` |
| `QfFormatterKindEnumMember` | `Constant` |
| `QfFormatterKindEvent` | `Special` |
| `QfFormatterKindField` | `Identifier` |
| `QfFormatterKindFile` | `Directory` |
| `QfFormatterKindFolder` | `Directory` |
| `QfFormatterKindFunction` | `Function` |
| `QfFormatterKindInterface` | `Type` |
| `QfFormatterKindKeyword` | `Keyword` |
| `QfFormatterKindMethod` | `Function` |
| `QfFormatterKindModule` | `Include` |
| `QfFormatterKindOperator` | `Operator` |
| `QfFormatterKindProperty` | `Identifier` |
| `QfFormatterKindReference` | `Identifier` |
| `QfFormatterKindSnippet` | `Special` |
| `QfFormatterKindStruct` | `Type` |
| `QfFormatterKindText` | `String` |
| `QfFormatterKindTypeParameter` | `Type` |
| `QfFormatterKindUnit` | `Number` |
| `QfFormatterKindValue` | `Number` |
| `QfFormatterKindVariable` | `Identifier` |
To customize any group, override it in your config:
```lua
vim.api.nvim_set_hl(0, 'QfFormatterFilename', { fg = '#82aaff' })
vim.api.nvim_set_hl(0, 'QfFormatterKindMethod', { link = 'BlinkCmpKindMethod' })
```
## π§ Development
Run tests and lint:
```shell
make test
make lint
```
Enable the local git hooks (one-time setup):
```shell
git config core.hooksPath .githooks
```
This activates a pre-commit hook that auto-generates `doc/qf-formatter.nvim.txt` from `README.md` whenever the README is staged. Requires [pandoc](https://pandoc.org/installing.html).