This is the .vim directory I copy everywhere.
It currently includes:
- perlsupport (http://www.vim.org/scripts/script.php?script_id=556)
- vim-airline (https://github.com/bling/vim-airline) to provide a good status bar
- vim-fugitive (https://github.com/tpope/vim-fugitive) to provide interaction with Git
- vim-easytags (https://github.com/xolox/vim-easytags)
Note that perlsupport requires the following CPAN modules:
- Devel::SmallProf
- [Devel::FastProf]
- Devel::NYTProf
- Devel::Cover
- Perl::Critic
- Perl::Tags
- Perl::Tidy
- Term::ANSIColor
- Test::More
- Test::Strict
- YAPE::Regex::Explain
This is the ~/.vim directory (though you could symlink to it if you wanted) Then symlink ~/.vimrc to the vimrc file included
The basics:
:Gstatus
:Gdiff
:Gadd
:Gcommit
Then:
:Gedit
(:Gsplit
) edits a file already being tracked:Gread
checks-out the file from the repo before you edit it (so reverts it):Gwrite
Writes the file to the staging list
Code Folding is on curly braces {
& }
- folding within a block will fold that whole block.
z-c
closes a blockz-o
opens the blockz-a
toggles the block
A tag is basically a subroutine.
Tags allow one to jump from one subroutine to another, probably jumping files too, following the logic of the code.
In vim, these files are opened in new buffers.
Tags are automatically updated, and kept in a tags
file in the current (working) directory. This works for me, as I do all my work from the root directory of a project.
Ctrl-]
jumps to the tag under the cursorCtrl-t
jumps back one stepCtrl-W Ctrl-]
jumps to the tag under the cursor, openning in a new window.
In addition, there are number of commands you can issue:
:tag foo<tab>
will give you a list of tags that startfoo
- select one to jump to that tag:stag foo<tab>
does the same thing, but splits the window and jumps to the tag in the new window.:[s]tag /foo<tab>
By adding a/
, we search for tags with foo somewhere in the name.