Elastic tabstops is a proposed alternative to the tabs-vs-spaces debate, redefining how tab characters work in text editors. Instead of placing text at fixed Nth-column positions, tabs act as cell delimiters in a table-like structure, where each column block automatically resizes to fit the widest content in vertically adjacent cells. This allows different programmers to view the same file with their preferred indentation width without misalignment, and enables proportional fonts in code editors. The concept was invented in 2006 and has been implemented in several editors including Elastic Notepad, Visual Studio, Scintilla, jEdit, Notepad++, and is used by Go's gofmt tool via the tabwriter package.

8m read timeFrom nick-gravgaard.com
Post cover image
Table of contents
Intro - the status quo sucksThe solution - move tabstops to fit the text between them and align them with matching tabstops on adjacent linesTry it right nowKeep it simple, stupid!Forwards compatibilityCurrent implementationsPotential implementationsIncorrect implementationsSee alsoThe name "elastic tabstops"Updates

Sort: