/vimfiles

vim config for rails on ubuntu

Primary LanguageVim Script

A handful of plugins for vim all maintained in one bundles.vim file, useful vim configuration, espacially for Rails coding. All plugins are mantained by vundle, so you can get plugins updated in one command that makes life easier.

Make sure you have exuberant-ctags installed for using vim-ctags.

sudo apt-get install exuberant-ctags

One Line Installation:

bash <(curl -s https://raw.github.com/wongyouth/vimfiles/master/install.sh)

Old School Installation:

# Checkout configuration files
git clone git://github.com/wongyouth/vimfiles ~/vimfiles

# Create symlinks
ln -s ~/vimfiles ~/.vim
echo "source ~/.vim/vimrc" > ~/.vimrc
echo "source ~/.vim/gvimrc" > ~/.gvimrc

# Switch to the `~/.vim` directory, and fetch submodules
cd ~/.vim
git submodule init
git submodule update

# install bundles
Launch vim, run :BundleInstall (or vim +BundleInstall +qall for CLI lovers)

Features

  • rails.vim included
  • snipmate support included
  • Ctrl-P TextMate like file exploring
  • NERDTree
  • NERDCommenter
  • git intergrated
  • zencoding
  • ctags
  • tagbar
  • coffe-script syntax
  • haml syntax
  • css, scss, sass syntax
  • highlights hex codes in css files with colors they present, only work in gvim
  • many other good stuff, see vim-plugins list below
  • cursorline highlight & cursorcolumn hightlight

Usage

update vim plugins

  • :BundleInstall! - update vim plugins

File explorer

  • <F6> - open current file's folder in NERDtree
  • <F7> - toggle NERDTree window
  • <F8> - toggle tagbar window
  • <F11> - exeucte :only to make current window maximized
  • <c-b> - show buffer list
  • <c-p> - features like Ctrl-p in textMate
  • <F3> - use word under cursor as pattern to find all matching in the current file
  • <alt-F3> - use word under cursor as pattern to replace all matching in the current file
  • :Ggrep <pattern> - for searching pattern in all files under git managed, ]q open next matching, [q open previous matching, [Q, ]Q for the first and last matching

Formatting

  • <F4> - toggle paste mode

  • <F12> - toggle mouse

  • \cc - comment out

  • \c<SPACE> - revert comment out

  • \ff - javascript formatting

  • \a= - spilt and align line code by =

  • \a> - spilt and align line code by =>

  • \a== - spilt and align line code by ==

  • \a| - spilt and align line code by |

  • :Tab /pattern for others, see :h Tabular

  • <c-y>, - zencoding

  • <c-e> - sparkup

  • yss- - for <% wor*d -%>

  • yss= - for <%= wor*d %>

  • ysiw" - for wrap a word with "wor*d", more :h surround

  • crs (snake_case) - fooBar -> foo_bar

  • crm (MixedCase) - foo_bar -> FooBar

  • crc (camelCase) - foo_bar -> fooBar

  • cru (UPPER_CASE) - foo_bar -> FOO_BAR, more on :h cr

  • \P - preview markdown, textile text turns to html output in browser, need ruby built in Vim, bluecloth, RedCloth and other gems installed in system environemnt (not in rvm or rbenv env) for support converting. more :h preview

Vim plugins included in the submodules

  • vundle Vundle, the plug-in manager for Vim

Vim plugins included in bundles

Plugins from tpope

  • fugitive a Git wrapper so awesome, it should be illegal

  • rails Ruby on Rails power tools, offers wonderful features for Ruby on Rails application development.

  • unimpaired.vim pairs of handy bracket mappings

  • surround quoting/parenthesizing made simple

  • abolish easily search for, substitute, and abbreviate multiple variants of a word

  • speeddating use CTRL-A/CTRL-X to increment dates, times, and more

  • repeat enable repeating supported plugin maps with "."

Utility

  • matchit extended % matching for HTML, LaTeX, and many other languages

  • delimitMate provides insert mode auto-completion for quotes, parens, brackets, etc.

  • togglemouse Toggles the mouse focus between Vim and your terminal emulator, allowing terminal emulator mouse commands, like copy/paste.

  • The-NERD-Commenter A plugin that allows for easy commenting of code for many filetypes.

  • tabular Vim script for text filtering and alignment

  • zencoding vim script support for expanding abbreviation like zen-coding.

  • sparkup A parser for a condensed HTML format

  • jsbeautify a javascript source code formatter. ff

  • preview previewing markup files(markdown,rdoc,textile,html)

  • rename Rename a buffer within Vim and on disk. :Rename[!] newname

  • loremipsum A dummy text generator. :Loremipsum[!] [WORDCOUNT] [PARAGRAPH_TEMPLATE] [PREFIX POSTFIX]

File explorer

  • tagbar Vim plugin that displays tags in a window, ordered by class etc.

  • ctags.vim Display function name in the title bar.

  • nerdtree A tree explorer plugin for vim

  • bufexplorer With bufexplorer, you can quickly and easily switch between buffers

  • ctrlp Fuzzy file, buffer, mru and tag finder

Filetype syntax highlight

Code Snippets

  • snipmate snipMate.vim aims to be a concise vim script that implements some of TextMate's snippets features in Vim

  • snipmate-snippets vim-snipmate default snippets

  • vim-addon-mw-utils vim: interpret a file by function and cache file automatically. snipmate needs it.

  • tlib Some utility functions for VIM. snipmate needs it.

Color scheme

  • blackboard Textmate's Blackboard theme for vim (with iTerm2 theme)

  • solarized precision colorscheme for the vim text editor

  • vim-github-colorscheme A vim colorscheme based on Github's syntax highlighting. Created by Anthony Carapetis

  • monokai Monokai for vim.

Screenshots

  • vim-gui

    vim-gui
  • vim-gui (with dropdown menu for snippets)

    vim-gui-snippets
  • vim-terminal

    vim-terminal