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

Customizing the configuration of the internal formatter #411

Closed
ghost opened this issue May 24, 2022 · 3 comments
Closed

Customizing the configuration of the internal formatter #411

ghost opened this issue May 24, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@ghost
Copy link

ghost commented May 24, 2022

As the vim-iced documentation says, the following is already possible:

let g:iced#format#rule = {
      \ 'merr.core/let': '[[:block 2] [:inner 1]]',
      \ }

It would be great, if you could pass in the top configuration map for cljfmt here instead and by doing so change settings like:

{:remove-surrounding-whitespace? true
 :remove-trailing-whitespace? true
 :remove-consecutive-blank-lines? false
 :insert-missing-whitespace? true
 :remove-multiple-non-indenting-spaces? false
 ...
}

Thank you for making vim-iced 💯
🙇

liquidz added a commit that referenced this issue Jun 7, 2022
liquidz added a commit that referenced this issue Jun 7, 2022
liquidz added a commit that referenced this issue Jun 7, 2022
@liquidz
Copy link
Owner

liquidz commented Jun 7, 2022

@ixffxi Sorry for late reaction.
I've added g:iced#format#options option for customizing internal formatter(cljfmt).

Nightly document is here.
https://vim-iced-nightly.netlify.app/vim-iced.html#g%3Aiced%23format%23options

Could you try dev branch?

@liquidz liquidz added the enhancement New feature or request label Jun 7, 2022
@ghost
Copy link
Author

ghost commented Jun 9, 2022

Not at all, you have more important things to do than this. Thank you for your quick action!

I tried it and its working nicely. I fell into a little trap though: Tried it with a very minimal config and I forgot to set let g:sexp_mappings = {'sexp_indent': '', 'sexp_indent_top': ''} like it is described in "9. Formatting" With the sexp indention disabled the patch looks fine to me.

One small find in the new section of the documentation: "Default valud (<-- typo) is {}."

Thank you! 🎉

@liquidz
Copy link
Owner

liquidz commented Jun 10, 2022

@ixffxi Thanks for your confirmation!

One small find in the new section of the documentation: "Default valud (<-- typo) is {}."

Oh, nice catch! I've fixed, and just released v3.9.1 #415 ☺️

@liquidz liquidz closed this as completed Jun 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant