Is your feature request about something that is currently impossible or hard to do? Please describe the problem.
Markdown files uses two trailing spaces to insert a line break. Trailing spaces can be hard to spot in a file.
Describe the solution you'd like
Add a trailmultispace:c...
setting to listchars. This should be like leadmultispace:c...
but for trailing spaces.
Describe alternatives you've considered
Use set listchars=trail:c
. This is an okay solution, but it can be difficult to quickly notice if there are exactly two trailing spaces.
Creating a syntax highlight for trailing spaces. This can match the exact number of characters making it easy to spot the number of trailing spaces.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
Well, not sure. Is a (•
denoting a single trailing whitespace):
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam••¶
really that much harder than:
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam*¶
where * would be used for trailing multi-spaces? In addition, you can also highlight more than 2 trailing spaces using /\s\s\+$
in combination with :set hls
In addition, you can already make use of concealing for trailing whitespaces.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
I don't like set listchars=trail:•,eol:¶
as then you have a paragraph sign at the end of every line. The idea is to only draw attention to lines where there are two spaces at the end. That way, for markdown, you can quickly identify if a line break has been added or not.
:set hls
is good but only lasts until the search pattern changes. I'd like to be able to notice a missing or unintended line break in the process of editing. Of course a search is fine to do a focused check.
I'll look into concealing. That seems like it may be a good option.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
I like how conceal works. I opted for this:
syntax match Noraml '\s\{2}$' conceal cchar=⏎
setlocal conceallevel=2
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
Closed #14819 as completed.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
I'll add that vim includes markdownLineBreak
in it's default syntax files. It matches 2 or more trailing spaces, and appears to be unused for highlighting, at least in my setup. Though I prefer calling out the last 2 spaces separately from any additional spaces so it's clear if there are more spaces then needed.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
That's a decision for @tpope (syntax file maintainer for markdown) to be done.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
I'll add that vim includes
markdownLineBreak
in it's default syntax files. It matches 2 or more trailing spaces, and appears to be unused for highlighting, at least in my setup. Though I prefer calling out the last 2 spaces separately from any additional spaces so it's clear if there are more spaces then needed.
It's off by default, but can be assigned highlighting by users that desire it.
I like how conceal works. I opted for this:
syntax match Normal '\s\{2}$' conceal cchar=⏎
setlocal conceallevel=2
I'd note that markdown.vim makes heavy use of conceal
to hide syntax, so this would be a confusing and counterproductive behavior to add upstream. But as a local addition to your Vim config it should work great.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.