Skip to content

This plugin trims trailing whitespace and lines.

License

Notifications You must be signed in to change notification settings

vzytoi/trim.nvim

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

trim.nvim

GitHub release GitHub

This plugin trims trailing whitespace and lines.

Requirements

Neovim v0.5.0+

How to install

Plug 'cappyzawa/trim.nvim'

How to setup

-- default config
local config = {
  disable = {},
  patterns = {
    [[%s/\s\+$//e]],
    [[%s/\($\n\s*\)\+\%$//]],
    [[%s/\%^\n\+//]],
    [[%s/\(\n\n\)\n\+/\1/]],
  },
}
lua <<EOF
  require('trim').setup({
    -- if you want to ignore markdown file.
    -- you can specify filetypes.
    disable = {"markdown"},

    -- if you want to ignore space of top
    patterns = {
      [[%s/\s\+$//e]],
      [[%s/\($\n\s*\)\+\%$//]],
      [[%s/\(\n\n\)\n\+/\1/]],
    },
  })
EOF

If you save without formatting, use :noa w

About

This plugin trims trailing whitespace and lines.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Lua 100.0%