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

optional two spaces #86

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

optional two spaces #86

wants to merge 7 commits into from

Conversation

zwhitchcox
Copy link

@zwhitchcox zwhitchcox commented Sep 29, 2016

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.

@zwhitchcox
Copy link
Author

Switched to using sed to preserve undo history

@zwhitchcox
Copy link
Author

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

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

Copy link

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.

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

Successfully merging this pull request may close these issues.

3 participants