Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Janis Papanagnou Newsgroups: comp.lang.tcl,comp.unix.shell,comp.editors Subject: Re: The "leading zero means octal" thing... Followup-To: comp.editors Date: Sun, 5 Jan 2025 08:39:54 +0100 Organization: A noiseless patient Spider Lines: 33 Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Injection-Date: Sun, 05 Jan 2025 08:40:00 +0100 (CET) Injection-Info: dont-email.me; posting-host="6ee5967cfd6763239853a04e47fb77c4"; logging-data="990446"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18JtON/Y+PrEnS4U+yJxGwt" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 Cancel-Lock: sha1:ml4cWOo1XkF8G1bUfUihWxJFqs4= In-Reply-To: X-Enigmail-Draft-Status: N1110 Bytes: 2520 [ f'up to comp.editors set ] On 05.01.2025 07:33, Kenny McCormack wrote: > In article , > Kenny McCormack wrote: >> In article , >> Eli the Bearded <*@eli.users.panix.com> wrote: >> ... >>> Vim is highly configurable. See ":help nrformats" for supported formats. >>> Not clearly documented in the version I have, but implied, is setting >>> it to a blank string to only recognize ordinary decimal numbers. >>> >>> :set nrformats= >> >> Thanks for the tip. I'll look into that. > > Yes, nf looks good. I set it to "alpha", which makes it do the right thing > with letters, while ignoring the stupid hex/octal/bin stuff. This 'alpha' is an interesting useful feature I didn't know. Thanks. (It will go into my .vimrc file.) Testing it I was a bit astonished, though, that (and different from numbers) it just works on single letters without a "carry"; with the string "say38", operating a 66^A on the number part creates "say104" while at any character it stops increment at "z". (I recall that I once had a requirement to enumerate some date as aa, ab, ac, ..., az, ba, bb, ..., bz, ..., zz, and even continuing zz with aaa, as with a numeric carry.) Janis