bhurlow / vim-parinfer

vim plugin to balance your parenthesis
MIT License
182 stars 18 forks source link

Comments and strings formats for new languages #66

Open rncar opened 4 years ago

rncar commented 4 years ago

Would be nice an easy way to add new formats to vim-parinfer.

For example, Janet (https://github.com/janet-lang/janet) has multiline strings using any number of backticks `:

``
This is a string.
Line 2
    Indented
"We can just type quotes here", and backslashes \ no problem.
``

And use # for comments:

# For long strings where you don't want to type a lot of escape characters,
# you can use 1 or more backticks (`) to delimit a string.
# To close this string, simply repeat the opening sequence of backticks

Any way I could add this ? Thanks and great work, vim-parinfer works great.

bhurlow commented 4 years ago

@rncar I'm not sure I follow the request here. You'd like some way to have parinfer applied to multi-line strings? vim-parinfer basically passes a region of text to the parinfer algorithm to apply parenthesis accordingly, a multi-line string wouldn't necessarily have parenthesis.

Which lisp are you using with the plugin?

rncar commented 4 years ago

The lisp is Janet: https://github.com/janet-lang/janet https://janet-lang.org/docs/syntax.html

The problem, if I use parens, curlies or brackets in multilines strings, parinfer modify the string. The parinfer algorithm should skip that block.

Same for the Janet comment symbol, #.