Re:Vim Colors
by erikb on Tuesday June 30, 2015 @06:57AM
(#9804252)
Why is something limited in highlighting because it's a text editor and not an IDE? Highlighting is about text so it's quite a core feature of an editor.
[ Parent
| on HN ]
Re:Vim Colors
by andrewaylett on Tuesday June 30, 2015 @07:04AM
(#9804287)
Usually because the text editor is limited to regular expression and region matching, while the IDE parses the language into an AST so it knows what each bit actually means.
Re:Vim Colors
by outworlder on Tuesday June 30, 2015 @03:35PM
(#9807884)
Except a text editor can also generate the AST.
Re:Vim Colors
by andrewaylett on Tuesday June 30, 2015 @03:50PM
(#9807978)
What I meant was that the limitation in highlighting is usually due to the limitation in pattern matching. Of course, IDEs usually contain text editors, and they often do highlight using an AST. But that's expensive, both to develop and to run, and especially if you're not going to use the AST for any other IDE-like activity. Pattern-matching is cheap and usually good enough.
Okay, you are not talking about a problem in principle but how it practically is in reality. I don't know if text editors like Sublime/Atom also have that problem but when it comes to vim I can agree with that. Wouldn't wonder if there are some better external highlighters that can be integrated with vim. I heard that people use a vim plugin for using external linters for static analysis of code and spell checking.
And just to make sure, we agree that adding a feature like AST based highlighting wouldn't make an editor an IDE, right?
Re:Vim Colors
by andrewaylett on Tuesday July 07, 2015 @08:53AM
(#9845070)
Agreed.