python tab.py

Python环境中能使用tab键

[root@localhost ~]# cat /usr/lib/python2.7/startup.py 
#!/usr/bin/python
import rlcompleter
import readline
import atexit
import os
# http://stackoverflow.com/questions/7116038/python-tab-completion-mac-osx-10-7-lion
if'libedit'in readline.__doc__:
	readline.parse_and_bind('bind ^I rl_complete')
else:
	readline.parse_and_bind('tab: complete')
histfile = os.path.join(os.environ['HOME'],'.pyhist')
try:
	readline.read_history_file(histfile)
except IOError:
	pass
atexit.register(readline.write_history_file, histfile)
del readline, rlcompleter, histfile, os

2、Python脚本一般都是用tab键来缩进的,但是默认的tab键太长,是8位,最好是改成4位:

修改~/.vimrc文件,加入:
set ts=4



阅读更多
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/szh1124/article/details/60768652
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