Sunday, August 16, 2015

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

On 2015年08月16日 16時54分, Nikolay Pavlov wrote:
>2015-08-16 16:23 GMT+03:00 Bram Moolenaar <Bram@moolenaar.net>:
>> Note that most people recommend using a tabstop of 8 in Python files, or
>> no tabs at all. Doing otherwise is likely to get you in trouble some
>> day.
>
>I used &tabstop=4 in powerline with noexpandtab for years. No
>troubles. Just don't try to mix tabs and spaces, in case you do note
>that Python thinks that 1 tab is 8 spaces. If all indentation is
>consistent there will be no troubles.

I concur. Mixing tabs and spaces is what gets people into trouble, not the number of space characters a tab represents. With regards to Python, I keep the following in $HOME/.vim/after/ftplugin/python.vim:

setlocal noexpandtab shiftwidth=4 softtabstop=0 tabstop=4

--
--
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:

Post a Comment