Jakub M.
Jakub M.

Reputation: 33857

VIM: How to add custom markers before lines

I want to mark erroneous lines a source code. I detect the incorrect lines using an external program (e.g., flake8). When I save the source, I would like VIM to execute the external program and mark invalid lines.

I thought about different possibilities of "marking" the lines, like underlining full line or changing background colour. What I would like to do is to have an additional column on the left hand side of the text, where I could place some markers (e.g., ">") indicating the offending lines.

I know about the flake8 vim plugin, it displays full flask output and I want just small markers.

Question:

How can I add such a "special column"?

I thought about a separate window with width=1, but maybe there are better options.

(This question migrated from here after innaM's comment)

Upvotes: 0

Views: 294

Answers (3)

Kent
Kent

Reputation: 195209

for your requirement, I suggest syntastic plugin, like others.

for your question, "add a customer marker before lines/special column" you should take a look sign.

:h sign

has more details, with examples.

Many plugins (syntastic, showmarkers....) have used this feature. you could add your own text, highlight and so on for your own sign.

Upvotes: 5

romainl
romainl

Reputation: 196789

Did you try Syntastic? It does everything you want and more.

The column you speak of is the "sign column", you can read all about it in :h signs.

Upvotes: 2

innaM
innaM

Reputation: 47879

Take a look at the sources of the Syntastic plugin. Maybe you don't even have to write your own plugin, but can leverage Syntastic's powers.

Upvotes: 2

Related Questions