vim: replace tabs by spaces - Editors
This is a discussion on vim: replace tabs by spaces - Editors ; Any idea how I can replace all the tabs in my file by whitespaces (without
altering the characters positions)
I have tried things with retab, but cant get it to work....
-
vim: replace tabs by spaces
Any idea how I can replace all the tabs in my file by whitespaces (without
altering the characters positions)
I have tried things with retab, but cant get it to work.
-
Re: vim: replace tabs by spaces
NewLine wrote:
> Any idea how I can replace all the tabs in my file by whitespaces (without
> altering the characters positions) I have tried things with retab, but
> cant get it to work.
Please be more specific. What doesn't work with :retab? Have you tried
setting 'expandtab' or manually specifying a tabstop?
:setl expandtab
:retab 4
If this doesn't work, you could always try
:%s/\t/ /g
HTH,
--
Benjamin D. Esham
bdesham@gmail.com | AIM: bdesham128 | Jabber: same as e-mail
"People find it far easier to forgive others for being wrong than
being right." — Albus Dumbledore in HBP
-
Re: vim: replace tabs by spaces
In article <44cfb0a7$0$10460$ba620e4c@news.skynet.be>,
"NewLine" <umts_remove_all_this@skynet.be> wrote:
> Any idea how I can replace all the tabs in my file by whitespaces (without
> altering the characters positions)
> I have tried things with retab, but cant get it to work.
I've always set the 'expandtab' option, set the 'tabstop' to the
tab increment I wanted, then used 'retab'
:set tabstop=4
:set expandtab
:%retab
Bob Harris
Similar Threads
-
By Application Development in forum awk
Replies: 6
Last Post: 12-07-2007, 02:37 PM
-
By Application Development in forum awk
Replies: 10
Last Post: 03-04-2007, 09:56 PM
-
By Application Development in forum Editors
Replies: 2
Last Post: 02-16-2007, 07:20 PM
-
By Application Development in forum awk
Replies: 1
Last Post: 02-16-2006, 07:59 AM
-
By Application Development in forum Perl
Replies: 2
Last Post: 07-03-2004, 04:24 PM