美文网首页
vim的插件管理器Vundle的使用

vim的插件管理器Vundle的使用

作者: beeworkshop | 来源:发表于2019-06-15 19:15 被阅读0次

地址https://github.com/VundleVim/Vundle.vim

  1. 下载源码:

git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim

  1. 如果~/.vim/bundle目录不存在,则新建目录:

cd ~
mkdir -p .vim/bundle
将下列配置放在.vimrc文件的开头:
注意:" 表示vim配置的注释

set nocompatible              " be iMproved, required
filetype off                  " required
 
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
 
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
 
" All of your Plugins must be added before the following line
call vundle#end()            " required
filetype plugin indent on    " required

如果想下载某个插件,比如自动缩进indentpython.vim插件,需要将Plugin 'vim-scripts/indentpython.vim'置于call vundle#begin()和call vundle#end()之间,保存配置后在vim中执行

:PluginInstall

即可以自动下载indentpython.vim插件了。

  1. bundle可以管理下载几种不同的插件,方式如下:
  • github上的插件
    Plugin 'tpope/vim-fugitive'
  • 来自于http://vim-scripts.org/vim/scripts.html的插件
    Plugin 'L9'
  • 非github上的git插件
    Plugin 'git://git.wincent.com/command-t.git'
  • 本地插件
    Plugin 'file:///home/gmarik/path/to/plugin'
    " The sparkup vim script is in a subdirectory of this repo called vim.
    " Pass the path to set the runtimepath properly.
    " Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
    有旧插件的情况下,下载新的插件并重命名以避免冲突
    Plugin 'ascenator/L9', {'name': 'newL9'}

下载方式除了在vim中运行:PluginInstall外,还可以在命令行中运行:

vim +PluginInstall +qall

其它常用的命令:

:PluginList       - lists configured plugins
:PluginInstall    - installs plugins; append `!` to update or just :PluginUpdate
:PluginSearch foo - searches for foo; append `!` to refresh local cache
:PluginClean      - confirms removal of unused plugins; append `!` to auto-approve removal
  1. 安装插件
  • 缩进指示线

安装:

Plugin 'Yggdroot/indentLine'

开关:

:IndentLinesToggle
默认Tab键是功能切换键
可以定义一个快捷键
map <C-i> :IndentLinesToggle<CR>

注意:
上边的<C-i>表示Ctrl + i,而:IndentLinesToggle表示对应的命令。
<CR>表示回车。

  • 自动格式化工具

地址https://github.com/Yggdroot/indentLine

首先安装autopep8:

$ pip install autopep8

Plugin 'tell-k/vim-autopep8'

可以设置快捷键F8代替:Autopep8:

autocmd FileType python noremap <buffer> <F8> :call Autopep8()<CR>

注意:
:q退出当前窗口
Ctrl + w(两下)可以在窗口间跳动

  • 自动缩进插件
Plugin 'vim-scripts/indentpython.vim'
  • 语法检查
Plugin 'vim-syntastic/syntastic'
  • 配色方案
Plugin 'altercation/vim-colors-solarized'

syntax enable
set background=light 或者 dark
colorscheme solarized
  • 树形目录
Plugin 'scrooloose/nerdtree'

开关树形目录的快捷键:
map <C-n> :NERDTreeToggle<CR>

注意:
上边的<C-n>表示Ctrl + n,而:NERDTreeToggle表示对应的命令。
<CR>表示回车。

  • 自动补全括号和引号等
Plugin 'jiangmiao/auto-pairs'

相关文章

  • Vundle-Vim插件管理器

    Vundle是一个基于Git的Vim插件管理器,使用Vundle可以简化Vim的插件安装过程,不再需要手动去拷贝插...

  • Termux配置使用(三)

    安装vim 提供对于python的支持 vim插件管理 这里使用的插件管理器是vundle安装git 安装插件管理...

  • Vim+Vundle+NERDTree

    vim编辑器下,使用Vundle插件管理器安装NERDTree树形目录插件。操作环境: 1. 安装vim 2. ...

  • vim插件管理

    vundle vundle是vim中很好的插件管理器,安装方法: YouCompleteMe YouComplet...

  • vim的插件管理:Vundle

    简介 Vundle 是 Vim bundle 的简称,是一个 Vim 插件管理器,Vundle的github地址和...

  • 使用Vim插件管理器Vundle

    Vundle的github地址 Vundle是Vim的插件管理器,官方Github地址是:Vundle 安装Vun...

  • vim 插件管理器 Vundle 安装与配置

    安装插件管理器 Vundle 配置 修改~/.vimrc: 使用 安装一个插件 打开vim输入:PluginIns...

  • vim插件相关笔记

    vim插件管理 vim拾遗 q: 显示 vim 命令历史 插件安装 vundle 插件管理器 插件收藏 NERD-...

  • Vim插件管理器Vundle使用

    Vundle Vundle 是vim的插件管理器, 有了Vundle,vim安装和更新包这种事情都变得十分简便。 ...

  • vim插件

    插件管理器 Vundle vim的插件管理器 我自己的配置信息 效果如下

网友评论

      本文标题:vim的插件管理器Vundle的使用

      本文链接:https://www.haomeiwen.com/subject/lsvgfctx.html