加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

如何正确设置VIM自动缩进编辑Python文件 – * .py

发布时间:2020-12-15 16:36:45 所属栏目:安全 来源:网络整理
导读:我有麻烦设置VIM(7.1.xxx)编辑python文件。 缩进似乎被打破(最佳4个空格)。 我遵循了我通过Google找到的一些教程。仍然没有效果:/ 请帮忙。 我在我的macbook上使用这个: " configure expanding of tabs for various file typesau BufRead,BufNewFile *.py
我有麻烦设置VIM(7.1.xxx)编辑python文件。
缩进似乎被打破(最佳4个空格)。
我遵循了我通过Google找到的一些教程。仍然没有效果:/
请帮忙。
我在我的macbook上使用这个:
" configure expanding of tabs for various file types
au BufRead,BufNewFile *.py set expandtab
au BufRead,BufNewFile *.c set noexpandtab
au BufRead,BufNewFile *.h set noexpandtab
au BufRead,BufNewFile Makefile* set noexpandtab

" --------------------------------------------------------------------------------
" configure editor with tabs and nice stuff...
" --------------------------------------------------------------------------------
set expandtab           " enter spaces when tab is pressed
set textwidth=120       " break lines when line length increases
set tabstop=4           " use 4 spaces to represent tab
set softtabstop=4
set shiftwidth=4        " number of spaces to use for auto indent
set autoindent          " copy indent from current line when starting a new line

" make backspaces more powerfull
set backspace=indent,eol,start

set ruler                           " show line and column number
syntax on               " syntax highlighting
set showcmd             " show (partial) command in status line

(编辑只显示与缩进/制表符相关的东西)

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读