My personal .vim
files. This repository includes my ~/.vimrc
, ~/.vim
dir, and the plugins I use as git submodules. This repository basically includes my entire vim setup so that I can easily load it onto other systems and have history of it.
git clone git://github.com/cyphactor/dotvim.git ~/.vim
ln -s ~/.vim/vimrc ~/.vimrc
ln -s ~/.vim/gvimrc ~/.gvimrc
cd ~/.vim
git submodule init
git submodule update
cd ~/.vim
git pull
git submodule init
git submodule update
My .vimrc
is setup to use the Solarized Color Scheme which can be found at
http://ethanschoonover.com/solarized.
My .vim
directory includes this color scheme as Git submodule just like all
the plugins. The reason I mention this is because I have it configured to use
the non 256 degraded Vim color version. This requires that you are using the
Solarized Color Scheme for your terminal application as well. I for example am
using iTerm 2 with the Solarized iTerm 2 color scheme
presets.
The <leader>
key in my .vimrc
is set to the ,
key.
In insert mode when you start typing and hit tab it will bring up the tab completion interface.
<leader>n
- rename the current file<leader>.
- switch between test & implementation code (assumes RSpec, Cucumber, and Ruby)
<leader>t
- run all tests defined in the current file and store as last test run if in test file, run last stored test run if in implementation file.<leader>T
- run test nearest cursor in current file and store as last test run if in test file, run last stored test run if in implementation file.
<leader>f
- fuzzy match all files under the project root directory<leader>F
- fuzzy match all files under the directory parenting the file currently being edited<leader>b
- fuzzy match all files with buffers currently opened in the vim session
<leader>gr
- open topleft split editing Ruby on Rails routes<leader>gR
- show the currently defined Ruby on Rails routes<leader>gv
- fuzzy match files in the Ruby on Railsapp/views
path<leader>gc
- fuzzy match files in the Ruby on Railsapp/controllers
path<leader>gm
- fuzzy match files in the Ruby on Railsapp/models
path<leader>gh
- fuzzy match files in the Ruby on Railsapp/helpers
path<leader>gl
- fuzzy match files in the Ruby on Railslib
path<leader>gp
- fuzzy match files in the Ruby on Railspublic
path<leader>gs
- fuzzy match files in the Ruby on Railspublic/stylesheets/sass
path<leader>gf
- fuzzy match files in the Ruby on Railsfeatures
path<leader>gg
- open topleft split editing Gemfile
The following are plugins that my .vim directory includes as Git submodules for easy upgrading. Below I also provide the commands that I find I use most often from each of the plugins.
Provides functionality to easily manage surroundings parens, quotes, etc. http://github.com/tpope/vim-surround
cst'
- change surrounding html tag to single quotescs'<p>
- change surrounding single quotes to<p>
html tagcs'"
- change surrounding single quotes to double quotesds"
- delete surrounding double quotesysiw'
- add surrounding of single quote inside word (iw) where iw is a text object
Provides interface to Ack from within vim. http://github.com/mileszs/ack.vim
:Ack [options] {pattern}
- search for specified pattern showing results in vim quick fix window.
Provides syntax highlighting for Markdown files. http://github.com/tpope/vim-markdown
Provides syntax highlighting for Cucumber features and step definitions http://github.com/tpope/vim-cucumber
Provides full blown Git interface inside of Vim. This is very valuable in my opinion and is worth spending some time learning as it will make your life much easier. http://github.com/tpope/vim-fugitive
Inject your own changes into the existing vim functionality by adding extended
versions of .vimrc and .gvimrc in your home directory. If you add files named
.vimrc-ext
and .gvimrc-ext
to your home directory, they are sourced at the top
of the vimrc and gvimrc files in this project. Any functions or settings you
add to those files will be available in vim sessions.
This makes it easy for you to try out this project without losing your
existing vim settings. Simply rename your existing .vimrc to .vimrc-ext and
our .gvimrc to .gvimrc-ext and restart vim. If you don't already have your
settings, we've included *-ext-example
files in the project. If you want to
try them out, either either move them into your home directory with the proper
names or set symbolic links in your home directory as follows:
ln -s .vim/vimrc-ext-example .vimrc-ext ln -s .gvim/gvimrc-ext-example .gvimrc-ext