Set tabbing to match Elm style guide and examples (2 spaces)#185
Set tabbing to match Elm style guide and examples (2 spaces)#185niksilver wants to merge 1 commit intoElmCast:masterfrom niksilver:master
Conversation
|
Where is this "vim standard" defined? |
|
Regards "standard vim": Yes, "vim standard" is the wrong phrase - the title of the request is an error. I've corrected that now. Apologies for the confusion. My personal experience suggests that the default tab spacing on most terminals is 8 spaces, and Wikipedia says tab has been "de facto standardized at every multiple of 8 characters horizontally". Therefore as it stands if the elm-vim plugin is installed with no other settings or preferences (user preferences or otherwise) the user can expect to find it defaults to 8-space tabs. This is what I found. Regards elm-format: I did not suggest Regards user preferences: Yes, user preference settings should indeed be put in I offer this patch simply as a benefit to the community. The maintainers of ElmCast, of course, are free to accept or reject as they wish. |
|
AFAIK, Evan used two spaces indentation in the examples, since four spaces indentation would make them too wide to fit in the website, and elm-format is supposed to be following (or enforcing) the community preference (since the tool is maintained by members of elm). I find it confusing, as well, that even the style guide, and the standard packages, are not consistent with regard to indentation (using both two and four spaces). |
|
The majority of projects use |
Problem: When I use elm-vim out of the box it defaults to tab stops of 8 spaces, but the Elm standard is 2 spaces.
Workaround: As a workaround I added the following line to my
~/.vimrcfile:But that's a manual change.
Fix: The change submitted seems to fix this problem, and sets tab stops in
.elmfiles to 2 spaces, regardless of the user's global settings.