Skip to content

A Neovim plugin for removing trailing white spaces and tabs

License

Notifications You must be signed in to change notification settings

getty104/air-duster.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

air-duster.nvim

A Neovim plugin for removing trailing white spaces and tabs

Installation

With lazy.nvim

  {
    "getty104/air-duster.nvim",
    config = function()
      require("air-duster").setup()
    end,
  },

With packer.nvim

use({
  "getty104/air-duster.nvim",
  config = function()
    require("air-duster").setup()
  end,
})

Usage

When you call the setup() function, the following commands are activated.

  • RemoveDust
    • Remove trailing white spaces and tabs
  • RemoveWhiteSpaces
    • Remove trailing white spaces
  • RemoveTabs
    • Remove trailing tabs

Autocmd Examble

If you want to remove trailing white spaces and tabs, you can implement it with nvim_create_autocmd

local function RemoveDust()
  if vim.bo.filetype ~= "markdown" then
    vim.api.nvim_exec("RemoveWhiteSpaces", false)
  end

  vim.api.nvim_exec("RemoveTabs", false)
end

vim.api.nvim_create_augroup("handler", { clear = true })
vim.api.nvim_create_autocmd("BufWritePre", {
  group = "handler",
  pattern = "*",
  callback = RemoveDust,
})

License

MIT License

About

A Neovim plugin for removing trailing white spaces and tabs

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages