vim使用介绍
照着配置了许多,也参考了许多,但是始终没有找到一个好的方法,用起来不太爽
基础的操作方法这里就不写了。网上很多。
基础的配置命令解释
‘’’
"搜索忽略大小写
set ignorecase
"搜索逐字符高亮
set hlsearch
set incsearch
"设置字体
set guifont=Consolas:h12:cANSI
"设置搜索高亮 ,取消请使用set nohlsearch
set hlsearch
" 关闭 .swp 文件
set noswapfile
" 显示行号;取消显示可输入 set nonu
set number
" 突出显示当前行
set cursorline
"去掉讨厌的有关 vim 一致性模式,避免以前版本的一些 bug 和局限.
set nocompatible
"否则无法使用退格键
set backspace=indent,eol,start
"开启语法高亮
syntax on
"设置命令历史记录为10条.
set history=100
"设置替换 tab 键 [缩进]
set expandtab
"设置 tab 键为4个空格.
set tabstop=4
set softtabstop=4
"设置当行之间交错时使用4个空格
set shiftwidth=4
“设置匹配模式,类似当输入一个左括号时会匹配相应的那个右括号
set showmatch
“搜索选项.(比如,键入”/bo”,光标自动找到第一个"bo"所在的位置.)
set noincsearch
"字符集
set fileencodings=ucs-bom,utf-8,chinese,cp936
"依据上面的对起格式,智能的选择对起方式,对于类似C语言编.
"set smartindent
"自动缩进
"set autoindent
"C风格缩进
set cindent
"设置文件类型
" set filetype=php
set filetype=go
"set filetype=html
" 用空格键来开关代码折叠
set foldenable
" 手动折叠代码
" set foldmethod=manual
" 按缩进自动折叠代码
" set foldmethod=indent
" 按语法高亮折叠代码
" set foldmethod=syntax
" 按标记折叠代码
set foldmethod=marker
set autowrite
set autoread
‘’’