0011 vim插件的安装

为了使用pathogen插件,我把.vim文件夹和.vimrc添加的配置删除,重新整理了下!

1、pathogen 插件管理
https://github.com/tpope/vim-pathogen
运行如下命令
mkdir -p ~/.vim/autoload ~/.vim/bundle
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
在.vimrc中添加
" pathogen
execute pathogen#infect()

2、nerdtree 文件浏览器
https://github.com/scrooloose/nerdtree
运行如下命令
cd ~/.vim/bundle
git clone https://github.com/scrooloose/nerdtree.git
在.vimrc中添加
" NERDTree
map <silent> <F3> :NERDTreeToggle<CR>			" 映射F3打开关闭NERDTree

3、xptemplate 代码片段自动补全
https://github.com/drmingdrmer/xptemplate
运行如下命令
cd ~/.vim/bundle
git clone https://github.com/drmingdrmer/xptemplate.git
在.vimrc中添加
" xptemplate
let g:xptemplate_vars = "SParg=&BRfun="			" 代码紧贴括号,函数名单行
let g:xptemplate_brace_complete = "([{\""		" 括号引号自动补全	

4、emmet-vim 快速编写html和css代码
https://github.com/mattn/emmet-vim/
运行如下命令
cd ~/.vim/bundle
git clone https://github.com/mattn/emmet-vim.git

5、nerdcommenter 为代码段添加注释
https://github.com/scrooloose/nerdcommenter
运行如下命令
cd ~/.vim/bundle
git clone https://github.com/scrooloose/nerdcommenter.git
在.vimrc中添加
" NERDcommenter
let NERDSpaceDelims = 1							" 注释左右两端留空格
let NERDRemoveExtraSpaces = 1

6、supertab 映射ctrl+x ctrl+o用
https://github.com/ervandew/supertab
运行如下命令
cd ~/.vim/bundle
git clone https://github.com/ervandew/supertab.git
在.vimrc中添加
" supertab
let g:SuperTabDefaultCompletionType = "<C-X><C-O>"
inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<CR>" 		" 回车即选中当前项

7、taglist 显示代码结构
http://www.vim.org/scripts/script.php?script_id=273
到上面网站下载taglist,在.vim/bundle文件夹下为该插件创建文件夹,然后将其解压到创建的新文件夹中即可。
在.vimrc中添加
" Taglist
map <silent> <F4> :TlistToggle<CR>				" 映射F4打开关闭Taglist

8、更新帮助文档
插件安装完后可打开vim运行
:Helptags
命令即可更新各插件的帮助文档

9、备份我当前的.vimrc配置

" An example for a vimrc file.
"
" Maintainer:	Bram Moolenaar <[email protected]>
" Last change:	2014 Feb 05
"
" To use it, copy it to
"     for Unix and OS/2:  ~/.vimrc
"	      for Amiga:  s:.vimrc
"  for MS-DOS and Win32:  $VIM\_vimrc
"	    for OpenVMS:  sys$login:.vimrc

" When started as "evim", evim.vim will already have done these settings.
if v:progname =~? "evim"
	finish
endif

" Use Vim settings, rather than Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible

" allow backspacing over everything in insert mode
set backspace=indent,eol,start

if has("vms")
	set nobackup		" do not keep a backup file, use versions instead
else
	set backup		" keep a backup file (restore to previous version)
	set undofile		" keep an undo file (undo changes after closing)
endif
set history=50		" keep 50 lines of command line history
set ruler		" show the cursor position all the time
set showcmd		" display incomplete commands
set incsearch		" do incremental searching

" For Win32 GUI: remove 't' flag from 'guioptions': no tearoff menu entries
" let &guioptions = substitute(&guioptions, "t", "", "g")

" Don't use Ex mode, use Q for formatting
map Q gq

" CTRL-U in insert mode deletes a lot.  Use CTRL-G u to first break undo,
" so that you can undo CTRL-U after inserting a line break.
inoremap <C-U> <C-G>u<C-U>

" In many terminal emulators the mouse works just fine, thus enable it.
if has('mouse')
	set mouse=a
endif

" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if &t_Co > 2 || has("gui_running")
	syntax on
	set hlsearch
endif

" Only do this part when compiled with support for autocommands.
if has("autocmd")

	" Enable file type detection.
	" Use the default filetype settings, so that mail gets 'tw' set to 72,
	" 'cindent' is on in C files, etc.
	" Also load indent files, to automatically do language-dependent indenting.
	filetype plugin indent on

	" Put these in an autocmd group, so that we can delete them easily.
	augroup vimrcEx
		au!

		" For all text files set 'textwidth' to 78 characters.
		autocmd FileType text setlocal textwidth=78

		" When editing a file, always jump to the last known cursor position.
		" Don't do it when the position is invalid or when inside an event handler
		" (happens when dropping a file on gvim).
		" Also don't do it when the mark is in the first line, that is the default
		" position when opening a file.
		autocmd BufReadPost *
					\ if line("'\"") > 1 && line("'\"") <= line("$") |
					\   exe "normal! g`\"" |
					\ endif

	augroup END

else

	set autoindent		" always set autoindenting on

endif " has("autocmd")

" Convenient command to see the difference between the current buffer and the
" file it was loaded from, thus the changes you made.
" Only define it when not defined already.
if !exists(":DiffOrig")
	command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis
				\ | wincmd p | diffthis
endif

" 一些杂项
set number
set tabstop=4
set shiftwidth=4
set autoindent
set cindent
set hlsearch
set backspace=2
set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936
set termencoding=utf-8
set encoding=utf-8
set timeout timeoutlen=3000 ttimeoutlen=100		"可提高输入O插入行的速度
" set cursorline									" 光标下划线

" 默认标记折叠方式
set fdm=marker		

" Ctags set
filetype plugin indent on
set completeopt=longest,menu 

" pathogen
execute pathogen#infect()

" NERDTree
map <silent> <F3> :NERDTreeToggle<CR>			" 映射F3打开关闭NERDTree

" Taglist
map <silent> <F4> :TlistToggle<CR>				" 映射F4打开关闭Taglist

" xptemplate
let g:xptemplate_vars = "SParg=&BRfun="			" 代码紧贴括号,函数名单行
let g:xptemplate_brace_complete = "([{\""		" 括号引号自动补全	

" NERDcommenter
let NERDSpaceDelims = 1							" 注释左右两端留空格
let NERDRemoveExtraSpaces = 1

" Backup
set nobackup
set undodir=~/.vim/undodir

" html indent
" let g:html_indent_script1 = "inc"
" let g:html_indent_style1 = "inc"
let g:html_indent_inctags = "body,head,tbody" 	" 缩进body head s

" supertab
let g:SuperTabDefaultCompletionType = "<C-X><C-O>"
inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<CR>" 		" 回车即选中当前项

" support html css and javascrip auto complete
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS

时间: 2024-10-14 20:58:44

0011 vim插件的安装的相关文章

vim插件详细安装过程

1 写在前面   Linux下编程一直被诟病的一点是: 没有一个好用的IDE, 但是听说Linux牛人, 黑客之类的也都不用IDE. 但是对我等从Windows平台转移过来的Coder来说, 一个好用的IDE是何等的重要啊, 估计很多人就是卡在这个门槛上了, "工欲善其事, 必先利其器"嘛, 我想如果有一个很好用的IDE, 那些Linux牛人也会欢迎的. 这都是劳动人民的美好愿望罢了, 我今天教大家把gvim改装成一个简易IDE, 说它"简易"是界面上看起来&quo

常用vim插件的安装、使用和管理

  1.Ctags Ctags工具是用来遍历源代码文件生成tags文件,这些tags文件能被编辑器或者其他工具用来快速查找定位源代码中的符号,入变量名,函数名等.比如,tags文件就是Taglist和OmniCppComplete工作的基础. 安装过程: (1)打开链接:www.vim.org/scripts/script.php?script_id=610,下载完成后进去下载文件夹. (2)在下载文件夹下通过命令unzip ctags.vim命令解压下载的stags压缩文件,然后通过命令sud

vim插件command-t安装

vim插件command-t应用频率很高,网上介绍的文章也很多,这篇博文主要记录一下安装需要注意的细节问题.vim插件管理器使用vundle. command-t依赖的linux组件主要有gcc.ruby.ruby-devel.任何一个没有安装都会报错.在安装之前最好检查一下.centos主要用命令rpm -qa|grep命令,比如rpm -qa|grep gcc 具体安装步骤 安装vundle.vundle的安装步骤详见https://github.com/gmarik/Vundle.vim.

vim插件phpcheck安装与使用 -- 高效的检查php语法错误

1 简介 在PHP文件保存时会自动进行语法检查,有错误会提示,没有错误不提示.*语法检查使用系统的php -l -n命令:*对非PHP文件不起作用: 2 下载(v1.1版本) http://www.vim.org/scripts/script.php?script_id=4984 3 安装 # whereis vim 上传插件(phpcheck.vim) 到 plugin目录 # cd /usr/share/vim/vim74/plugin/ # rz -y 4 使用 test10.php <?

vim插件bufexplorer安装与使用

1 简介 使用bufexplorer插件可以打开历史文件列表以达到快速切换文件的目的 2 下载 http://www.vim.org/scripts/script.php?script_id=42 3 安装 # mkdir -p /usr/local/src/vim/plugin/bufexplorer (上传bufexplorer-7.4.9.zip到/usr/local/src/vim/plugin/bufexplorer) # unzip bufexplorer-7.4.9.zip 拷贝插

VIM插件安装

系统信息: # cat /etc/redhat-release CentOS Linux release 7.2.1511 (Core) # uname -a Linux localhost.localdomain 3.10.0-327.22.2.el7.x86_64 #1 SMP Thu Jun 23 17:05:11 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux # cat /proc/version Linux version 3.10.0-327.22.

Vim升华之树形目录插件NERDTree安装图解

Vim升华之树形目录插件NERDTree安装图解 无意中看到实验室的朋友使用的vim竟然能在左边显示树形目录,感觉很方便,这样子文件夹有什么文件一目了然.她说是一个插件叫NERDTree,安装执行后的效果如下,不是你想要的效果就别安了.我的系统是Ubuntu12.04,版本不同可能 .vim 所在的目录不同.本节用到的压缩包已经上传到网站,如有需要,请自行下载. 免费下载地址在 http://linux.linuxidc.com/ 用户名与密码都是www.linuxidc.com 具体下载目录在

ubuntu 12.04 下 Vim 插件 YouCompleteMe 的安装

作者:jostree 转载请注明出处 http://www.cnblogs.com/jostree/p/4137402.html 1.需要保证vim的版本大于7.3.584,否则的话需要更新vim 可以通过第三方源更新: 在终端输入下面的代码: $ sudo add-apt-repository ppa:fcwu-tw/ppa $ sudo apt-get update $ sudo apt-get install vim 升级得到vim7.4 2.需要有clang3.2以上的库 可以再此处下载

vimball,帮你安装vba格式的vim插件

<p>vimball是一个vim插件,可以很方便地帮你安装vba格式的插件.</p><p>首先安装vimball,下载后解压到与gvim.exe相同的目录下面,貌似vim自带有vimball,这样安装可以覆盖掉自带的旧版本.</p><p>安装完毕后,直接用vim打开vba格式的文件,输入:so %即可安装,然后:q退出.</p><p>删除插件也很方便,直接在vim里输入:RmVimball 插件名</p> vi