SlideShare ist ein Scribd-Unternehmen logo
1 von 26
Downloaden Sie, um offline zu lesen
开始
up down left right 翻页
ESC 纵览
F 全屏
下载 PDF
unleash your Vim
Vim 常用插件分享
Created by 张宇恒 / @zyhack
本次分享的目的
介绍一些常用的 Vim 插件
分享一些使用心得
主推的几个插件
vundle -- 插件管理
airline -- 状态栏插件
ctrlp -- 文件切换插件
neosnippet -- 代码补全插件
syntastic -- 语法检查插件
gitgutter -- git 辅助插件
fugitive -- git 调用插件
vundle
插件的"管家" 把 github 作为插件的"源"
step_1:配置中写需要安装的插件
注释后可以关闭该插件
Bundle
Bundle
Bundle
Bundle
Bundle
Bundle
Bundle
Bundle
Bundle
Bundle
Bundle
Bundle
Bundle
Bundle
Bundle
Bundle
Bundle
Bundle
Bundle
Bundle
Bundle
Bundle
Bundle
Bundle
Bundle
Bundle
Bundle
Bundle
Bundle

'scrooloose/nerdtree'
'altercation/vim-colors-solarized'
'kien/ctrlp.vim'
'terryma/vim-multiple-cursors'
'matchit.zip'
'Lokaltog/vim-powerline'
'bling/vim-airline'
'Lokaltog/vim-easymotion'
'myusuf3/numbers.vim'
'vim-scripts/restore_view.vim'
'airblade/vim-gitgutter'
'scrooloose/syntastic'
'tpope/vim-fugitive'
'scrooloose/nerdcommenter'
'godlygeek/tabular'
'majutsushi/tagbar'
'garbas/vim-snipmate'
'honza/vim-snippets'
'Shougo/neocomplcache'
'Shougo/neosnippet'
'honza/vim-snippets'
'Shougo/neocomplete.vim.git'
'Shougo/neosnippet'
'honza/vim-snippets'
'elzr/vim-json'
'pangloss/vim-javascript'
'amirh/HTML-AutoCloseTag'
'hail2u/vim-css3-syntax'
'tpope/vim-haml'
step_2:执行相应的命令
:BundleInstall
:BundleUpdate
:BundleClean
:BundleList
:BundleSearch

安装 or
:BundleInstall! 安装且升级
升级
清理 or
:BundleClean! 不询问用户直接删除
显示插件清单
在线搜索插件
step_3:等待插件安装、升级、卸载
airline
在状态栏显示有用的信息,如:
当前编辑状态
paste 是否打开
是否只读模式
git 版本信息
属于版本库的文件修改情况
语法检查报错信息
airline

只读

语法错误提示
ctrlp
在 file, buffer, mru 中模糊查询文件
可以认为是 Vim 的 finder(mac 系统工具)
使用方法
ctrl + p
ctrl + f
ctrl + c

打开 ctrlp 插件
在已打开的 ctrlp 插件中切换 file/buffer/mru
退出 ctrlp
ctrlp
neosnippet
代码补全插件,支持多种语言,自动识别文件格式,启用相应的代码片段
tab
ctrl + n
ctrl + p
ctrl + k

向下选择
向下选择
向上选择
确认输入/使用代码插件
python
go
perl pod 一键生成
html
javascript
syntastic
在状态栏右下角提示语法错误,多语言支持
按照内置规则检查,或者调用外部程序检查源代码文件
gitgutter & fugitive
配合 git 使用的精良的工具
gitgutter
自动显示源代码哪些行作了修改,开/关高亮突出显示
修改前
gitgutter
修改后
fugitive
对 git 的完备支持
:Git [args]

:Git! [args]

Run an arbitrary git command. Similar to :!git [args]
but chdir to the repository tree first.
*fugitive-:Git!*
Like |:Git|, but capture the output into a temp file,
and edit that temp file.

:Gcd [directory]

*fugitive-:Gcd*
|:cd| relative to the repository.

:Glcd [directory]

*fugitive-:Glcd*
|:lcd| relative to the repository.

:Gstatus

*fugitive-:Gstatus*
Bring up the output of git-status in the preview
window. The following maps, which work on the cursor
line file where sensible, are provided:
<c-n>
<c-p>
<cr>
cA
ca
cc
cva
cvc
D
ds
dp
dp
dv
O

next file
previous file
|:Gedit|
|:Git| add
|:Git| reset (staged files)
|:Gcommit| --amend --reuse-message=HEAD
|:Gcommit| --amend
|:Gcommit|
|:Gcommit| --amend --verbose
|:Gcommit| --verbose
|:Gdiff|
|:Gsdiff|
|:Git!| diff (p for patch; use :Gw to apply)
|:Git| add --intent-to-add (untracked files)
|:Gvdiff|
|:Gtabedit|
fugitive
输入 :gd tab补全,在 vimdiff 内预览 git diff
推荐安装方法
spf13 -- vim 插件集合,全自动安装
Thanks!
happy Viming!

Weitere ähnliche Inhalte

Ähnlich wie Unleash your vim - 20131014

手把手教你把Vim改装成一个IDE编程环境(图文)
手把手教你把Vim改装成一个IDE编程环境(图文)手把手教你把Vim改装成一个IDE编程环境(图文)
手把手教你把Vim改装成一个IDE编程环境(图文)King Hom
 
