This is a distribution of vim plugins and tools intended to be run on top of VIM. It is a good starting point for anyone intending to use VIM for development.
Unlike traditional VIM plugin structure, which similar to UNIX throws all files into common directories, making updating or disabling plugins a real mess, spf13-vim uses pathogen to have a well organized vim directory (Similar to mac's app folders).
Great care has been taken to ensure that each plugin plays nicely with others, and optional configuration has been provided for what we believe is the most efficient use.
It heavily uses git submodules where possible for all plugins. This makes for easy updating.
Lastly (and perhaps, most importantly) It is completely cross platform. It works well on Windows, Linux and OSX without any modifications or additional configurations. If you are using MacVim or Gvim additional features are enabled. So regardless of your environment just clone and run.
spf13-vim is built to be completely cross platform. It works equally well on console vim as it does on gVim for Windows, *nix or MacVim.
spf13-vim is dependent on a semi-recent version of VIM and should work well on anything above VIM 7.0.
Git is required for installation. Certain plugins require python or ruby support to be compiled into VIM.
To check if you have python or ruby support run
:echo has('ruby')
If it returns 1 your vim supports ruby.
curl http://j.mp/spf13-vim -o - | sh
or
for i in ~/.vim ~/.vimrc ~/.gvimrc; do [ -e $i ] && mv $i $i.old; done
git clone --recursive git://github.com/spf13/spf13-vim.git
I setup symlinks after this so I can maintain the repo outside of my actual config location.
Use ln -s on mac/unix or mklink on windows.
cd ~
ln -s /path/to/spf13-vim/.vimrc .vimrc
ln -s /path/to/spf13-vim/.vim .vim
cd /path/to/spf13-vim/
git pull
git submodule sync
git submodule update --init --recursive
Create ~/.vimrc.local
and ~/.gvimrc.local
for any local
customizations.
For example, to override the default color schemes:
echo color desert > ~/.vimrc.local
echo color molokai > ~/.gvimrc.local
I'm always happy to take pull requests from others. A good number of people have already contributed to spf13-vim. Go ahead and fork me.
The .vimrc file is suited to programming. It is extremely well organized and folds in sections. Each section is labeled and each option is commented.
It fixes many of the inconveniences of vanilla vim including
spf13-vim contains a curated set of popular vim plugins, colors, snippets and syntaxes. Great care has been made to ensure that these plugins play well together and have optimal configuration.
Most of the bundles are git submodules facilitating easy updating and configuration.
NERDTree is a file explorer plugin that provides "project drawer" functionality to your vim editing. You can learn more about it with :help NERDTree or checkout my post on NERDTree.
QuickStart Launch using <Leader>e
.
Customizations: spf13-vim adds a number of customizations to the core NERDTree:
<C-E>
to toggle NERDTree<leader>e
or <leader>nt
to load NERDTreeFind which opens NERDTree
where the current file is located.:e
ing files into the NERDTree bufferThe Command-T plug-in provides an extremely fast, intuitive mechanism for opening files with a minimal number of keystrokes. It's named "Command-T" because it is inspired by the "Go to File" window bound to Command-T in TextMate.
QuickStart Launch using <Leader>t
.
This plugin is a tool for dealing with pairs of "surroundings." Examples of surroundings include parentheses, quotes, and HTML tags. They are closely related to what Vim refers to as text-objects. Provided are mappings to allow for removing, changing, and adding surroundings.
Details follow on the exact semantics, but first, consider the following examples. An asterisk (*) is used to denote the cursor position.
Old text Command New text ~
"Hello *world!" ds" Hello world!
[123+4*56]/2 cs]) (123+456)/2
"Look ma, I'm *HTML!" cs"<q> <q>Look ma, I'm HTML!</q>
if *x>3 { ysW( if ( x>3 ) {
my $str = *whee!; vlllls' my $str = 'whee!';
For instance, if the cursor was inside "foo bar"
, you could type
cs"'
to convert the text to 'foo bar'
.
There's a lot more; check it out at :help surround
NERDCommenter allows you to wrangle your code comments, regardless of
filetype. View help :NERDCommenter
for all the details.
QuickStart Toggle comments using <Leader>c<space>
in Visual or Normal mode.
Customizations: spf13-vim binds command-/ (<D-/>
) to toggle comments.
In insert mode, start typing something and hit <TAB>
to tab-complete
based on the current context.
QuickStart Hit the tab key in Insert mode.
Snipmate provides snippet support similar to TextMate. A snippet is a piece of often-typed text that you can insert into your document using a trigger word followed by a .
Spf13-vim ships with a very large library of snippets for dozens of languages.
For instance, in a C file using the default installation of snipMate.vim, if you type "for" in insert mode, it will expand a typical for loop in C: >
for (i = 0; i < count; i++) {
}
To go to the next item in the loop, simply over to it; if there is repeated code, such as the "i" variable in this example, you can simply start typing once it's highlighted and all the matches specified in the snippet will be updated. To go in reverse, use .
QuickStart Type a keyword (try something like class
) and hit tab in insert mode.
Fugitive adds pervasive git support to git directories in vim. For more
information, use :help fugitive
Use :Gstatus
to view git status
and type -
on any file to stage or
unstage it. Type p
on a file to enter git add -p
and stage specific
hunks in the file.
Use :Gdiff
on an open file to see what changes have been made to that
file
QuickStart :Gstatus (in command mode)
The most feature complete and up to date PHP Integration for Vim with proper support for PHP 5.3+ including latest syntax, functions, better fold support, etc.
PIV provides
DelimitMate provides automatic closing of quotes, parenthesis, brackets, etc.; besides some other related features that should make your time in insert mode a little bit easier.
Most of the features can be modified or disabled permanently, using global variables, or on a FileType basis, using autocommands. With a couple of exceptions and limitations, this features don't brake undo, redo or history.
QuickStart Enabled by default, just works. see :help delimitmate for options
Ack.vim uses ack to search inside the current directory for a pattern. You can learn more about it with :help Ack
Customizations: spf13-vim rebinds command-shift-f (<D-F>
) to bring up
:Ack
.
Align lets you align statements on their equal signs, make comment boxes, align comments, align declarations, etc.
:5,10Align =>
to align lines 5-10 on =>
'sspf13-vim includes the TagList plugin, which binds :Tlist
to an overview
panel that lists all ctags for easy navigation.
Customizations: spf13-vim binds <Leader>rt
to the ctags command to
update tags.
Note: For full language support, run brew install ctags
to install
exuberant-ctags.
Tip: Check out :help ctags
for information about VIM's built-in
ctag support. Tag navigation creates a stack which can traversed via
Ctrl-]
(to find the source of a token) and Ctrl-T
(to jump back up
one level).
Automated tag generation and syntax highlighting in Vim
Note: Depends on exuberant Ctags. On OSX, For full language support, run brew install ctags
to install
exuberant-ctags. If you don't have ctags support disable this plugin.
QuickStart CTRL-] while the cursor is on a keyword (such as a function name) to jump to it's definition.
spf13-vim ships with a few additional syntaxes:
EDITOR
to mvim -f
)spf13-vim includes spf13 vim color pack:
Use :color molokai
to switch to a color scheme.
It also contains a very complete set of snippets for use with snipmate.
Here's some tips if you've never used VIM before:
vimtutor
into a shell to go through a brief interactive
tutorial inside VIM.i
<ESC>
:q
to exit vim<Leader>
key, which by default maps to \
by default. Spf13-vim uses let mapleader = ","
to change this to ,
which is in a consistent and
convenient location.此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。