-
Notifications
You must be signed in to change notification settings - Fork 102
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
optional two spaces #86
base: master
Are you sure you want to change the base?
Conversation
Switched to using sed to preserve undo history |
Been using this for a while now, and it works great! |
autoload/elm.vim
Outdated
@@ -62,6 +62,9 @@ fun! elm#Format() | |||
let old_fileformat = &fileformat | |||
call rename(l:tmpname, expand('%')) | |||
silent edit! | |||
if g:elm_format_two_spaces == 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love this hack!
I actually added a --tabsize
option to elm-format ( specious/elm-format@3d6aaff ) in part as a contribution to this quintessential discussion - avh4/elm-format#210
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be much preferable to using sed.
I personally sometimes do not have the screen real estate for four spaces and prefer not to have to type backspace twice as many times as necessary, and I think you can read code perfectly fine with two spaces, so I modified my elm-vim to allow people to have two spaces instead of four...with this pr, everyone could have this option.
Also added instructions to automatically format code before saving, which I find extremely useful.