Skip to content

v0.6.0

Choose a tag to compare

@nmfirdausw nmfirdausw released this 20 Oct 07:34
· 15 commits to main since this release
f518201

What's Changed

Features

Diagnostics

Highlights

  • Diagnostic defaults. A new diagnostic option applies severity_sort, update_in_insert and virtual_text through vim.diagnostic.config().
  • Yours on top. Pass a table and it is merged over the defaults. Pass false to leave Neovim's diagnostic settings alone.
  • Keymaps. Five default maps to peek at, toggle and list diagnostics.
  • Native. No new dependencies.

Usage

require("batu").setup({
  diagnostic = { update_in_insert = false },   -- merge on top of the defaults
  keymaps = { n = { ["<leader>dq"] = false } }, -- skip a diagnostic keymap
})
Option Value Effect
diagnostic true (default) Apply Batu's diagnostic defaults
a table Apply the defaults with your vim.diagnostic.config() values merged on top
false Leave Neovim's diagnostic settings alone

Keymaps

Mode Key Action
n <C-w>d Open the diagnostic float of the line, hiding inline diagnostics until it closes
n <leader>dv Toggle virtual text and virtual lines
n <leader>dt Toggle diagnostics
n <leader>dl Send buffer diagnostics to the location list
n <leader>dq Send workspace diagnostics to the quickfix list

They are part of the default keymaps, so they follow the usual rules: keymaps = false sets none, and false on a single key skips it.

How it works

<C-w>d replaces Neovim's own map of the same key. It still opens the float, and also hides virtual text and lines while the float is open, then restores them when it closes. <leader>dv switches between virtual text and virtual lines, never both.

Upgrading

diagnostic and its keymaps are on by default, so setup() now sets diagnostic options and five keymaps without any change to your config. To keep your current behavior, pass diagnostic = false and skip the keymaps you don't want.

Full Changelog: v0.5.0...v0.6.0