VIM&GVIM常规配置

VIM

用户目录下新建.vimrc

set mouse=a                      "支持鼠标定位
set enc=utf-8                    "设置编码格式
set nu                           "左侧行号
set tabstop=4                    "tab 长度设置为 4
set nobackup                     "覆盖文件时不备份
set cursorline                   "突出显示当前行
set ruler                        "在右下角显示光标位置的状态行
set autoindent                   "自动缩进
et nocompatible                  "关闭vi兼容  
set history=500                  "历史命令  
syntax on                        "语法高亮  
set smartindent                  "智能缩进  
set showmatch                    "括号匹配  
set incsearch                    "设置快速搜索  
set foldenable                   "开启代码折叠  
filetype plugin on               "文件关联
filetype indent on               "根据文件类型缩进

GVIM

set mouse=a                           "支持鼠标定位
set enc=utf-8                         "设置编码格式
set fileencodings=utf-8,chinese,latin-1
if has("win32")
    set fileencoding=chinese
else
    set fileencoding=utf-8
endif
"解决console输出乱码
language messages zh_CN.utf-8
"指定菜单语言
set langmenu=zh_CN.utf-8
source $VIMRUNTIME/delmenu.vim
source $VIMRUNTIME/menu.vim
set nu                                "左侧行号
set tabstop=4                         "tab 长度设置为 4
set nobackup                          "覆盖文件时不备份
set ruler                             "在右下角显示光标位置的状态行
set autoindent                        "自动缩进
set nocompatible                      "关闭vi兼容  
set history=500                       "历史命令  
syntax on                             "语法高亮  
set smartindent                       "智能缩进  
set showmatch                         "括号匹配  
set incsearch                         "设置快速搜索  
set foldenable                        "开启代码折叠  
filetype plugin on                    "文件关联
filetype indent on                    "根据文件类型缩进
set guifont=Consolas:h16
"去掉临时文件
set noundofile
set nobackup
set noswapfile
colorscheme desert                    "主题
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容