Skip to content
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

Question: docs/tips for syntax highlighting? #59

Open
branneman opened this issue Oct 28, 2020 · 3 comments
Open

Question: docs/tips for syntax highlighting? #59

branneman opened this issue Oct 28, 2020 · 3 comments

Comments

@branneman
Copy link

branneman commented Oct 28, 2020

Which VS Code extension to you recommend to use for eslisp? I started using Lisp by Yasuhiro Matsumoto, but I'm unsure if better ones are available. What are your thoughts on this?

I think it adds value to recommend an existing VS Code extension in the readme or the docs. Why single out VS Code? Because it's the biggest one out there (especially in the JS community), and it's not a bad choice. (source)

Ideally, a specific eslisp syntax highlighter extension is created, but that would be a significant undertaking, and I can imagine you may have already had thoughts about this?

@anko
Copy link
Owner

anko commented Oct 28, 2020

Which VS Code extension to you recommend to use for eslisp?

I use vim for everything, so I wouldn't know.

Maybe eslisp secretly shares more syntax with different lisps such as Scheme or Clojure. [...] Ideally, a specific eslisp syntax highlighter extension is created

Eslisp's syntax is pretty much identical to Scheme, so I imagine modifying a Scheme highlighter would be the easiest option. I'm sure the source or such a highlighter has a list of standard forms somewhere, which could just be changed to correspond to eslisp's built-in macros instead.

If you want to make it, please do. I think it would be best in a separate repo, to separate concerns.

I think it adds value to recommend an existing VS Code extension in the readme or the docs.

I agree! It could go under doc/editor-extensions.md or such.

@branneman
Copy link
Author

branneman commented Oct 29, 2020

I use vim for everything, so I wouldn't know.

And which highlighting rules/package do you use in vim then? The one for Scheme?

@anko
Copy link
Owner

anko commented Oct 29, 2020

@branneman Yep.

autocmd BufEnter *.esl set filetype=scheme

Though I use that less for the highlighting, and more for how it changes the rules of vim's built-in autoformat command (=) to use a "wider" Lisp style:

(= value
   (object k1 v1
           k2 v2))

The more compact style it uses with no filetype is sometimes less clear:

(= value
 (object k1 v1
  k2 v2))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants