473,225 Members | 1,405 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,225 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 12093
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: thecrow | last post by:
Alright, what the hell is going on here? In the following code, I expect the printed result to be: DEBUG: frank's last name is burns. Instead, what I get is: DEBUG: frank's last name is...
220
by: Brandon J. Van Every | last post by:
What's better about Ruby than Python? I'm sure there's something. What is it? This is not a troll. I'm language shopping and I want people's answers. I don't know beans about Ruby or have...
699
by: mike420 | last post by:
I think everyone who used Python will agree that its syntax is the best thing going for it. It is very readable and easy for everyone to learn. But, Python does not a have very good macro...
92
by: Reed L. O'Brien | last post by:
I see rotor was removed for 2.4 and the docs say use an AES module provided separately... Is there a standard module that works alike or an AES module that works alike but with better encryption?...
137
by: Philippe C. Martin | last post by:
I apologize in advance for launching this post but I might get enlightment somehow (PS: I am _very_ agnostic ;-). - 1) I do not consider my intelligence/education above average - 2) I am very...
12
by: Dario | last post by:
The following simple program behaves differently in Windows and Linux . #include <stdexcept> #include <iostream> #include <string> using namespace std; class LogicError : public logic_error {...
125
by: Sarah Tanembaum | last post by:
Beside its an opensource and supported by community, what's the fundamental differences between PostgreSQL and those high-price commercial database (and some are bloated such as Oracle) from...
47
by: Neal | last post by:
Patrick Griffiths weighs in on the CSS vs table layout debate in his blog entry "Tables my ass" - http://www.htmldog.com/ptg/archives/000049.php . A quite good article.
86
by: Michael Kalina | last post by:
Because when I asked for comments on my site-design (Remember? My site, your opinion!) some of you told me never to change anything on font-sizes! What do you guys think of that:...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...

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.