Git and git hub
Git and git hubGit and git hub
Git and git hub唯 李
 
版本控制 使用Git & git hub
版本控制   使用Git & git hub版本控制   使用Git & git hub
版本控制 使用Git & git hub維佋 唐
 
Git in a nutshell
Git in a nutshellGit in a nutshell
Git in a nutshellNelson Tai
 
Git 入门实战
Git 入门实战Git 入门实战
Git 入门实战icy leaf
 
U boot 程式碼打掃計畫
U boot 程式碼打掃計畫U boot 程式碼打掃計畫
U boot 程式碼打掃計畫Macpaul Lin
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to gitBo-Yi Wu
 
[20081118] How To Trace Code Like Source Insight Through Vim
[20081118] How To Trace Code Like Source Insight Through Vim[20081118] How To Trace Code Like Source Insight Through Vim
[20081118] How To Trace Code Like Source Insight Through VimPayton Chou
 
一小時學不會的 Vim
一小時學不會的 Vim一小時學不會的 Vim
一小時學不會的 VimLi Hsuan Hung
 
容器與 Gitlab CI 應用
容器與 Gitlab CI 應用容器與 Gitlab CI 應用
容器與 Gitlab CI 應用Philip Zheng
 
Git Essence Tutorial
Git Essence TutorialGit Essence Tutorial
Git Essence TutorialHo Kim
 
Windows Mobile 多媒體應用程式開發
Windows Mobile 多媒體應用程式開發Windows Mobile 多媒體應用程式開發
Windows Mobile 多媒體應用程式開發建興 王
 
Ruby on Rails 開發環境建置 for Mac
Ruby on Rails 開發環境建置 for MacRuby on Rails 開發環境建置 for Mac
Ruby on Rails 開發環境建置 for MacMarsZ Chen
 
[Modern Web 2016] 讓你的 PHP 開發流程再次潮起來
[Modern Web 2016] 讓你的 PHP 開發流程再次潮起來[Modern Web 2016] 讓你的 PHP 開發流程再次潮起來
[Modern Web 2016] 讓你的 PHP 開發流程再次潮起來Shengyou Fan
 
Ruby on Rails 開發環境建置 for Ubuntu
Ruby on Rails 開發環境建置 for UbuntuRuby on Rails 開發環境建置 for Ubuntu
Ruby on Rails 開發環境建置 for UbuntuMarsZ Chen
 

Ähnlich wie Unleash your vim - 20131014 (20)

手把手教你把Vim改装成一个IDE编程环境(图文)
手把手教你把Vim改装成一个IDE编程环境(图文)手把手教你把Vim改装成一个IDE编程环境(图文)
手把手教你把Vim改装成一个IDE编程环境(图文)
 
Git and git hub
Git and git hubGit and git hub
Git and git hub
 
版本控制 使用Git & git hub
版本控制   使用Git & git hub版本控制   使用Git & git hub
版本控制 使用Git & git hub
 
Git in a nutshell
Git in a nutshellGit in a nutshell
Git in a nutshell
 
Git 入门实战
Git 入门实战Git 入门实战
Git 入门实战
 
U boot 程式碼打掃計畫
U boot 程式碼打掃計畫U boot 程式碼打掃計畫
U boot 程式碼打掃計畫
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
 
[20081118] How To Trace Code Like Source Insight Through Vim
[20081118] How To Trace Code Like Source Insight Through Vim[20081118] How To Trace Code Like Source Insight Through Vim
[20081118] How To Trace Code Like Source Insight Through Vim
 
一小時學不會的 Vim
一小時學不會的 Vim一小時學不會的 Vim
一小時學不會的 Vim
 
容器與 Gitlab CI 應用
容器與 Gitlab CI 應用容器與 Gitlab CI 應用
容器與 Gitlab CI 應用
 
LinuxGuide4F2E
LinuxGuide4F2ELinuxGuide4F2E
LinuxGuide4F2E
 
Linuxguide4f2e
Linuxguide4f2eLinuxguide4f2e
Linuxguide4f2e
 
Git Essence Tutorial
Git Essence TutorialGit Essence Tutorial
Git Essence Tutorial
 
Git
GitGit
Git
 
Windows Mobile 多媒體應用程式開發
Windows Mobile 多媒體應用程式開發Windows Mobile 多媒體應用程式開發
Windows Mobile 多媒體應用程式開發
 
Ruby on Rails 開發環境建置 for Mac
Ruby on Rails 開發環境建置 for MacRuby on Rails 開發環境建置 for Mac
Ruby on Rails 開發環境建置 for Mac
 
Ipaq with linux
Ipaq with linuxIpaq with linux
Ipaq with linux
 
[Modern Web 2016] 讓你的 PHP 開發流程再次潮起來
[Modern Web 2016] 讓你的 PHP 開發流程再次潮起來[Modern Web 2016] 讓你的 PHP 開發流程再次潮起來
[Modern Web 2016] 讓你的 PHP 開發流程再次潮起來
 
Git share
Git shareGit share
Git share
 
Ruby on Rails 開發環境建置 for Ubuntu
Ruby on Rails 開發環境建置 for UbuntuRuby on Rails 開發環境建置 for Ubuntu
Ruby on Rails 開發環境建置 for Ubuntu
 

Unleash your vim - 20131014