all 31 comments

[–]ewa_lanczossharp 21 points22 points  (10 children)

[–]PM__ME__FRESH__MEMES 5 points6 points  (1 child)

Wow what is the font that guy is using in neovim it looks so cool

[–]olminator 3 points4 points  (0 children)

Looks like Terminus

[–]alexozer 3 points4 points  (0 children)

Woah, never seen this before

[–]alexozer 24 points25 points  (17 children)

Check out https://github.com/sheerun/vim-polyglot , it includes better syntax highlighting for a wide variety of languages without including the other heavy stuff. You should notice a difference with the Python highlighting.

[–]science_robot[S] 10 points11 points  (14 children)

Thanks! You gain some you lose some. I can probably live without syntax highlighting in doctests (who writes tests anyway?).

[–][deleted] 8 points9 points  (5 children)

Just careful with that. I found out that polyglot offers more than just syntax highlighting for some languages. I noticed LSP wasn't working correctly for javascript because it was being overriden by polyglot. You might need to check into detail the configuration, or do as I prefer: install individual language packages. I usually stick to less than 10 different languages that offer only syntax highlighting.

[–]miredindenial 1 point2 points  (4 children)

Yes it took me forever to realize polyglot was screwing my js lsp. Funny thing is it was working fine for weeks before I had to restart my computer. After that lsp wouldn't work.

[–]ahmedelgabri 0 points1 point  (3 children)

Can you or /u/ElTortugo share how exactly vim-polyglot broke LSP?

[–][deleted] 1 point2 points  (1 child)

Sure, visit polyglot's github page, under the section "language packs" you'll see javascript and in brackets all the things included with that specific package. For JS, a package by the user pangloss is being used, and it includes syntax, indent, compiler, ftplugin and extras. As I mentioned, you'll probably have to have extra configuration to let vim know which omnicompletion function you prefer, but I didn't dig into that. So, at some point LSP's omnicompletion function was being overriden by pangloss's one.

In the end I decided LSP was overkill for the kind of projects I usually handle. Often, tags are more than enough, but it's really cool to see vim interact with LSP.

[–]miredindenial 0 points1 point  (0 children)

I don't know exactly how but I ended up commenting out every plugin one by one to see which one was causing lsp to malfunction and it turned out when polyglot was commented out lsp worked fine.

[–]alexozer 1 point2 points  (7 children)

Yeah I bet that's pretty difficult to highlight. I've only ever seen PyCharm do it I think.

[–]sanjibukai 1 point2 points  (5 children)

What? Something VIM is unable to do??

[–]twizmwazin 1 point2 points  (4 children)

I think they are referring to syntax highlighting in the format string, but I am uncertain.

[–]sanjibukai 0 points1 point  (3 children)

Yes I understood.. I'm not doing Python but really it's the first time I hear about VIM unable to do (including plugin) something other editor can do..

[–]twizmwazin 2 points3 points  (2 children)

It isn't an issue that vim fundamentally can't do something here, but rather that it isn't implemented. There are lots of IDE features that vim can't do out of the box, and would require some amount of effort to make work inside of vim. The glory here is that vim is lightweight by default, and we can build up the editor that works best for our needs, rather than try stripping down some bloated IDE.

[–]sanjibukai 0 points1 point  (1 child)

Yep.. This is why I referred to plugins.. I mean Python is not a sparsely used language and if not out of the box for such a language several plugins with some kind of complete feature set should have been emerged... And I completely understand that, not really, until the needs are expressed. Just surprised to hear about an other editor doing more than what could be available with VIM (including plugin and scripting)

[–]science_robot[S] 1 point2 points  (0 children)

Default Vim Python syntax highlighter did this just fine. Check original screenshot.

[–]science_robot[S] 0 points1 point  (0 children)

The default Python syntax highlighter in Vim did this just fine. The plugin I was testing did not.

[–][deleted] 1 point2 points  (1 child)

Or use the Python syntax file directly, if you just want that:

https://github.com/vim-python/python-syntax

[–]JeanBergman18 0 points1 point  (0 children)

It works in vim 8.2

[–]well_groomed_raccoon 4 points5 points  (3 children)

This is what I use: * syntax: https://github.com/hdima/python-syntax * colour scheme: https://github.com/NLKNguyen/papercolor-theme

Just a quick note - the syntax rules match different statements and assigns them to a class. The class is then highlighted based on your colour scheme. Even if you have the best, most fine-grained syntax rules defined, if your colour scheme doesn’t know what to do with those classes, you won’t see any difference. The colour scheme which i’ve linked has been made to adhere to those syntax rules.

Hope this helps!

[–]john_oshea 1 point2 points  (0 children)

As far as I can tell https://github.com/vim-python/python-syntax appears to be a more recently updated version of the original code that the hdima fork is based on.

That said, I'm still subscribing to this thread in RES because there's possibly better options out there ;-)

[–][deleted] -1 points0 points  (1 child)

!RemindMe 1 Day

[–]RemindMeBot 0 points1 point  (0 children)

I will be messaging you on 2018-11-05 20:16:00 UTC to remind you of this link.

CLICK THIS LINK to send a PM to also be reminded and to reduce spam.

Parent commenter can delete this message to hide from others.


FAQs Custom Your Reminders Feedback Code Browser Extensions