-
Notifications
You must be signed in to change notification settings - Fork 6
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: is there a way to configure Tonsky's indentation rule? #21
Comments
From a quick scan of that page, it looks like clojurefmt doesn’t exist (yet?). But if it does exist, you can tell Vim to use it by setting autocmd! FileType clojure setlocal formatprg=clojurefmt This will set the program used by the The downside to this is that formatting won’t happen automatically, but you could write a little Vim script to auto-format on file save. |
Thanks for the tip about However this is not what I was looking for originally. I was looking for a way to adjust the vim indent config so that it auto-indents following Tonsky's indentation rule. This way the indentation would be correct while I type, so I don't need to save the file constantly. After some exploring, I found the indentation for
This works in most cases but sometimes doesn't. I haven't figured out why yet. Is there a better to achieve this? |
Oh, OK I think I understand now. Do you have an example of where your Maybe you could try this one (it should be slightly more accurate): let g:clojure_fuzzy_indent_patterns = ['^[\k\d]\+'] |
E.g. for this sometimes it doesn't work. (Sometimes it does work. Not sure why. )
Desired result would be:
Also |
If you haven't changed the option, check your |
The objectives are: 1. Simplify the indentation code; previous implementation has become so complex it is impossible to maintain, 2. Significantly improve performance; previous indentation code was painfully slow, (see issue #6) 3. Maximum configurability; should be configured similarly to cljfmt and make previously impossible things possible (e.g. issue #21). As of this commit, objectives 1 and 2 have been met, but work on objective 3 has not yet begun. There will continue to be further improvements, particularly around performance and the "what if syntax highlighting is disabled?" scenario. These changes will unfortunately be backwards incompatible, but hopefully the improved performance and API will make up for it.
Context: https://tonsky.me/blog/clojurefmt/
The text was updated successfully, but these errors were encountered: