首页 > 其他分享 >【vim常用设置】缩进设置

【vim常用设置】缩进设置

时间:2022-12-09 23:33:11浏览次数:26  
标签:缩进 set 设置 filetype Use vim width tab

打开 ~/.vimrc 文件

把下面的内容复制进去即可

" Only do this part when compiled with support for autocommands.
if has("autocmd")
    " Use filetype detection and file-based automatic indenting.
    filetype plugin indent on

    " Use actual tab chars in Makefiles.
    autocmd FileType make set tabstop=8 shiftwidth=8 softtabstop=0 noexpandtab
endif

" For everything else, use a tab width of 4 space chars.
set tabstop=4       " The width of a TAB is set to 4.
                    " Still it is a \t. It is just that
                    " Vim will interpret it to be having
                    " a width of 4.
set shiftwidth=4    " Indents will have a width of 4.
set softtabstop=4   " Sets the number of columns for a TAB.
set expandtab       " Expand TABs to spaces.

标签:缩进,set,设置,filetype,Use,vim,width,tab
From: https://www.cnblogs.com/studentWangqy/p/16970542.html

相关文章

  • vscode 的vim配置和快捷键配置
    keybinds.json//Placeyourkeybindingsinthisfiletooverridethedefaultsauto[][//以前配置的上下左右移动按键{"key":"alt+j","command":"......
  • 设置鼠标连接电脑时,触摸板不可用
    https://zhidao.baidu.com/question/541039818.htmla.点选[开始](1),并点击[设置](2)。b.点选[设备](3)。c.点选[触摸板](4),取消勾选连接鼠标时让触摸板保持打开状......
  • core文件设置
    core文件设置1.取消大小限制;vi/etc/profileulimit-cunlimited2.添加进程名vi/proc/sys/kernel/core_pattern添加下面的内容:core.%p_%esysctl-wkernel.core_use......
  • android webview设置自适应任意大小的pc网页
    1.Android:WebView如何设定支持缩放:需要对WebView和WebSettings做一下设定2.WebSettingswebSettings=view.getSettings();3.webSettings.setJavaScriptEnabled(......
  • #yyds干货盘点# 歌谣学前端之react笔记之学习日历样式的设置
    前言我是歌谣我有个兄弟巅峰的时候排名c站总榜19叫前端小歌谣曾经我花了三年的时间创作了他现在我要用五年的时间超越他今天又是接近兄弟的一天人生难免坎坷大不了从......
  • 设置UIView的图片
    //自定义的UIViewBackView*backView=[[BackViewalloc]initWithFrame:CGRectMake(SCREEN_HEIGHT-130,50,91,34)];//把图片转为颜色UIColor*bgColor=[UIColorcolorWi......
  • leaflet 设置图层优先级
    Leaflet在添加了区域、点位等图层之后,需要设置图层的优先级,可以通过pane来设置。this.map.createPane('tlop')this.map.getPane('tlop').style.zIndex=500letmark......
  • div盒子的居中设置
    1.div盒子有宽度的.login-box{width:555px;height:423px;position:absolute;top:0;left:0;right:0;bottom:0;margin......
  • 合并报表软件FineReport中如何设置工具栏控制
    不同用户角色登录系统时查看同一张模板所看到工具栏按钮不同,比如说技术支持部长角色登录系统时,查看一张模板,看不到工具栏上的导出和打印按钮,技术支持总调度角色却可以,下面......
  • Apache设置禁止访问文件/目录/IP
    起因系统漏洞扫描,读到了系统配置文件中的加密密码,加密算法比较简单,被解密了出来。本文将详细介绍如何操作禁止直接访问apache网站文件或目录。我的apache2配置文件目录:/......