parsonsmatt / intero-neovim

A neovim plugin for Intero, forked from ghcmod-vim
218 stars 28 forks source link

Add 'intero' filetype, use for syntax highlighting #135

Closed jez closed 6 years ago

jez commented 6 years ago

Following up from #64, I've pulled a few changes together into an MVP of syntax highlighting an intero terminal buffer:

screen shot 2018-01-25 at 11 11 45 am

It doesn't do much context-aware highlighting for individual commands yet, because I didn't know which ones were worth supporting. I mostly just use :t, :i, :type-at, and :l, which are all pretty well supported without much effort.

jez commented 6 years ago

Updated: screenshot in description.

rdnetto commented 6 years ago

Awesome! :)

One nit: it only highlights the > in the prompt instead of everything before it, and then only if you have typed something on the same line.

This doesn't really matter though, as if it contains escape codes they get passed through anyway, and I suspect most users will do this anyway to get a coloured prompt when using stack ghci. So if you're not fussed about that, I'm happy to merge it.

intero_syntax

jez commented 6 years ago

Oh that’s a good catch! I’ll poke around at that before we merge. On Sat, Jan 27, 2018 at 8:00 PM rdnetto notifications@github.com wrote:

Awesome! :)

One nit: it only highlights the > in the prompt instead of everything before it, and then only if you have typed something on the same line.

This doesn't really matter though, as if it contains escape codes they get passed through anyway, and I suspect most users will do this anyway to get a coloured prompt when using stack ghci. So if you're not fussed about that, I'm happy to merge it.

[image: intero_syntax] https://user-images.githubusercontent.com/1973389/35478809-4b223b38-043b-11e8-9f6f-964ce8c48ad6.png

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/parsonsmatt/intero-neovim/pull/135#issuecomment-361036605, or mute the thread https://github.com/notifications/unsubscribe-auth/AFSaVLvvOeBLLU0KCpqKPXxUuKrU1umYks5tO_DbgaJpZM4RtVk7 .

parsonsmatt commented 6 years ago

@jez Any progress on that point?

jez commented 6 years ago

Ah, sorry for the radio silence on this! I haven't had much time lately, but today I do! I'll take another look at this and hopefully we can merge today or tomorrow.

parsonsmatt commented 6 years ago

No worries, I haven't been able to put much energy into this either :) Thanks!

jez commented 6 years ago
Solarized Light Solarized Dark
screen shot 2018-05-03 at 7 54 13 pm screen shot 2018-05-03 at 7 56 16 pm

Actual colors will differ based on your installed colorscheme.

It's possible to override the default colors here by setting values for the color groups in your vimrc (i.e., we only provide default mappings if none are specified earlier—see comment about this in the code).

Features exemplified in the screenshots:

This is just a start! Future work:

Also: @rdnetto I think that I fixed the issue you were seeing where part of your prompt was getting highlighted as if it were Haskell syntax. I'd love it if you could confirm this!

jez commented 6 years ago

Just added one more potential thing to highlight on GHCi output.

@parsonsmatt @rdnetto bump on this?

parsonsmatt commented 6 years ago

Screenshots?

EDIT: Ah, you already posted some! If you're happy with this, then I am good to merge.