sponsor Vim development Vim logo Vim Book Ad

Tabs only for indentation : Using tabs only for indentation while editing

 script karma  Rating 4/1, Downloaded by 731  Comments, bugs, improvements  Vim wiki

created by
Makoto Nokata
 
script type
indent
 
description
This plugin allows you to insert tabs only for indentation.
If left part of the cursor position in current line has only tabs or spaces,
then they will be replaced by tabs and one more tab will be added.
In other cases, only spaces will be added. That's all.
I think, it will helpful because tabs not used for code alignment.
But, if you really need to insert tab, you can use <S-Tab> for this.

PS: Sorry, another plugin doing the same can be found here:
http://www.vim.org/scripts/script.php?script_id=2308
I didn't search at all.
 
install details
Only two things:
1) Put this file to the plugin directory;
2) Add the folowing line to your ~/.vimrc config:
    imap <Tab> <Plug>AXEIndentTabs
 

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
AXETabsOnlyForIndent.vim 1.1 2011-05-10 7.0 Makoto Nokata Fixed bug with wrong number of spaces. So, if tabsize = 4, then
A<tab>
in the beginning of line inserts 3 spaces, not 2
AXETabsOnlyForIndent.vim 1.0 2011-04-29 7.0 Makoto Nokata Initial upload
ip used for rating: 3.16.15.149

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.
   
Vim at Github