返回> 网站首页 

linux vi关键字颜色

yoours2022-07-16 16:30:58 阅读 1326

简介一边听听音乐,一边写写文章。

1. vim安装

apt-get install vim


2. vi调用vim

修改/etc/bash.bashrc 在最后加入 alias vi=vim


3. /etc/vim/vimrc添加

if &t_Co>2 || has("gui_running")

syntax on "语法高亮显示

filetype indent on "文件自动缩进

set showcmd "Show (partial) command in status line.

set showmatch "Show matching brackets.

set incsearch "Incremental search

set mouse=a "Enable mouse usage (all modes) in terminals

set syn=cpp "语法高亮

set nu! "显示行号

set hlsearch

set nobackup "不产生备份文件

set ruler "在编辑过程中,在右下角显示光标位置的状态行

"colorscheme evening "设置配色方案 --- 不使用该配色方案

set autoindent "使用自动对其,也就是把当前行的对其格式应用到下一行

set smartindent "依据上面的对其格式,智能的选择对其方式

set tabstop=4 "设置tab键为4个空格

set shiftwidth=4 "设置当前行之间交错时使用4个空格

set enc=utf-8 "设置编码

set fenc=utf-8 "设置文件编码

set fencs=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936 "设置文件编码检测类型及支持格式

set langmenu=zh_CN.UTF-8 "指定菜单语言

set helplang=cn "中文帮助

endif


微信小程序扫码登陆

文章评论

1326人参与,0条评论