sponsor Vim development Vim logo Vim Book Ad

Clever Tabs : Using tabs for indent only on start of line

 script karma  Rating 30/14, Downloaded by 1069    Comments, bugs, improvements  Vim wiki

created by
Martin Spevak
script type
" Script solving indentation problem. Main idea is
" have tabs ("\t") at the beginning of line and
" after first another character like "\t" use spaces (like expandtab).
" This is useful for code readability. I'm trying to join these two ways:
" * http://www.movement.uklinux.net/docs/whytabs/
" * http://www.derkarl.org/why_to_tabs.html
" with using the best ideas from both.
" main() {
"     printf("hello");    //my comment
"     printf("world!");   //my comment 2
" }
" Before printf are tabs (this is block) anda before comments
" are tabs converted into spaces. After you change
" tabstop (for tabelator size), part with comments will
" have still same format, becuase tabs are only on line beginnig.
" note:    parameter for CleverTabs is shiftwidth in spaces
" note2:   this is my first script in vim, please be patient
" special thanks to james pickard for useful advices
install details
" instalation:
" paste content from CleverTabs.vim into .vimrc
" (or use vim/plugin directory)

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
CleverTabs.vim 1.0.2 2008-07-31 7.0 Martin Spevak * using virtcol for counting space tabelator size
CleverTabs.vim 1.0.1 2008-07-31 7.0 Martin Spevak * fixed bug extra space after tab
* using silent mode for function calling
CleverTabs.vim 1.0 2008-07-23 7.0 Martin Spevak Initial upload
ip used for rating:

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 the maillist. Help Bram help Uganda.
SourceForge.net Logo