Saturday, August 15, 2015

Re: How to make pressing TAB key enter a single TAB character in a .py file?

On Saturday, August 15, 2015 at 5:36:44 PM UTC-5, ZyX wrote:
> 2015-08-16 1:27 GMT+03:00 Peng Yu <pengyu.ut@gmail.com>:
> > Hi,
> >
> > I have the following modline in a .py file. When I type TAB, two TAB
> > characters are entered into the file. How only let one TAB characters
> > entered? Thanks.
> >
> > # vim: set noexpandtab tabstop=2:

It seems that shiftwidth is not the problem, as I tried the following modline yet a TAB key still is two TAB characters. Could you try it and let me know what is the correct modline? Thanks.

# vim: set noexpandtab tabstop=2 shiftwidth=2:

> Default shiftwidth for Python files is 4 (which is &tabstop * 2 with
> your settings, so two tabs). You need to set &shiftwidth option as
> well.
>
> >
> > --
> > Regards,
> > Peng
> >
> > --
> > --
> > You received this message from the "vim_use" maillist.
> > Do not top-post! Type your reply below the text you are replying to.
> > For more information, visit http://www.vim.org/maillist.php
> >
> > ---
> > You received this message because you are subscribed to the Google Groups "vim_use" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: