-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Highlight function names the same way as vs code? #59
Comments
I guess that would be possible, though you'd have to be careful with tuple bindings like |
I did that at home! This is how course hacky and fairly limited, hence I did not propose it for merging. Put this for example in your " Highlight let‐binders, ie. identifiers which are given an immediate value.
" Limitations:
" — does not recognize let-patterns like “let (a,b) = …” or “let (C x) = …”
" [ — does not recognize “let[@inline] f = …” nor “let (*lol*) f = …” ]
" — does not support object values and methods
" Highlighting other binders (function arguments, “fun”, “function”, “try with”,
" match with”…) is much more difficult and would require writing a more accurate
" parser.
"syn match ocamlLetBinder /\(\<\(let\(\_s\+rec\)\?\|and\|for\)\>\_s\+\)\@<=\<\(\l\|_\)\(\w\|'\)*\>/
" This is a coarse approximation that recognize simple PPX annotations, as in
" “let[@inline] f = ...”.
syn match ocamlLetBinder /\(\<\(let\(\_s\+rec\)\?\|and\|for\)\>\_s*\(\[@\(@\|\w\|\.\|\_s\)*\]\_s*\)*\)\@<=\<\(\l\|_\)\(\w\|'\)*\>/
hi link ocamlLetBinder Identifier |
I quite like how vs-code highlights the function name in a color different from its arguments. Would that be possible in vim as well?
VS Code
Vim
The text was updated successfully, but these errors were encountered: