Adjusted syntax highlighting and indentation - #9
Conversation
Highlighting adjustments:
- Added period (.) to the 'iskeyword' list in ftplugin/fennel.vim so
things like 'string.match' are highlighted, instead of just the
'string' in 'string.match'
- Moved FennelSpecialForm out of the 'Special' highlight group into the
'Define' highlight group to semantically match what elements in this
group do--They often define things ('local', 'fn', etc.)
- Moved LuaSpecialValue out of the 'Special' highlight group into the
'Function' highlight group since a lot of these are just Lua functions
you can interop with
Indentation adjustments:
- Removed 'do' and 'if' from 'lispwords' to match indentation of fnlfmt
- Removed 'if' ('do' wasn't in here, so I didn't need to remove it) from
g:fennel_fuzzy_indent_patterns to match formatting of fnlfmt
Minor formatting/consistency changes:
- Added missing '$' to the ends of some of the regex strings in g:
fennel_fuzzy_indent_patterns
- Reformatted g:fennel_fuzzy_indent_patterns list
- Consolidated/combined some regex strings in
g:fennel_fuzzy_indent_patterns into one regex string
Examples of what the changes in this PR will do:
'if' statement indentation changes from this:
(if thing1
thing2
thing3)
to this:
(if thing1
thing2
thing3)
'do' statement indentation changes from this:
(do (thing1)
(thing2)
(thing3))
to this:
(do (thing1)
(thing2)
(thing3))
Built-in Lua functions now highlight both sides of the period infix, so
the highlighting changes from the following (where characters above each
'^' are highlighted):
(io.write "hello there")
^^
|
only highlights 'io'
to this:
(io.write "hello there")
^^^^^^^^
|
highlights 'io.write'
|
Thanks for this! I should have a chance to review this weekend. As you noted in chat, I'll just need to check whether anything is intentional (and thus should be configurable). My bad on some of it - I actually have some changes I've been using locally that I thought I had already pushed, including the changes to |
|
@jaawerth Thanks man! And no rush :) Feel free to push to this PR with your intended changes! I'm not the most knowledgeable with this stuff, and it seems like what highlight groups people use for various vim plugins is inconsistent, so anything to make it a nicer experience while making it idiomatic with how vim highlight groups, lispwords, etc. should be! And no worries, it took me like 2 years to finally make this PR hahaha |
Highlighting adjustments:
.) to theiskeywordlist in ftplugin/fennel.vim so things likestring.matchare highlighted, instead of just thestringinstring.matchFennelSpecialFormout of theSpecialhighlight group into theDefinehighlight group to semantically match what elements in this group do--They often define things (local,fn, etc.)LuaSpecialValueout of theSpecialhighlight group into theFunctionhighlight group since a lot of these are just Lua functions you can interop withIndentation adjustments:
doandiffromlispwordsto match indentation offnlfmtif(dowasn't in here, so I didn't need to remove it) fromg:fennel_fuzzy_indent_patternsto match formatting offnlfmtMinor formatting/consistency changes:
$to the ends of some of the regex strings ing:fennel_fuzzy_indent_patternsg:fennel_fuzzy_indent_patternslistg:fennel_fuzzy_indent_patternsinto one regex stringExamples of what the changes in this PR will do:
ifstatement indentation changes from this:to this:
dostatement indentation changes from this:to this:
Built-in Lua functions now highlight both sides of the period infix, so the highlighting changes from the following (where characters above each
^are highlighted):to this: