Re: Leading spaces -> tabs

2006-04-21 Thread Gerald Lai
On Fri, 21 Apr 2006, Dominic Evans wrote: [snip] the following commands replace leading spaces by tabs according to the current value of the 'tabstop' option :%s/^ \+/\=substitute(submatch(0), repeat(' ', &tabstop), "\t", 'g') :%s/^ \+/\=substitute(submatch(0), ' \{' . &tabstop . '\}', "\t",

Re: Leading spaces -> tabs

2006-04-21 Thread Dominic Evans
On 4/21/06, Gerald Lai <[EMAIL PROTECTED]> wrote: > There's a general dislike for tabs because it is editor-dependent. I > only seem to find use for them in Makefiles. Only the tabstop should be editor dependant. I follow the philosophy of here: http://derkarl.org/why_to_tabs.html - using tabs to

Re: Leading spaces -> tabs

2006-04-21 Thread Jürgen Krämer
Hi Dominic Evans wrote: > I like to have leading spaces as tabs, but all spaces after any > non-whitespace character has occurred to be regular spaces. > > Unfortunately :retab! performs the spaces->tab substitution throughout the > file. > > In the past I have got around this by using the fol

Re: Leading spaces -> tabs

2006-04-21 Thread Gerald Lai
On Fri, 21 Apr 2006, Dominic Evans wrote: I like to have leading spaces as tabs, but all spaces after any non-whitespace character has occurred to be regular spaces. Unfortunately :retab! performs the spaces->tab substitution throughout the file. In the past I have got around this by using the

Leading spaces -> tabs

2006-04-21 Thread Dominic Evans
I like to have leading spaces as tabs, but all spaces after any non-whitespace character has occurred to be regular spaces. Unfortunately :retab! performs the spaces->tab substitution throughout the file. In the past I have got around this by using the following replace instead (where ^I = tab)