首页 > 编程 > Python > 正文

python tab.py

2019-11-06 06:02:59
字体:
来源:转载
供稿:网友

Python环境中能使用tab键

[root@localhost ~]# cat /usr/lib/python2.7/startup.py #!/usr/bin/pythonimport rlcompleterimport readlineimport atexitimport os# http://stackoverflow.com/questions/7116038/python-tab-completion-mac-osx-10-7-lionif'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:	passatexit.register(readline.write_history_file, histfile)del readline, rlcompleter, histfile, os

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

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


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表