If necessary, backup and remove your /.vim directory and
/.vimrc file.
Clone this repository to ~/git:
git clone git://github.com/alkesh/vim-config.git ~/.vim
(If you're behind a firewall that blocks port 9418, replace git: with https: in the above URL.)
Alternatively, if for some bizarre reason you don't have git installed, you can download a zip or tar file using the link on GitHub.
Symlink .vimrc:
ln -s ~/.vim/vimrc ~/.vimrc
If you are running neovim, run the setup script:
./neovim_setup
Finally, install the plugins:
vim +PlugInstall +qall
cd ~/.vim
git pull
Then in vim:
:PlugInstall
Local changes (eg if you prefer a different font or colour scheme) can either be made in a branch, or in ~/.vimrc.local.
See the plugins' web pages for more information. The keybindings listed are mostly just those defined or overridden locally, not the ones provided by default.
Plugins are installed in their own directories under bundle, thanks to Pathogen.
Work with several variants of a word at once (more)
Plugin for the Perl module / CLI script 'ack' (more)
Modern syntax checker (more)
Keybindings
- ,u
- Run rubocop -a to fix issues idenified by rubocop
Help folks to align text, eqns, declarations, tables, etc (more)
Keybindings
- ,tlt
- Align LaTEX tables (to avoid clashing with our existing ,tt mapping)
- ,t>
- Align on =>
Blockle (more)
Toggle between block styles do
..end
and {
..}
.
Keybindings
- ,b
- Toggle block style
Buffer explorer/browser (more)
Keybindings
- ,.
- Show buffer explorer
Fast file navigation for VIM (more)
Written in pure vimscript, so no need to compile anything (unlike Command-T)
Keybindings
- ctrl-p
- The default keybinding
- ,t
- For those used to using Command-T
Search for word under cursor in Dash. (more)
Keybindings
- ,d
- Search for word under cursor in Dash
Fast and Easy Find and Replace Across Multiple Files (more)
Wisely add "end" in ruby, endfunction/endif/more in vim script, etc (more)
Brings up the commit log of the current file. In the log view (more)
Keybindings
- ,x
- Open commit history for current file
A Git wrapper so awesome, it should be illegal (more)
Syntax highlighting for Markdown (more)
Extended % matching for HTML, LaTeX, and many other languages (more)
A tree explorer plugin for navigating the filesystem (more)
Keybindings
- ,m
- Show/hide NERDTree
- ,f
- Show current file in tree
A plugin that allows for easy commenting of code for many filetypes (more)
A set of mappings for HTML, XML, PHP, ASP, eRuby, JSP, and more (more)
If you have already typed 'foo', the following shortcuts apply (with the cursor position marked by ^):
- <C-X>=
- foo<%= ^ %>
- <C-X>+
- <%= foo^ %>
- <C-X>-
- foo<% ^ %>
- <C-X>_
- <% foo^ %>
- <C-X>'
- foo<%# ^ %>
- <C-X>"
- <%# foo^ %>
- <C-X><Space>
- <foo>^</foo>
- <C-X><CR>
- <foo>
^
</foo> - <C-X>/
- Last HTML tag closed
- <C-X>!
- <!DOCTYPE...>/<?xml ...?> (menu)
- <C-X>@
- <link rel="stylesheet" ...>
- <C-X>#
- <meta http-equiv="Content-Type" ... /> ragtag-CTRL-X_#
- <C-X>$
- <script src="/javascripts/^.js"></script> ragtag-CTRL-X_$
Ruby on Rails: easy file navigation, enhanced syntax highlighting, and more (more)
Keybindings
- ,r
- run rake
It's like rails.vim without the rails (more)
Use the repeat command (.) with supported plugins (more)
## ruby
Ruby support (newer than the version released with vim). (more)
Refactoring tool for Ruby in vim! (more)
See relish documentation for examples.
Switch between single-line and multi-line statements (more)
Keybindings
- gS
- to split a one-liner into multiple lines
- gJ
- (with the cursor on the first line of a block) to join a block into a single-line statement
Do all your insert-mode completion with Tab (more)
Delete/change/add parentheses/quotes/XML-tags/much more with ease (more)
Configurable, flexible, intuitive text aligning (more)
Keybindings
- ,aa
- (when text is selected) format tables made with pipes (|)
Pairs of handy bracket maps (more)
Multiple selection similar to Sublime Text (more)
Zoom in/out of windows (toggle between one window and multi-window) (more)
Keybindings
- ,z
- Zoom
- ctrl-]
- Jump to definition (needs universal ctags installed - see Tags section below)
- ,c
- Hide/show tabs and trailing spaces
- ,ff
- Copy current filename and path to the system clipboard
- ,h
- Hide search highlighting
- ,rr
- Run ruby file
- ,,
- Run rspec on current file
- ,rt
- Generate tags (using ctags)
- ,s
- Show/hide spelling errors
- ,sw
- Strip trailing whitespace
- ,w
- Toggle word wrapping
- ,p
- Switch to 'projector mode' (large font, light colour scheme)
- RB
- Open Ruby docs in browser for word under cursor
- RR
- Open Rails docs in browser for word under cursor
The ctrl-] and ,rt shortcuts needs universal ctags installed
- :SudoW
- Save using sudo (run sudo -v in terminal first)
See Kerry's vim bookmarks on pinboard. Also, Kerry seems to have moved on from using his own config, to using this one: https://github.com/AdamWhittingham/vim-config