coding.mini-trailspace

Trailing whitespace highlight and remove

Disable

This extra is enabled on a fresh install. Turn it off with :RafiExtras (Spacemx), or remove "coding.mini-trailspace" from extras in your rafi.json.

Keymaps

KeyDescriptionMode
leadercwErase Whitespace𝐍

Plugins

Source
lua/rafi/extras/coding/mini-trailspace.lua
-- Trailing whitespace highlight and remove
local pack = require('rafi.pack')

local loaded = false
local function load()
	if loaded then
		return
	end
	loaded = true
	vim.pack.add({ 'https://github.com/nvim-mini/mini.trailspace' })
	require('mini.trailspace').setup({})
end

pack.on_event('BufReadPost,BufNewFile', load)

vim.keymap.set('n', '<leader>cw', function()
	load()
	MiniTrailspace.trim()
end, { desc = 'Erase Whitespace' })