gvim最全的配置和插件
时间: 2023-09-20 22:08:21 浏览: 78
gvim是Vim编辑器的图形界面版本,可以像其它图形界面的文本编辑器一样使用鼠标操作。下面是gvim的最全配置和插件:
## 基本配置
```vim
set encoding=utf-8 " 设置编码为UTF-8
set fileencodings=utf-8,gb2312,gbk,gb18030,big5 " 设置文件编码
set fileformats=unix,dos,mac " 设置文件格式
set tabstop=4 " 设置制表符宽度为4个空格
set shiftwidth=4 " 设置缩进宽度为4个空格
set expandtab " 将制表符自动转换为空格
set smartindent " 智能缩进
set number " 显示行号
set cursorline " 高亮当前行
set hlsearch " 高亮搜索结果
set incsearch " 实时搜索
set showmatch " 高亮匹配的括号
set noswapfile " 不生成交换文件
set backup " 生成备份文件
set undofile " 生成撤销文件
set autochdir " 自动切换工作目录
```
## 插件管理
可以使用Vim插件管理工具Vundle或者Pathogen进行插件管理,这里以Vundle为例:
```vim
" 安装Vundle插件管理器
if !filereadable(expand('~/.vim/bundle/Vundle.vim/autoload.vim'))
echo "Installing Vundle"
silent !mkdir -p ~/.vim/bundle
silent !git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
endif
" 设置插件目录
set rtp+=~/.vim/bundle/Vundle.vim
" 插件列表
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'scrooloose/nerdtree'
Plugin 'altercation/vim-colors-solarized'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'jiangmiao/auto-pairs'
call vundle#end()
```
## 插件列表
以下是gvim常用的插件列表:
1. [Vundle](https://github.com/VundleVim/Vundle.vim):插件管理器
2. [vim-fugitive](https://github.com/tpope/vim-fugitive):Git插件
3. [nerdtree](https://github.com/scrooloose/nerdtree):文件浏览器插件
4. [vim-colors-solarized](https://github.com/altercation/vim-colors-solarized):主题插件
5. [ctrlp.vim](https://github.com/ctrlpvim/ctrlp.vim):快速文件搜索插件
6. [auto-pairs](https://github.com/jiangmiao/auto-pairs):自动补全括号插件
以上是gvim最全的配置和插件,你可以根据自己的需求进行配置。
相关推荐
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)