Skip to content

vim: set Rust tab conventions #15429

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

Merged
merged 1 commit into from
Jul 5, 2014
Merged

Conversation

lilyball
Copy link
Contributor

@lilyball lilyball commented Jul 4, 2014

No description provided.

@lilyball
Copy link
Contributor Author

lilyball commented Jul 4, 2014

This supersedes #15416.

@bluss
Copy link
Member

bluss commented Jul 4, 2014

noo. Why change tabstop? This is generally discouraged.

You should use set expandtab shiftwidth=4 softtabstop=4

softtabstop is important for sane backspace.

@steveklabnik
Copy link
Member

I have tabstop set, and my backspace works fine. What's the issue with it?

@lilyball
Copy link
Contributor Author

lilyball commented Jul 5, 2014

softtabstop defaults to 0, meaning that tabstop controls the behavior of <Tab> by default. The reason to set softtabstop to 4 and leave tabstop alone is so files that use hard tabs still render those tabs at 8 spaces, but that assumes that Rust files with hard tabs should treat those tabs as 8 spaces. I have personally never seen a Rust file that had hard tabs that were intended to be interpreted as 8 spaces. I've certainly never seen the classically emacs-style 4-space indent 8-space hard tab, which is what setting softtabstop to 4 and leaving tabstop at 8 is really meant to support.

@bluss
Copy link
Member

bluss commented Jul 5, 2014

I guess leaving tabstop at 8 is overly conservative. But softtabstop=4 makes sure a backspace removes a full 4-space indent. If there isn't any other way to get that behaviour, we will need sts

@bors bors closed this Jul 5, 2014
@bors bors merged commit 4c1fdd0 into rust-lang:master Jul 5, 2014
@lilyball
Copy link
Contributor Author

lilyball commented Jul 5, 2014

@blake2-ppc Is backspace deleting 4 spaces actually desired functionality? I don't generally consider that something I expect in Vim, but of course most language plugins don't try and change the default tab settings anyway. Perhaps it is something worth having.

@lilyball lilyball deleted the vim_tab_conventions branch July 5, 2014 19:04
@bluss
Copy link
Member

bluss commented Jul 5, 2014

@kballard I don't have any objective data points. IMO deleting an indent in one keystroke (backspace) when inserted by one keystroke (tab) is a requirement for using spaces for indents. I'm sure many editors do this, I don't have that many but Geany does this too.

bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 21, 2023
…methods, r=Veykril

minor : Deunwrap generate_delegate_methods

rust-lang#15398 subtask 8
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.

5 participants