emacs python 缩进问题_在emacs 23中将python缩进设置为2个空格?

我在Ubuntu 10.04上使用emacs 23.1.1。我希望在Python中编写一个2空格的缩进。 emacs看起来有一个默认的模式为python(python.el?)。

我把以下内容放在我的.emacs中:

;; Only spaces, no tabs

(setq indent-tabs-mode nil)

;; Always end a file with a newline

(setq require-final-newline nil)

;; Don't know which of these might work

(setq-default tab-width 2)

(setq-default python-indent 2)

(setq-default py-indent-offset 2)

当我编辑一个Python文件时,它使用一个4空格缩进。当我尝试C-h v python-indent它说:

python-indent's value is 4

Local in buffer webpage_cache.py; global value is 2

This variable is safe as a file local variable if its value

satisfies the predicate `integerp'.

Documentation:

Number of columns for a unit of indentation in Python mode.

See also `M-x python-guess-indent'

You can customize this variable.

那就是4,不是2。我尝试自定义变量和保存,仍然4.我尝试自定义组缩进,仍然4。

如何让emacs得到注意?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值