Micha Niskin

Monday September 17, 2007
Category  

This link is a pretty good reference for setting tabs and indentation in vim. I find the :retab command especially useful when I’m editing a file that has mixed tabs and spaces in it and I want to clean it up and have only spaces for indentation.

In this case doing a find/replace substitution for the tabs (like :%s/^I/ /g, for example) doesn’t really do what you want it to do. I mean, the whole point of having tabs is that they are not all the same width—-some of them may occupy only one character of space, while another may occupy 4 characters of space, depending on how you have your tabstops set. But :retab does it beautifully.

From the page:

After the ‘expandtab’ option is set, all the new tab characters entered will be changed to spaces. This will not affect the existing tab characters. To change all the existing tab characters to match the current tab settings, use :retab.

When you use this it’s probably a good idea to put a modeline at the top or bottom of the file to prevent those tabs from getting back in there.

Comment

  1. ambien [url=“http://www.chrisgiddensrmt.com/ambien.html”]ambien[/url] http://www.chrisgiddensrmt.com/ambien.html 3429 acomplia [url=“http://www.captainsquartersusvi.com/acomplia.htm”]acomplia[/url] http://www.captainsquartersusvi.com/acomplia.htm sfd

    Togasa · Nov 4, 09:59 PM · #

  2. tramadol [url=“http://www.captainsquartersusvi.com/tramadol.htm”]tramadol[/url] http://www.captainsquartersusvi.com/tramadol.htm wgj buy accutane [url=“http://www.captainsquartersusvi.com/accutane.htm”]buy accutane[/url] http://www.captainsquartersusvi.com/accutane.htm 621265

    Abbe · Nov 5, 02:55 AM · #

  3. Erectile dysfunction, <a href=“http://www.viagrausageneric.com/”>generic viagra</a>, 79034, [URL=http://www.viagrausageneric.com/]generic viagra[/URL], )(8;, http://www.viagrausageneric.com/ Viagra, ntdxb.

    Viagra · Nov 12, 07:27 PM · #

  4. Erectile dysfunction, <a href=“http://www.viagrausageneric.com/”>generic viagra</a>, 51605, [URL=http://www.viagrausageneric.com/]generic viagra[/URL], ;b))o, http://www.viagrausageneric.com/ Viagra, euwto.

    Viagra · Nov 12, 07:27 PM · #

  5. Erectile dysfunction, <a href=“http://www.viagrausageneric.com/”>generic viagra</a>, 177013, [URL=http://www.viagrausageneric.com/]generic viagra[/URL], :(, http://www.viagrausageneric.com/ Viagra, zqdefr.

    Viagra · Nov 12, 07:27 PM · #

  6. Hi! VlPgNyJS

    LITgycs · Dec 28, 04:18 PM · #

  7. Hi! CAVJvGW http://jwmfwl.com/ iThURnjO [url=http://edhhms.com/]iThURnjO[/url]

    viagra · Jan 18, 08:22 AM · #

  8. Hi! AelSNDm zgqhLzs

    viagra · Jan 19, 10:59 PM · #

  9. Hi! kydTNGu [url=http://osggbs.com/]ZFKnOgLZ[/url]

    viagra · Jan 20, 09:44 AM · #

  10. Hi! iVSkRC http://vfpnli.com/

    viagra · Jan 21, 06:48 PM · #

  11. bJdywVAn

    Cheap Ambien · Jan 25, 09:46 PM · #

  12. RFCmeO

    Klonopin · Jan 26, 12:59 AM · #

  13. OLXrBf

    Alprazolam · Jan 26, 02:38 AM · #

  14. CAOCjXV

    Viagra · Jan 27, 10:14 PM · #

  15. EaHbpS

    Buy Cialis · Jan 28, 12:25 AM · #

  16. GhmLPD

    Marlboro Cigarettes · Jan 28, 01:52 AM · #

  17. PRcfgFrW

    Tamiflu · Jan 30, 11:05 PM · #

  18. OJDyTRo

    VMPeFBuH · Feb 2, 05:21 PM · #

  19. FWzUsFLJ

    Ultram · Feb 5, 10:11 PM · #

  20. kMKGdglC

    Xanax · Feb 9, 04:19 AM · #

  21. ItZQjB

    Phentermine · Feb 9, 06:27 AM · #

  22. nlxXJIMS

    Cheap Tramadol · Feb 10, 04:52 AM · #

  23. vLSmCu

    Cheap Xanax · Feb 10, 10:57 PM · #

  24. fLwVuQyO

    Ativan · Feb 11, 03:19 AM · #

  25. YAiguNqR

    Buy Phentermine · Feb 11, 07:55 AM · #

  26. tEMpGZfV

    Cialis · Feb 12, 05:52 AM · #

  27. GhxSGyLn

    Viagra · Feb 12, 07:21 AM · #

  28. jzHqSqx

    Cheap Ambien · Feb 13, 12:03 AM · #

  29. uxnKeit

    Buy Camel · Feb 13, 06:02 PM · #

  30. iQPWBwJ

    Viagra · Feb 15, 04:36 AM · #

  31. yreuoZ

    Viagra · Feb 15, 10:34 PM · #

  32. tSsiwqp

    Cialis · Feb 16, 11:40 PM · #

  33. HYOTCb

    Cialis · Feb 17, 10:38 PM · #

  34. esxiji

    Viagra · Feb 19, 05:29 AM · #

  35. IeyhqWp

    Cialis · Feb 20, 12:53 AM · #

  36. loJqIKzC

    Cheap Ambien · Feb 21, 01:12 AM · #

  37. vmIfNE

    Cheap Ambien · Feb 23, 08:59 PM · #

  38. BeEpkg

    Buy Xanax · Feb 24, 11:48 PM · #

  39. UfPLhpUY

    Buy Xanax · Feb 26, 10:52 PM · #

  40. yzyXEhIg

    Buy Tramadol · Feb 27, 10:05 PM · #

  41. VUyodtuS

    Ambien · Mar 1, 03:48 AM · #

  42. WdtoOJU

    Cheap Phentermine · Mar 2, 12:48 AM · #

  43. NvZQlI

    Buy Ambien · Mar 3, 09:05 PM · #

  44. AZfxeOF

    Buy Viagra · Mar 4, 09:28 PM · #

  45. vNGpHL

    Ambien · Mar 5, 10:29 PM · #

  46. sqZBlWH

    Ambien · Mar 7, 06:59 PM · #

  47. DsOndx

    Buy Xanax · Mar 8, 08:40 PM · #

  48. YPAQdn

    Valium · Mar 9, 11:51 PM · #