Vim logo vim online Vim Book Ad

Smart C Tabs : Use <tab> at the beginning of the line, spaces elsewhere.

 script karma  Rating 4/3, Downloaded by 255

created by
Michael Geddes
 
script type
utility
 
description
There are many different arguments about tabs and stuff.  My current personal preference is a choice of tabbing that is independent of anybody's viewing settings.  
For the beginning of the line, this means we can use <tabs> which will expand whatever the reader wants it to.  Trying to line up tabs at the end of the line is a little trickier, and making a few assumptions, my preference is to use spaces there.

This script allows you to use your normal tab settings for the beginning of the line, and have tabs expanded as spaces anywhere else.

<tab>  Uses editor tab settings to insert a tab at the beginning of the line (before the first non-space character), and inserts spaces otherwise.

<m-;> Adds a comment at (currently fixed at) 20 characters from the first non-space character of the line.

 
install details
Use as an ftplugin for c, cpp, idl files
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
ctab.vim 0.1 25-Feb-2002 6.0 Michael Geddes Initial upload

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to [email protected] after searching the archive. Help Bram help Uganda.
SourceForge Logo