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....

+ Reply to Thread
Results 1 to 3 of 3

vim: replace tabs by spaces

  1. Default 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.



  2. Default 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


  3. Default 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

+ Reply to Thread

Similar Threads

  1. A better way to convert spaces to tabs while joining 2 lines
    By Application Development in forum awk
    Replies: 6
    Last Post: 12-07-2007, 02:37 PM
  2. Awk script to separate spaces and tabs
    By Application Development in forum awk
    Replies: 10
    Last Post: 03-04-2007, 09:56 PM
  3. Vim autoindent Tabs and Spaces
    By Application Development in forum Editors
    Replies: 2
    Last Post: 02-16-2007, 07:20 PM
  4. how to deal with spaces and tabs
    By Application Development in forum awk
    Replies: 1
    Last Post: 02-16-2006, 07:59 AM
  5. How to use split on spaces AND tabs?
    By Application Development in forum Perl
    Replies: 2
    Last Post: 07-03-2004, 04:24 PM