Per-Project Whitespace with EditorConfig
Standards can change from project to project. Single quotes or double quotes? MooTools, Dojo, or micro-frameworks? And then the question that has started wars: spaces or tabs? I'm a tab guy myself but the team that I work on has set a two-space standard. It's not my preference but it was a team decision so I have to drink the Kool-Aid. I still want to use my typical tab whitespace on other projects but just this one project should use spaces. I thought this would be a nightmare but enter EditorConfig, a utility with plugins for several text editors which allows developers to specify settings per project.
Start by creating a .editorconfig and placing it at the root of the project which you'd like to create whitespace for:
Once the file is in place, it's up to you to set the spacing settings per file type as you wish:
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
end_of_line = lf
insert_final_newline = true
# 4 space indentation
indent_style = space
indent_size = 4
# Tab indentation (no size specified)
indent_style = tab
# Indentation override for all JS under lib directory
indent_style = space
indent_size = 2
So not only can you set spacing per project but you can set them per file too. I've found EditorConfig to be a lifesaver as I can code per usual without having to think about spaces or tabs. EditorConfig made my day!
Mobile and desktop browser vendors do their best to help us not look like idiots by providing us autocomplete, autocorrect, and autocapitalize features. Unfortunately these features can sometimes get in the way; we don't always want or need the help they provide. Luckily most browsers allow...
The ability to create rounded corners with CSS opens the possibility of subtle design improvements without the need to include images. CSS rounded corners thus save us time in creating images and requests to the server. Today, rounded corners with CSS are supported by all of...
Let's all be honest for a moment: we've all ... not paid for ... music. Whether it was via a file sharing app like Kazaa or Napster, or it was downloading and seeding on bittorrent, or maybe even downloading a music video and ripping its audio,...
I'll be first person to admit I don't do as much git repository maintenance as I should. I rarely delete branches which have been merged, so a
git branch execution shows me a mile-long list of branches that likely aren't relevant. The best way to find branches I've recently...
Looking for the right resources to help you satisfy the needs of your clients? On the lookout for the best tools to help you increase your revenue? Searching for the right software to help you improve your business? Well, then you’ve come to the right place....
O'Reilly puts on the best web industry conferences in the world. These conferences include Fluent Conference, Velocity Conference, and the upcoming OSCON in Portland, Oregon from July 20-24. Open Source Convention (OSCON) is a conference that focuses specifically on open source developers and the tools and possibilities...