vi set the tab width for python
Put your desired settings in the ~/.vimrc file -- See below for some guidelines and best practices.
There are four main ways to use tabs in Vim:
Always keep 'tabstop' at 8, set 'softtabstop' and 'shiftwidth' to 4 (or 3 or whatever you prefer) and use 'noexpandtab'. Then Vim will use a mix of tabs and spaces, but typing and will behave like a tab appears every 4 (or 3) characters.
Note: Setting 'tabstop' to any other value than 8 can make your file appear wrong in many places (e.g., when printing it).
Set 'tabstop' and 'shiftwidth' to whatever you prefer and use 'expandtab'. This way you will always insert spaces. The formatting will never be messed up when 'tabstop' is changed.
Set 'tabstop' and 'shiftwidth' to whatever you prefer and use a |modeline| to set these values when editing the file again. Only works when using Vim to edit the file.
Always set 'tabstop' and 'shiftwidth' to the same value, and 'noexpandtab'. This should then work (for initial indents only) for any tabstop setting that people use. It might be nice to have tabs after the first non-blank inserted as spaces if you do this though. Otherwise aligned comments will be wrong when 'tabstop' ischanged.
set tabstop=4
set shiftwidth=4
set noexpandtab
setsmarttabset softtabstop=4
vi set the tab width for python的更多相关文章
- 如何在vi中设置tab的长度
在使用vi写python时(其实,不管用什么写python程序时,都要注意),首先要将Tab键的长度设为4,因为使用python编程时,我们是通过缩进来实现作用域的,所以要统一Tab键的长度.具体方法 ...
- VI/VIM修改Tab为4个空格
配置方法 在当前用户目录下创建或修改~/.vimrc Root用户下修改/etc/virc 和 /etc/vimrc set ts= set softtabstop= set expandtab se ...
- Linux系统下设置vi编辑器,tab键为4
1.cd ~ 2.vi .exrc 3.set tabstop=4(保存并退出)即可
- vi/vim下tab的长度修改
默认下的长度是8,如果要想修改可以在根目录下新建'.vimrc'文件 里面的内容是: [root@localhost 09:06 ~]# cat .vimrc set tabstop=4 set sh ...
- python 添加tab补全
在平时查看Python方法用到tab补全还是很方便的. 1. mac 平台 配置如下: mac是类Unix平台,需要在添加一条配置内容到bash_profile 中(默认是没有这个文件,可以新建一个放 ...
- vi/vim tab键空格数修改
更改Tap键单位 vi/vim编辑器默认情况下,每按一次Tap相对于8个空格. (1)临时性更改 使用vi打开文件后,输入如下命令: :set tabstop=4 命令释义:更改为相当于四个空格. ( ...
- Windows 下python的tab自动补全
方法一:安装一个ipython就OK啦,而且关键字还能高亮显示呢 一.打开cmd,输入pip3 install ipython联网安装 二.安装成功后,cmd里运行ipython,成功啦. 方法二:写 ...
- 巨蟒python全栈开发-第11阶段 ansible_project3
今日大纲: 1.用户创建 2.前端优化 3.用户编辑 4.用户删除 5.ansible api介绍 1.用户创建 新建一个user_create.html的页面 <form class=&quo ...
- 翻译:打造基于Sublime Text 3的全能python开发环境
原文地址:https://realpython.com/blog/python/setting-up-sublime-text-3-for-full-stack-python-development/ ...
随机推荐
- oracle 迁移数据文件
步骤: 1.SQL>SELECT FILE_NAME FROM DBA_DATA_FILES; FILE_NAME --------------------------------------- ...
- 【MM系列】SAP 关于物料间的替代问题
公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[MM系列]SAP 关于物料间的替代问题 前 ...
- 获取fork+exec启动的程序的PID值
问题背景 业务中有个场景需要自动起一个A程序(由于A程序与 sublime_text 启动后遇到的问题有相似之处,后文就用 sublime_text 来替代A程序,当A程序与 sublime_ ...
- VM CentOS建立共享文件夹实现VS Code在windows环境下go开发,在centos环境里编译
简介 笔记本没办法更换系统,但是开发又必须在linux环境下进行,直接在vm界面环境下开发,卡的都蒙13.无奈之下想到这个法子,来解决现有尴尬的局面>>> 共分3个部分安装: (1) ...
- 在laravel框架中使用mq
本文写于2018-11-28 1.部署laravel项目 https://github.com/laravel/laravel 通过git克隆项目,或者下载zip包然后解压等方式都可以把larave ...
- Javascript原型介绍
原型及原型链 原型基础概念 function Person () { this.name = 'John'; } var person = new Person(); Person.prototype ...
- IWorkspaceFactory pWorkspaceFactory = new ShapefileWorkspaceFactoryClass(); 时,报COMException
解决办法: 在Program.cs的Main函数中添加如下代码: ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.Desktop);
- JS全选的操作
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- nginx配置反向代理,解决前端开发的跨域问题
适用:开发和生产环境 配置如下 server { listen 10901; server_name res.pre.ices.red; #charset koi8-r; #access_log lo ...
- SSM框架返回json数据
常见错误:No converter found for return value of type: class .................. 原因分析:这是因为springmvc默认是没有对象 ...