NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/60010: "expandtab" behaves counter-intuitively (and different from vim)



The following reply was made to PR bin/60010; it has been noted by GNATS.

From: Jason Thorpe <thorpej%me.com@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: gnats-admin%netbsd.org@localhost,
 netbsd-bugs%netbsd.org@localhost
Subject: Re: bin/60010: "expandtab" behaves counter-intuitively (and different
 from vim)
Date: Mon, 16 Feb 2026 11:20:34 -0500

 > On Feb 16, 2026, at 10:55=E2=80=AFAM, Valery Ushakov via gnats =
 <gnats-admin%NetBSD.org@localhost> wrote:
 >=20
 > If your muscle memory is that of vim, then use vim.  Consider that
 > other people may have different muscle memory and you are proposing to
 > ruin theirs.
 
 Well, this really only comes into play when you=E2=80=99re working on a =
 code base that doesn=E2=80=99t conform to KNF (were the Tab vs Control-T =
 distinction is pretty much meaningless).  *This* is where my muscle =
 memory comes from, 30 years of writing/editing KNF-conforming code with =
 the default ts=3D8, where hitting the Tab key absolutely does the right =
 thing and Control-T simply isn=E2=80=99t necessary.
 
 Like, it=E2=80=99s been so =E2=80=9Cout of sight out of mind=E2=80=9D =
 that I had completely forgotten about the sw property because with =
 KNF-conforming code you simply don=E2=80=99t have to care.
 
 The other thing that irks me about the current situation: the setting in =
 question is called =E2=80=9Cexpandtab=E2=80=9D, not =E2=80=9Cexpandcontrol=
 t=E2=80=9D to =E2=80=9Cexpandtoshiftwidth=E2=80=9D.
 
 The issue only came up for me recently because I=E2=80=99ve been working =
 on a code base that is in a sort of hybrid GNU/KNF style, which uses =
 2-space tabs and all indents are expanded to spaces.  My assumption is =
 that the original author wrote it using emacs, although none of the =
 usual emacs formatting markup is present in any of the files.
 
 In any case, I would be happy enough with something I could put into my =
 ~/.exrc (which for the last 30 years has read "set ai nomagic sm=E2=80=9D)=
  to enable what I would term =E2=80=9Crational expandtab behavior=E2=80=9D=
 .  That way no one else=E2=80=99s muscle memory would be disturbed.
 
 -- thorpej
 


Home | Main Index | Thread Index | Old Index