Giter Site home page Giter Site logo

vim-trailing-whitespace's Introduction

This plugin causes trailing whitespace to be highlighted in red.

To fix the whitespace errors, call :FixWhitespace.  By default it
operates on the entire file.  Pass a range (or use V to select some lines)
to restrict the portion of the file that gets fixed.

The repo is at http://github.com/bronson/vim-trailing-whitespace

Originally based on http://vim.wikia.com/wiki/Highlight_unwanted_spaces

License: cc-by-sa.  The instructions this plugin is based on were
licensed cc-by-sa so, until a reason to force a different license appears,
we'll continue to use it.

A more complete alternative is at https://github.com/ntpeters/vim-better-whitespace

vim-trailing-whitespace's People

Contributors

bronson avatar duncannz avatar jh-yu avatar k0kubun avatar kaihowl avatar kovetskiy avatar liuqiang1357 avatar lucerion avatar marlun avatar nusendra avatar pabloscolpino avatar superjamie avatar tyru avatar zwodahs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vim-trailing-whitespace's Issues

Should not highligh empty context lines in diff mode

vim-trailing-whitespace mistakely highlight some lines in diff mode, i.e. when writing git commit -v messages and when opening patches.

In the diff output the first column is used as a gutter to show the status of the line: '+' for additions, '-' for removals and ' ' (a space) for context lines.

If the context line is an empty line it will be highlighted because it contains only a single white space.

Could this plugin detect that we are in diff mode (filetype=diff) and not highlight lines composed of exactly one single space?

Latest commit causes an error message

The latest commit (9b472b1) causes the following error message:

Error detected while processing /home/lbloch/.vim/plugged/vim-trailing-whitespace/plugin/trailing-whitespace.vim:
line   19:
E216: No such group or event: TermOpen * if ShouldMatchWhitespace() | match ExtraWhitespace /\\\@<![\u3000[:space:]]\+$/ | else | match ExtraWhitespace /^^/ | endif

System: fully updated Ubuntu 22.04.

Ignore doc/tags

The file doc/tags should be in .gitignore so this repo can be used as a git submodule with Pathogen.

Error because of the event name `TerminalOpen` on NeoVim (v0.8.3)

Hi,

I've been using this plugin quite a long time, but recently I ran into a weird problem complaining like:

Screenshot 2023-02-18 at 15 29 12

I think this error must be related to a recent PR (#27), and I suspect that the event name is called differently between Vim and NeoVim.

Is it possible to designate different event names along the different descendants of Vi?

Thank You!

Should we highlight spaces that are preceeded by a backslash?

Right now, vim-trailing-whitespace is complaining about the trailing space in the following line in my .vimrc:

set showbreak=↪\ \ \ 

However, the final space, after the third backslash, is part of the value that I am assigning to showbreak. Perhaps the whitespace-detection regexes should allow whitespace if it is preceded by a backslash?

/\s\+$/        " Current regex
/\\\@<!\s\+$/  " Proposed regex

Trailing whitespace and neovim terminal

Dear Bronson

I have been a long-term user of your plugin which highlights trailing whitespaces in text. I've recently noticed that this feature is also active in the internal terminal of Neovim, where it can be quite distracting. It would be beneficial if this functionality could be disabled by default in the terminal mode. I am willing to assist in making this adjustment if needed.

Cheers,
Stephan

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.