471,344 Members | 1,012 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,344 software developers and data experts.

vim - what's a smarttab?

Is smarttab one of these:

1) Expands tabs into the number of spaces set with tabstop at the
start of a line, and uses a tabstop sized tab elsewhere.

2) Expands tabs into the number of spaces set with shiftwidth at the
start of a line, and expands tabs into the number spaces set with
tabstop elsewhere.

3) Doesn't do any expanding: uses shiftwidth sized tabs at beginning
of line, and tabstop sized tabs elsewhere.

Alternatively, what is a smarttab?

Thanks.

Sep 24 '07 #1
4 11803
Hi "7stud",
Alternatively, what is a smarttab?
in VIM type :help smarttab and you'll see the following:

'smarttab' 'sta' boolean (default off)
global
{not in Vi}
When on, a <Tabin front of a line inserts blanks according to
'shiftwidth'. 'tabstop' or 'softtabstop' is used in other places. A
<BSwill delete a 'shiftwidth' worth of space at the start of the
line.
When off, a <Tabalways inserts blanks according to 'tabstop' or
'softtabstop'. 'shiftwidth' is only used for shifting text left or
right |shift-left-right|.
What gets inserted (a Tab or spaces) depends on the 'expandtab'
option. Also see |ins-expandtab|. When 'expandtab' is not set, the
number of spaces is minimized by using <Tab>s.
NOTE: This option is reset when 'compatible' is set.

If you'd like to use VIM for Python make sure you have the following
settings for the best result:
http://www.vex.net/~x/python_and_vim.html

Marco
Sep 24 '07 #2
7stud <bb**********@yahoo.comwrites:
Alternatively, what is a smarttab?
(Marco has already shown that you can read the Vim help for this
topic, so I won't repeat that.)

There's no such thing as "a smarttab", and that's not what the option
means. It's the name of an option that enables or disables a certain
behaviour. You can think if it, rather, as "smart handling of the
<Tabkey".

--
\ Rommel: "Don't move, or I'll turn the key on this can of Spam!" |
`\ -- The Goon Show, _Rommel's Treasure_ |
_o__) |
Ben Finney
Sep 25 '07 #3
On Sep 24, 4:49 am, Marco <ma...@yafd.dewrote:
>
Alternatively, what is a smarttab?

in VIM type :help smarttab and you'll see the following:
Thanks! I spent an hour hunting around on google with no success. :(

Another question if you don't mind. I'm using vim 6.2, and I am
trying to setup vim to use different tab sizes based on different file
types. I've searched around, and as far as I can tell, this should
work:

filetype indent on

Somehow that is supposed to let vim decide what type of file is being
edited. But, it doesn't work for me. Is there a list of file types
vim can recognize? This is what my ~/.vimrc file looks like:

"python settings:
set tabstop=4 "4 space tab
set shiftwidth=4 "The amount to block indent when using <
and >
set smarttab "Uses shiftwidth instead of tabstop at
start of lines
set expandtab "Replaces a <TABwith spaces--more
portable
set softtabstop=4 "Causes backspace to delete 4 spaces =
converted <TAB>

"general settings:
filetype indent on "new in vim 6.0+; file type specific
indenting
set nu "line numbers on (set nonu)
syntax on "turns on syntax highlighting
Sep 25 '07 #4
7stud <bb**********@yahoo.comwrites:
Thanks! I spent an hour hunting around on google with no
success. :(

Another question if you don't mind
Rather than have comp.lang.python turn into a support forum for
questions about specific editors, I'll point you to the Vim site:

<URL:http://www.vim.org/>

which has many resources for assistance:

<URL:http://www.vim.org/community.php>

--
\ "True greatness is measured by how much freedom you give to |
`\ others, not by how much you can coerce others to do what you |
_o__) want." --Larry Wall |
Ben Finney
Sep 25 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

220 posts views Thread by Brandon J. Van Every | last post: by
699 posts views Thread by mike420 | last post: by
92 posts views Thread by Reed L. O'Brien | last post: by
137 posts views Thread by Philippe C. Martin | last post: by
12 posts views Thread by Dario | last post: by
47 posts views Thread by Neal | last post: by
86 posts views Thread by Michael Kalina | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.