Skip to content

A simple neovim plugin to highlight and remove trailing whitespace.

Notifications You must be signed in to change notification settings

johnfrankmorgan/whitespace.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 

Repository files navigation

whitespace.nvim

This is a simple neovim plugin to highlight and remove trailing whitespace.

Installation

-- Using packer.nvim
use {
    'johnfrankmorgan/whitespace.nvim',
    config = function ()
        require('whitespace-nvim').setup({
            -- configuration options and their defaults

            -- `highlight` configures which highlight is used to display
            -- trailing whitespace
            highlight = 'DiffDelete',

            -- `ignored_filetypes` configures which filetypes to ignore when
            -- displaying trailing whitespace
            ignored_filetypes = { 'TelescopePrompt', 'Trouble', 'help', 'dashboard' },

            -- `ignore_terminal` configures whether to ignore terminal buffers
            ignore_terminal = true,

            -- `return_cursor` configures if cursor should return to previous
            -- position after trimming whitespace
            return_cursor = true,
        })

        -- remove trailing whitespace with a keybinding
        vim.keymap.set('n', '<Leader>t', require('whitespace-nvim').trim)
    end
}

About

A simple neovim plugin to highlight and remove trailing whitespace.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages