FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Configure indentation to standard Ruby style in ftplugin by robinst · Pull Request #48 · vim-ruby/vim-ruby · GitHub

Configure indentation to standard Ruby style in ftplugin - #48

Closed
robinst wants to merge 1 commit into
vim-ruby:masterfrom
robinst:master
Closed

robinst wants to merge 1 commit into
vim-ruby:masterfrom
robinst:master

Conversation

robinst commented Sep 2, 2011

Copy link
Copy Markdown

It doesn't make sense that all Ruby programmers have to configure the
indentation settings themselves when there's an universally accepted
standard. Sane defaults matter.

tpope commented Sep 2, 2011

Copy link
Copy Markdown
Member

I don't know about this. These files ship with Vim, and there's not a lot of precedent for ftplugins overriding 'shiftwidth'. Just 3 out of 172 ftplugins do so, to be exact, and all 3 are languages I've never heard of (and thus could have slipped through the cracks). I guess we could try it.

If this is to be merged, the options need to be restored in b:undo_ftplugin. And changing 'tabstop' is absolutely unacceptable. Tabs are 8 spaces. Period.

There's also 3 changes of 'shiftwidth' in indent/*.vim, 2 of them being done by me (Haml and Sass, from back in the days when 2 space was mandatory). So it's unclear which of the two files it belongs in.

It doesn't make sense that all Ruby programmers have to configure the
indentation settings themselves when there's an universally accepted
standard. Sane defaults matter.

robinst commented Sep 2, 2011

Copy link
Copy Markdown
Author

Amended: Don't set tabstop and restore values in b:undo_ftplugin.

I guess most languages don't have such universally accepted standards or are just happy with the default setting of tab.

"setl.*(shiftwidth|sw)" occurs 5 times in ftplugin (falcon, occam, logtalk, reva, ada) and 3 times in indent here. I could move it to indent if you prefer, but wouldn't know where to do the undo in there.

now commented Sep 3, 2011

Copy link
Copy Markdown
Member

This isn’t happening. We have no business adjusting shiftwidth, softtabstop, or expandtab. Had it been mandated by the language, then yes, but now it’s not up to us to take a religious stand on this issue. Yes, most people use an indent of 2 spaces in Ruby, but it’s still not up to us to force the matter.

C also has universally accepted indention standards. The only problem is that there are so many of them.

Note that Ada only alters these values if g:ada_folding is set, which it by default isn’t.

For Occam, the value is set because it seems that this is more or less required by Occam. Occam mode for Emacs makes this a bit clearer:

(defconst occam-indent 2  
  "*OCCAM standard indentation (do not change!)")

There’s no ftplugin/falcon.vim in my vim73.

ftplugin/logtalk.vim certainly looks like something that slipped between the cracks. It’s setting all crazy kind of stuff that it shouldn’t be touching. Not one setting in that file is a setting that it should bet touching.

I can’t really speak for ftplugin/reva.vim, but it shouldn’t be setting 'fo' the way it does. Also, it doesn’t contain a b:undo_ftplugin variable, which certainly speaks against its value as a reference.

I can only find haml.vim and sass.vim to set sw and sts under indent. Tim explained those settings as a result of Haml and Sass having already forced the issue. As this restriction has since been lifted, the indent definition files should be updated.

robinst commented Sep 3, 2011

Copy link
Copy Markdown
Author

The difference to C is that Ruby has just one standard, and 99% of people use it.

And the settings wouldn't be enforced, would they? If a user wants to have his own standard, he can configure it (and anger all his fellow Ruby developers with it), right? Or is there no way to adjust these in the user config after they have been set through ftplugin?

It's just about the defaults. I know how to configure it, but I don't understand why we have to make it unnecessarily hard for newcomers. I guess I should just shut up and invest my time in helping Redcar, at least they have useful defaults for Ruby indentation.

now commented Sep 3, 2011

Copy link
Copy Markdown
Member

On Sat, Sep 3, 2011 at 12:52, robinst
reply@reply.github.com
wrote:

I guess I should just shut up and invest my time in helping Redcar, at least they have useful defaults for Ruby indentation.

If you choose your editor so frivolously, then yes, perhaps you should.

At the end of the day, this is a policy decision that Bram has made.
If you want it changed, then, by all means, try to convince him to
change it.

tpope closed this Sep 4, 2011

robinst commented Sep 8, 2011

Copy link
Copy Markdown
Author

I asked on to the vim-dev mailing list about this, but no response for 5 days:

http://groups.google.com/group/vim_dev/browse_thread/thread/e5d929270cfd3c78

Apparently, nobody cares about this.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL