vim 代码片段:通过vundle插件管理器安装ultisnips |centos6.5|vim7.2
背景:中午醒来,饭都没吃,突然想到要给vim增加个代码片段的功能,因为昨天使用了gedit的代码片段,感觉不错。为什么不直接使用gedit呢?因为我相信把时间投入到vim是不会错的,精通vim就好了。。。。就这样的一个想法,让我搞到了快5点。 T_T
1 安装vundle
地址在:https://github.com/gmarik/Vundle.vim,不过不需要在这边下载什么,看看文档就好
git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
#没有git的话 yum install git
#这样就安装好了,不骗你
2 配置 .vimrc 在家目录下,没有就创建一个
然后在.vimrc 的第一行加入如下代码,无脑拷贝就好了
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()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here') " let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim' " The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
Plugin 'tpope/vim-fugitive'
" plugin from http://vim-scripts.org/vim/scripts.html
Plugin 'L9'
" Git plugin not hosted on GitHub
Plugin 'git://git.wincent.com/command-t.git'
" git repos on your local machine (i.e. when working on your own plugin)
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/'}
" Avoid a name conflict with L9
Plugin 'user/L9', {'name': 'newL9'} " All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :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
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
要安装插件就在call vundle#begin()和call vundle#end()之间加入插件名称,比如要安装ultisnips,
Plugin 'SirVer/ultisnips' #这个是没有现成的代码片段的,自己怎么配置还没研究,但是可以用别人的,看下一行
Plugin 'honza/vim-snippets' #这个就应有就有了,都在 .vim/vundle/vim-snippets/snippets/下面
#然后配置下面3行,没有的话是用不了代码片段功能的。这个是触发设置
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<c-b>" #可以自行配置,比如我的<c-l>,作用是跳到下一个占位符
let g:UltiSnipsJumpBackwardTrigger="<c-z>" #我的<c-h>,上一个占位符
这样真的就万事具备,只欠第3步,安装插件了
3 打开vim 执行 :PluginInstall (安装插件的意思), 等完成了会提示 done!
4 使用
先创建文件,比如
$ >test.html
然后打开
$ vim test.html
然后输入
form 按下tab键,。。。。。
vim 代码片段:通过vundle插件管理器安装ultisnips |centos6.5|vim7.2的更多相关文章
- Vim Vundle 插件管理器
/********************************************************************** * Vim Vundle 插件管理器 * 说明: * 话 ...
- Vim插件之插件管理器Vundle
Vim插件之插件管理器Vundle 1.介绍下载 相比Sublime.Text2等现代编辑器,Vim缺乏默认的插件管理器,所有插件的文件都散布在~/.vim下的几个文件夹中,配置Vim的过程, 就是在 ...
- vim插件管理器:Vundle的介绍及安装(很全)(转载)
转载自:https://blog.csdn.net/zhangpower1993/article/details/52184581 背景 Vim缺乏默认的插件管理器,所有插件的文件都散布在~/.vim ...
- Vim插件管理器Vundle使用
参考地址:http://www.linuxidc.com/Linux/2012-12/75684.htm Vundle(Vim bundle) 是一个vim的插件管理器. 其Github地址为: ht ...
- 使用Vim-plug作为Vim 插件管理器
ref: https://www.cnblogs.com/jiftle/p/6918157.html - vundle是一款老款的插件管理工具- vim-plug相对较新,特点是支持异步加载,相比vu ...
- vim插件管理器的安装和配置-windows
# vim插件管理器的安装和配置-windows ### 前言------------------------------ vim做一框功能强大的编辑器,扩展功能令人称奇,插件机制非常灵活- 本篇推荐 ...
- Alcatraz插件管理器
下载地址:https://github.com/supermarin/Alcatraz 虽然能用Alcatraz插件管理器进行管理,但它有时有些插件并不是最新版本,特别是在Xcode更新版本时.这里有 ...
- 关于插件管理器Alcatraz
如何安装插件管理器Alcatraz:去github下载一个Alcatraz安装包,然后运行一下. 会弹出 记得选择左边的Load Bundle 退出Xcode 重新运行一下就OK 了. 然后就可以看到 ...
- Confluence 6 关于统一插件管理器
所有的组件通过 统一插件管理器(Universal Plugin Manager)进行管理,这个也被称为 UPM.UPM 可以在几乎所有的 Atlassian 应用中找到,能够提供完整同意的插件安装管 ...
随机推荐
- Documentation & Markdown
Documentation & Markdown markdown to document & document website generator https://github.co ...
- javascript string对象方法replace
最简单的replace用法是: var str = 'aaaaa9876b0000'; str.replace(/a/g,'A'); 有时候我们希望只是在匹配的位置添加特定的字符: var str = ...
- Eclipse的优化方案
General > Startup and Shutdown : 移除所有在启动时加载的插件. General > Editors > Text Editors > Spell ...
- 大数据Hadoop-1
大数据Hadoop学习之搭建hadoop平台(2.2) 关于大数据,一看就懂,一懂就懵. 一.概述 本文介绍如何搭建hadoop分布式集群环境,前面文章已经介绍了如何搭建hadoop单机环境和伪分 ...
- JavaScript 操作选中当前的li元素并给他添加select类
JavaScript 操作选中当前的li元素并给他添加select类.之前都是使用jquery写的,今天使用JavaScript写一个. <!DOCTYPE html> <html ...
- LeetCode--Reverse Linked List(Java)
相似题目: Palindrome Number Valid PalinDrome Reverse Linked List Palindrome Linked List 翻转单链表(要注意的是是否含有头 ...
- redux-saga基本用法
redux-saga是管理redux异步操作的中间件,redux-saga通过创建sagas将所有异步操作逻辑收集在一个地方集中处理. sagas采用Generator函数来yield Effects ...
- git使用笔记(四)远程操作
By francis_hao Nov 19,2016 以一张图说明远程操作,图片来自参考[2] git clone 从远端主机克隆一个版本库,若省略directory则生成一个和远端同名的版本库 ...
- 安卓sdk安装教程
http://blog.csdn.net/love4399/article/details/77164500
- Web自适应
随着移动设备的普及,移动web在前端工程师们的工作中占有越来越重要的位置.移动设备更新速度频繁,手机厂商繁多,导致的问题是每一台机器的屏幕宽度和分辨率不一样.这给我们在编写前端界面时增加了困难,适配问 ...