首先编辑~/.vimrc,把下面的内容保存到该文件中。
set nocompatible
set encoding=utf-8
set fileencodings=utf-8,chinese
set tabstop=4
set cindent shiftwidth=4
set backspace=indent,eol,start
autocmd Filetype c set omnifunc=ccomplete#Complete
autocmd Filetype cpp set omnifunc=cppcomplete#Complete
set incsearch
set number
set display=lastline
set ignorecase
syntax on
set nobackup
set ruler
set showcmd
set smartindent
set hlsearch
set cmdheight=1
set laststatus=2
set shortmess=atI
set formatoptions=tcrqn
set autoindent
一般情况下vim需要配合着ctags才能够发挥出最强大的效果。使用下面的命令安装ctags:
sudo apt-get install exuberant-ctags
本文介绍如何编辑Vim配置文件~/.vimrc以增强编辑体验,包括设置编码、制表符宽度、搜索功能等,并指导如何安装Ctags以提升代码导航能力。
856

被折叠的 条评论
为什么被折叠?



