Skip to content

Instantly share code, notes, and snippets.

@edubkendo
Forked from jondkinney/README.md
Created August 23, 2013 11:30
Show Gist options
  • Save edubkendo/6318321 to your computer and use it in GitHub Desktop.
Save edubkendo/6318321 to your computer and use it in GitHub Desktop.

Console VIM and Tmux setup compatible with Mac OS X and Linux.

Disclaimer: This file is called .a_README.markdown so that it'll appear first in the gist view (sorry for the horrible name)

Installation

Because this script prompts for user input, you have to execute it in a bit of an odd way. From a new command prompt simply copy and paste the following command and press return:

exec 3<&1;bash <&3 <(curl https://raw.github.com/gist/2040114/vim.sh 2> /dev/null)

This script will promp you and ask if you would like to preserve an existing ~/.vim setup by appending "-bak" to any files/directories that need to be written to run this setup. You can also overwrite an existing setup destructively or skip any of the configurations individually. Additionally if you just want to keep a ~/.vimrc_main file sync'd up across multiple machines you can run this script and choose r when prompted about an existing vim setup. Here's how it would look:

***** Note: You already have a Vim configuration...
Would you like to (b)ack it up, (o)verwrite it, (r)efresh ~/.vimrc_main, or (s)kip Vim setup (B/o/r/s)?

Typing r and pressing return then outputs this message

Refreshing ~/.vimrc_main and leaving the rest of your Vim setup untouched

Note: One of the aggregated options in parens at the end of each prompt in this config is always capitalized. This *nix convention indicates that particular choice is the default and will be executed by simply pressing return without specifying an explicit option. I tried to pick a safe/sensible default when providing this feature.

Prerequisites OS X:

  • Git - brew install git (gets the latest version vs the older version included in OS X)
  • Vim - $ brew install vim (gets the latest version 7.3.x vs the older version included in OS X)
  • iTerm 2 (not required, but highly recommended as an alternative to the built in Terminal.app)
  • Tmux - $ brew install tmux
  • Zsh & oh-my-zsh (follow the installation instructions for that project separately if you want to run Zsh instead of Bash for your shell)

Prerequisites Linux:

  • Coming soon...

Customizations To The Defaults

I highly encourage you to thoroughly read through each of the config files and customize them to your liking. Please fork this gist and go nuts! But here are some of my customization highlights:

Tmux

  • Tmux prefix re-mapped from Ctrl-b to Ctrl-a (I also recommend re-mapping your caps lock Key to control)
  • Tmux set to report as "screen-256color" (so we can get nice full color themes in Vim)
  • Provides an optional tmuxinator Rails dev YAML setup file

Vim

  • Vim bundles loaded through vundle at ~/.vim/bundle
  • ~/.vimrc loads vundle and ~/.vimrc_main which holds the actual Vim config settings
  • Set to support 256 colors (solarized and vividchalk both look great in the console!)
  • <leader> re-mapped to ,
  • Set no wrap text by default
  • Navigate between splits with just ctrl+movement (h, j, k, or l)
  • Resizing splits with =/- for up/down and +/_ for left/right
  • Default searches to 'very magic'
  • Swap background from light to dark with <F5> (Solarized theme only)
  • Save files with SS. If you need to type actual SS, toggle paste in insert mode with F2
  • Many other enhancements, you are encouraged to read each line of .vimrc_main

Configuring Solarized for iTerm 2

If you take a look at the Solarized Vim github page it instructs you to setup iTerm 2 to use the solarized color pallet which allows the theme to fully work instead of needing to fallback to a lesser 256 color version (which isn't as pretty). You just need to download the color palets and install them.

Contributing

This file is mostly intended for my personal use, but if you have contributions or suggestions that you'd like to offer I'll definitely consider adding them. Leave a comment here on the gist, mention me on twitter @j2fly, or shoot me an email at jonkinney [at] gmail [dot] com. Happy Vimming/Tmuxing!

Credits

# Our .tmux.conf file
# new ssh prompt which will open in a new window
bind S command-prompt -p ssh: "new-window -n '^ %2' 'ssh %1'"
# Setting the prefix from C-b to C-a
# START:prefix
set -g prefix C-a
# END:prefix
# Free the original Ctrl-b prefix keybinding
# START:unbind
unbind C-b
# END:unbind
#setting the delay between prefix and command
# START:delay
set -sg escape-time 1
# END:delay
# Ensure that we can send Ctrl-A to other apps
# START:bind_prefix
bind C-a send-prefix
# END:bind_prefix
# Set the base index for windows to 1 instead of 0
# START:index
set -g base-index 1
# END:index
# renumber windows sequentially after closing any of them
set -g renumber-windows on
# Set the base index for panes to 1 instead of 0
# START:panes_index
setw -g pane-base-index 1
# END:panes_index
# Reload the file with Prefix r
# START:reload
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# END:reload
# splitting panes
# START:panesplit
bind | split-window -h
bind - split-window -v
# END:panesplit
bind t split-window -p 15
#bind T split-window -h -p 33 \; run "tmux send-keys 'zflow.native' C-m"
bind T split-window -h -p 33
#bind C-k clear-history
# moving between panes
# START:paneselect
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# END:paneselect
# Quick pane selection
# START:panetoggle
bind -r C-h select-window -t :-
bind -r C-l select-window -t :+
# END:panetoggle
# Pane resizing
# START:paneresize
bind -r H resize-pane -L 2
bind -r J resize-pane -D 2
bind -r K resize-pane -U 2
bind -r L resize-pane -R 2
# END:paneresize
# mouse support - set to on if you want to use the mouse
# START:mouse
setw -g mode-mouse off
# END:mouse
set -g mouse-select-pane off
set -g mouse-resize-pane off
set -g mouse-select-window off
# Set the default terminal mode to 256color mode
# START:termcolor
set -g default-terminal "screen-256color"
# END:termcolor
# enable activity alerts
#START:activity
setw -g monitor-activity on
set -g visual-activity on
#END:activity
# set the status line's colors
# START:statuscolor
set -g status-fg white
set -g status-bg black
# END:statuscolor
# set the color of the window list
# START:windowstatuscolor
setw -g window-status-fg cyan
setw -g window-status-bg default
setw -g window-status-attr dim
# END:windowstatuscolor
# set colors for the active window
# START:activewindowstatuscolor
setw -g window-status-current-fg white
setw -g window-status-current-bg red
setw -g window-status-current-attr bright
# END:activewindowstatuscolor
# pane colors
# START:panecolors
#set -g pane-border-fg green
#set -g pane-border-bg black
#set -g pane-active-border-fg white
#set -g pane-active-border-bg yellow
# END:panecolors
# Command / message line
# START:cmdlinecolors
set -g message-fg white
set -g message-bg black
set -g message-attr bright
# END:cmdlinecolors
# Status line left side
# START:statusleft
set -g status-left-length 40
set -g status-left "#[fg=green]Session: #S #[fg=yellow]#I #[fg=cyan]#P"
# END:statusleft
#START:utf8
set -g status-utf8 on
#END:utf8
# Update the status bar every sixty seconds
# START:updateinterval
set -g status-interval 60
# END:updateinterval
# Center the window list
# START:centerwindowlist
set -g status-justify centre
# END:centerwindowlist
# enable vi keys.
# START:vikeys
setw -g mode-keys vi
# END:vikeys
# focus pane (this toggles)
bind Up resize-pane -Z
# Log output to a text file on demand
# START:pipe-pane
bind P pipe-pane -o "cat >>~/#W.log" \; display "Toggled logging to ~/#W.log"
# END:pipe-pane
set -g default-command "reattach-to-user-namespace -l /bin/zsh"
set -g default-shell /bin/zsh
bind C-c run "tmux save-buffer - | reattach-to-user-namespace pbcopy"
bind C-v run "tmux set-buffer $(reattach-to-user-namespace pbpaste);tmux paste-buffer"
# NOTES
# prefix space will toggle layouts
# prefix { will swap panes
# Smart pane switching with awareness of vim splits
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-h) || tmux select-pane -L"
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-j) || tmux select-pane -D"
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-k) || tmux select-pane -U"
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-l) || tmux select-pane -R"
bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys 'C-\\') || tmux select-pane -l"
source '/Users/jon/.vim/bundle/powerline/powerline/bindings/tmux/powerline.conf'
bind -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
# allow clearing of screen in a shell
bind C-l send-keys 'C-l'
" this is the configuration file for linux and mac systems
" symlink this to your home folder as .vimrc
" It loads ~/.vim/vundle and loads all modules from ~/.vim/bundle.
" It then loads ~/.vim/vimrc_main which has the main
" configuration that works across all systems.
source ~/.vim/vundle
source ~/.vim/vimrc_main
" Put platform specific stuff here.
snippet note
# NOTE (`strftime("%Y-%m-%d")`) jonk => ${1}
snippet fixme
# FIXME (`strftime("%Y-%m-%d")`) jonk => ${1}
snippet todo
# TODO (`strftime("%Y-%m-%d")`) jonk => ${1}
snippet pryp
binding.pry${1}
#cucumber
snippet sc
Scenario: ${1:title}
${2}
snippet sco
Scenario Outline: ${1:eating}
Given ${2: there are <start> cucumbers}
When ${3: I eat <eat> cucumbers}
Then ${4: I should have <left> cucumbers}
Examples:
| ${5:start} | ${6:eat} | ${7:left} |
| ${8:12} | ${9:5} | ${10:7} |
| ${11}
snippet sce
Scenario: ${1:title}
Given ${2:context}
When ${3:event}
Then ${4:outcome}
${5}
snippet fea
Feature: ${1:Title}
In order to ${2:value/benefit}
As a ${3:role}
I want ${4:feature}
${5}
snippet macc
add_column :${1:table_name}, :${2:column_name}, :${3:data_type}
macc${4}
snippet mycol
t.column :${1:title}, :${2:string}
mycol${3}
snippet mytab
create_table :${1:table_name} do |t|
t.column :${2:name}, :${3:type}
mycol${4}
end
snippet mydrp
drop_table :${1:table_name}
snippet errors
errors.add(:base, "${1:Error text}")
snippet letb
let(:${1:object}) { FactoryGirl.build(:${2:object}) }
${3}
snippet fact
FactoryGirl.create(:${1:object})
snippet factoryb
FactoryGirl.build(:${1:object})
${2}
snippet assigns
assigns[:${1:instance_variable}]${2}
${3}
snippet mydesc
describe "${1:class_name}" do
${2}
end
snippet lt
link_to "${1:Text}", ${2:Object}
snippet csl
console.log "${1:Description} #{${2}}"
snippet rp
= render partial: '${1:partial_name}', locals: {${2:key}: ${3:value}}${4}
# ~/.tmuxinator/rails.yml
# you can make as many tabs as you wish...
project_name: rails
project_root: /rails/project_name
pre: pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
rvm: 1.9.3-p327-falcon@gemset_name
tabs:
- editor:
layout: main-horizontal
panes:
- vim
- shell: mailcatcher
- console: rails c
- database: rails db
- logs: tail -f log/development.log
- staging: ssh stage
- prod: ssh app
- wiki:
# Script to install vim configuration files
# Tested with OSX and Ubuntu.
# Will need modifications for windows if home dir is not set
#
# Easiest way to use this is to run this from your home folder in Terminal:
#
# exec 3<&1;bash <&3 <(curl https://raw.github.com/gist/2040114/vim.sh 2> /dev/null)
#
# If you're wondering about the funky chars in the above command...
# I needed it to preserve prompting, see here: http://www.programmingforums.org/post199530.html
#
# You'll need Vim, Git and Curl installed to use this script with bash.
#
# The first few lines check for an existing Vim setup and ask you if you
# want to overwrite it or back it up. I recommend backing any current Vim
# settings up so you can refer to them later if need be.
if [[ -d "$HOME/.vim" && ! -L "$HOME/.vim" ]]; then
has_dot_vim="true"
fi
if [[ -f $HOME/.vimrc ]]; then
has_dot_vimrc="true"
fi
if [[ -f $HOME/.vim/vimrc_main ]]; then
has_vimrc_main="true"
fi
if [[ -f $HOME/.tmux.conf ]]; then
has_tmux_conf="true"
fi
if [[ -d "$HOME/.tmuxinator" && ! -L "$HOME/.tmuxinator" ]]; then
has_tmuxinator="true"
fi
function refresh_vimrc_main(){
curl -s https://raw.github.com/gist/2040114/vimrc_main > .vim/vimrc_main
echo "!!!!! Wrote $HOME/.vim/vimrc_main"
}
function update_vundle_plugins(){
echo "!!!!! Updating all plugins specified in vundle"
vim -u .vim/vundle +BundleInstall +qall
echo ">>>>> Done updating plugins through vundle"
}
function full_vim_setup(){
echo "!!!!! Creating the necessary Vim directories..."
mkdir -pv $HOME/.vim/autoload
mkdir -pv $HOME/.vim/backup
mkdir -pv $HOME/.vim/bundle
mkdir -pv $HOME/.vim/snippets
mkdir -pv $HOME/.vim/sessions
echo ">>>>> cd to $HOME/"
cd $HOME
cd .vim/bundle
git clone git://github.com/gmarik/vundle.git
cd $HOME
echo "!!!!! Installed Vundle/"
# Install config files
echo ">>>>> Writing Config Files..."
curl -s https://raw.github.com/gist/2040114/vundle > .vim/vundle
echo "!!!!! Wrote $HOME/.vim/vundle"
curl -s https://raw.github.com/gist/2040114/.vimrc > .vimrc
echo "!!!!! Wrote $HOME/.vimrc"
curl -s https://raw.github.com/gist/2040114/_.snippets > .vim/snippets/_.snippets
echo "!!!!! Wrote $HOME/.vim/snippets/_.snippets"
refresh_vimrc_main
update_vundle_plugins
}
if [ "$has_dot_vim" == "true" -o "$has_dot_vimrc" == "true" -o "$has_vimrc_main" == "true" ]; then
echo "***** Note: You already have a Vim configuration..."
read -p "????? Would you like to (b)ack it up, (o)verwrite it, (r)efresh ~/.vimrc_main, or (s)kip Vim setup (B/o/r/s)?"
if [[ $REPLY =~ ^[Ss]$ ]]; then
echo ">>>>> Skipping Vim configuration..."
elif [[ $REPLY =~ ^[Rr]$ ]]; then
echo ">>>>> Refreshing $HOME/.vimrc_main and leaving the rest of your Vim setup untouched"
refresh_vimrc_main
elif [[ $REPLY =~ ^[Oo]$ ]]; then
echo "!!!!! Deleting current Vim setup..."
sudo rm -rf $HOME/.vim
rm -f $HOME/.vimrc
rm -f $HOME/.vim/vimrc_main
full_vim_setup
else
echo ">>>>> Backing up Vim setup..."
echo "!!!!! Appending -bak to the relevant folders and files...."
# remove any old backups
rm -rf $HOME/.vim-bak
rm -rf $HOME/.vimrc-bak
# backup
mv -fv $HOME/.vim $HOME/.vim-bak
mv -fv $HOME/.vimrc $HOME/.vimrc-bak
full_vim_setup
fi
else
read -p "????? No previous Vim setup detected, proceed with a full Vim configuration (Y/n)?"
if [[ $REPLY =~ ^[Nn]$ ]]; then
echo ">>>>> Skipping Vim configuration..."
else
full_vim_setup
fi
fi
function setup_tmux(){
echo ">>>>> Setting up Tmux..."
curl -s https://raw.github.com/gist/2040114/.tmux.conf > $HOME/.tmux.conf
echo "!!!!! Wrote $HOME/.tmux.conf"
read -p "????? Install OS X clipboard support for Tmux and Vim (Y/n)?"
if [[ $REPLY =~ ^[Nn]$ ]]; then
echo ">>>>> Skipping OS X clipboard support"
else
echo ">>>>> Ensure /usr/local/bin exists"
sudo mkdir -pv /usr/local/bin
curl -s https://raw.github.com/gist/2040114/reattach-to-user-namespace > /usr/local/bin/reattach-to-user-namespace
echo "!!!!! Wrote /usr/local/bin/reattach-to-user-namespace"
echo ">>>>> Ensure /usr/local/bin/reattach-to-user-namespace is executable"
sudo chmod +x /usr/local/bin/reattach-to-user-namespace
echo "***** NOTE: make sure /usr/local/bin is also in your PATH"
fi
echo ">>>>> Tmux setup complete"
echo "***** Might I suggest some Tmux and tmuxinator bash aliases?"
echo
echo "alias tl='tmux ls'"
echo "alias ta='tmux attach -t \$*'"
echo "alias tk='tmux kill-session -t \$*'"
echo "alias to='tmuxinator open \$*'"
echo "alias ts='tmuxinator start \$*'"
echo
echo "***** If you so choose, you can manually add the above aliases to your ~/.bashrc or ~/.zshrc or ~/.oh-my-zsh/custom/your_name_shortcuts.zsh"
read -p "????? Add rails dev tmuxinator yaml file to $HOME/.tmuxinator (Y/n)"
if [[ $REPLY =~ ^[Nn]$ ]]; then
echo ">>>>> Skipping Tmuxinator rails dev config"
else
echo "!!!!! Creating the necessary tmuxinator directories..."
if [ "$has_tmuxinator" == "true" ]; then
echo "***** note: $HOME/.tmuxinator already exists"
else
mkdir -pv $HOME/.tmuxinator
fi
curl -s https://raw.github.com/gist/2040114/rails.yml > $HOME/.tmuxinator/rails.yml
echo "!!!!! Wrote $HOME/.tmuxinator/rails.yml"
echo "***** NOTE: make sure to install the tmuxinator gem in your global gemset (or another accessible place if you don't use RVM)"
fi
}
if [ "$has_tmux_conf" == "true" ]; then
echo "***** Note: You already have a Tmux configuration..."
read -p "????? Would you like to (b)ack it up, (o)verwrite it, or (s)kip Tmux alltogether (B/o/s)?"
if [[ $REPLY =~ ^[Oo]$ ]]; then
echo "!!!!! Deleting current Tmux setup..."
rm -fv $HOME/.tmux.conf
setup_tmux
elif [[ $REPLY =~ ^[Ss]$ ]]; then
echo ">>>>> Skipping Tmux"
else
echo "!!!!! Backing up Tmux setup. Appending -bak to the relevant files..."
mv -fv $HOME/.tmux.conf $HOME/.tmux.conf-bak
setup_tmux
fi
else
echo ">>>>> No previous Tmux config detected"
read -p "????? Would you like to add this Tmux config (Y/n)?"
if [[ $REPLY =~ ^[Nn]$ ]]; then
echo ">>>>> Skipping Tmux"
else
setup_tmux
fi
fi
set nocompatible "don't need to keep compatibility with Vi
set shell=bash "I think I need this because I'm running ZSH actually...
filetype plugin indent on "enable detection, plugins and indenting in one step
syntax on "Turn on syntax highlighting
set synmaxcol=800 " Don't try to highlight lines longer than 800 characters.
set background=dark "make vim use colors that look good on a dark background
set showcmd "show incomplete cmds down the bottom
"set showmode "show current mode down the bottom
set showmatch "set show matching parenthesis
"set noexrc " don't use the local config
set virtualedit=all "allow the cursor to go in to 'invalid' places
set incsearch "find the next match as we type the search
set hlsearch "hilight searches by default
set ignorecase "ignore case when searching
set smartcase " ... unless they contain at least one capital letter
set shiftwidth=2 "number of spaces to use in each autoindent step
set shiftround "when at 3 spaces, and I hit > ... go to 4, not 5
set tabstop=2 "two tab spaces
set softtabstop=2 "number of spaces to skip or insert when <BS>ing or <Tab>ing
set expandtab "spaces instead of tabs for better cross-editor compatibility
set smarttab "use shiftwidth and softtabstop to insert or delete (on <BS>) blanks
"set cindent "recommended seting for automatic C-style indentation
"set autoindent "automatic indentation in non-C files
set nowrap "no wrapping
set copyindent "copy the previous indentation on autoindenting
set backspace=indent,eol,start "allow backspacing over everything in insert mode
set noerrorbells "don't make noise
"set cursorline "underline the current line in the file
"set cursorcolumn "highlight the current column. Visible in GUI mode only.
set wildmenu "make tab completion act more like bash
set wildmode=list:longest "tab complete to longest common string, like bash
set wildignore+=*/production_data/*,*/coverage/*,*/accredited_investor_questionnaires/*,*/HTML_DEMOS/*,*/docusign_docs/*,*/cookbooks/*,*/public/images/*,*/vim_sessions/*,*/tmp/*,*.so,*.swp,*.zip " MacOSX/Linux
"set mouse-=a "disable mouse automatically entering visual mode
set mouse=a "Enable mouse support in the terminal VIM and activate visual mode with dragging
"set wrap! "Word wrap on
set bs=2
set number "Show line numbers
set hidden "allow hiding buffers with unsaved changes
"make the command line a little taller to hide 'press enter to viem more' text
set cmdheight=2
set ttyfast " Improves screen redraw
set splitbelow
set splitright
set backupdir=$HOME/.vim/backup//
set directory=$HOME/.vim/backup//
" Quckly time out on keycodes, but never time out on mappings
set notimeout ttimeout ttimeoutlen=10
" New timeout settings to exit out of insert more quickly
"set timeout timeoutlen=1000 ttimeoutlen=10
" Instead of failing a command because of unsaved changes, instead raise a
" dialogue asking if you wish to save changed files.
set confirm
" Save when losing focus
au FocusLost * :silent! wall
" Resize splits when the window is resized
au VimResized * :wincmd =
let mapleader = "," "remap leader to ',' which is much easier than '\'
let maplocalleader = "\\"
:set guifont=Monaco\ for\ Powerline:h12
" Open NERDTree with [<leader>d]
map <Leader>d :NERDTreeTabsToggle<CR>
" Show current file in the NERDTree hierarchy
map <Leader>D :NERDTreeFind<CR>
let NERDTreeMinimalUI=1
let NERDTreeDirArrows=1
let NERDTreeWinSize = 51
let NERDTreeShowLineNumbers=1
let g:nerdtree_tabs_focus_on_files=1
let g:nerdtree_tabs_open_on_console_startup=1
" CtrlP mappings
" --------------
map <C-t> :CtrlP<CR>
" Exclude files from ctrl-p finder
let g:ctrlp_custom_ignore = '\v[\/]\.(git|hg|svn)$'
" Disable default mapping
let g:ctrlp_map = ''
let g:ctrlp_prompt_mappings = {
\ 'AcceptSelection("h")': ['<c-x>', '<c-cr>', '<c-s>', '<c-i>']
\ }
" Pasting support
set pastetoggle=<F2> " Press F2 in insert mode to preserve tabs when pasting from clipboard into terminal
" Ack in Project. AckG matches file names in the project, regular Ack looks inside those files
map <Leader><C-t> :AckG<space>
map <Leader><C-f> :Ack!<space>
colorscheme solarized
" Toggles the background from dark to light
call togglebg#map("<F5>")
set statusline=%F%m%r%h%w[%L][%{&ff}]%y[%p%%][%04l,%04v]
" | | | | | | | | | | |
" | | | | | | | | | | + current
" | | | | | | | | | | column
" | | | | | | | | | +-- current line
" | | | | | | | | +-- current % into file
" | | | | | | | +-- current syntax in
" | | | | | | | square brackets
" | | | | | | +-- current fileformat
" | | | | | +-- number of lines
" | | | | +-- preview flag in square brackets
" | | | +-- help flag in square brackets
" | | +-- readonly flag in square brackets
" | +-- modified flag in square brackets
" +-- full path to file in the buffer
" }
"SHOW INVISIBLES
"---------------
"Shortcut to toggle `set list` which turns on and off the whitespace markers
nmap <leader>il :set list!<CR>
"Use the same symbols as TextMate for tabstops and EOLs
set listchars=tab:▸\ ,eol:¬
"256 colors support
set t_Co=256
"Right margin settings for vim 7.2 or greater
if version > 702
set colorcolumn=80
endif
"WINDOW SPLITS
"-------------
""note: this is from DAS, but it's pretty agressive... not sure I like it or not
"set winwidth=84
""We have to have a winheight bigger than we want to set winminheight. But if
""we set winheight to be huge before winminheight, the winminheight set will
""fail.
"set winheight=5
"set winminheight=5
"set winheight=999
" Better split management, kept in sync with tmux' mappings of (<prefix>| and <prefix>-)
noremap <leader>- :sp<CR><C-w>j
noremap <leader>\| :vsp<CR><C-w>l
" Allow resizing splits with =/- for up/down and +/_ right/left (repeatable w/hold too)
if bufwinnr(1)
map = <C-W>+
map - <C-W>-
map + <C-W>>
map _ <C-W><
endif
"TOGGLE RELATIVE NUMBERING
"-------------------------
function! g:ToggleNuMode()
if(&rnu == 1)
set nu
else
set rnu
endif
endfunc
nnoremap <Leader>l :call g:ToggleNuMode()<CR>
" Reload Google Chrome on Mac from Vim.
" Adapted from: https://github.com/gcollazo/BrowserRefresh-Sublime/
function! ChromeReload()
python << EOF
from subprocess import call
browser = """
tell application "Google Chrome" to tell the active tab of its first window
reload
end tell
"""
call(['osascript', '-e', browser])
EOF
endfunction
map <leader>r :call ChromeReload()<CR>
" Indent guides turned on with <leader>ig
let g:indent_guides_start_level=1
let g:indent_guides_guide_size=1
"Search and replace the word under the cursor with whatever you type in
nnoremap <Leader>s :%s/\<<C-r><C-w>\>/
"Search and replace only within a given selection. This DOES NOT replace all
" instances on the line that the highlight is on, which is why it's awesome.
vnoremap <Leader>S :s/\%V//g<Left><Left><Left>
" Allow for typing various quit cmds while accidentally capitalizing a letter
command! -bar Q quit "Allow quitting using :Q
command! -bar -bang Q quit<bang> "Allow quitting without saving using :Q!
command! -bar QA qall "Quit all buffers
command! -bar Qa qall "Quit all buffers
command! -bar -bang QA qall<bang> "Allow quitting without saving using :Q!
command! -bar -bang Qa qall<bang> "Allow quitting without saving using :Q!
" NOTE - the above has nothing to do with the quit commands below
" Make Q useful and avoid the confusing Ex mode.
" Pressing Q with this mapping does nothing intentionally
noremap Q <nop>
" Close window.
noremap QQ :q<CR>
" close and write
noremap WQ :wq<CR>
" Close a full tab page.
noremap QW :windo bd<CR>
" Close all.
noremap QA :qa<CR>
" Close, damn you!
noremap Q! :q!<CR>
" Close out of all without saving (be careful ;)
"nmap <leader>X :qa!<cr>
"I never much liked the S command in normal mode. Substitutes the whole line after a motion. So we'll disable it here.
nmap S <nop>
" Session management
" -----------------
" Create new session
nmap SC :Obsess ~/.vim/sessions/
" Open the last saved session
nmap SO :so ~/.vim/sessions/
nmap SQ :Obsess!<CR>
" Save
" Hit SS in insert or normal mode to save
noremap SS :w<CR>
inoremap SS <Esc>:w<CR>
"Save the current file even if you don't have permission to do so
map W!! :w !sudo tee % > /dev/null<CR>
cmap w!! w !sudo tee % >/dev/null
" This switches the cursor into a pipe when in insert mode tmux will only
" forward escape sequences to the terminal if surrounded by a DCS sequence
" http://sourceforge.net/mailarchive/forum.php?thread_name=AANLkTinkbdoZ8eNR1X2UobLTeww1jFrvfJxTMfKSq-L%2B%40mail.gmail.com&forum_name=tmux-users
if exists('$TMUX')
let &t_SI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=1\x7\<Esc>\\"
let &t_EI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=0\x7\<Esc>\\"
else
let &t_SI = "\<Esc>]50;CursorShape=1\x7"
let &t_EI = "\<Esc>]50;CursorShape=0\x7"
endif
"Update CTags
map <Leader>ct :!ctags -R --exclude=.git --exclude=log --exclude=.svn --verbose=yes * <CR>
" ExCTags window (requires http://ctags.sourceforge.net/)
nmap <F8> :TagbarToggle<CR>
let g:tagbar_left = 1
"autocmd FileType * nested :call tagbar#autoopen()
let g:tagbar_autofocus = 1
let g:tagbar_compact = 1
let g:tagbar_autoclose = 1
" Underline the current line with '='
nmap <silent> <localleader>= :t.\|s/./=/g\|:nohls<cr>
" underline the current line with '-'
nmap <silent> <localleader>- :t.\|s/./-/g\|:nohls<cr>
" set text wrapping toggles
nmap <silent> <leader><Leader>tw :set invwrap<CR>:set wrap?<CR>
" find merge conflict markers
nmap <silent> <leader>fc <ESC>/\v^[<=>]{7}( .*\|$)<CR>
" Adjust viewports to the same size
map <Leader>= <C-w>=
" Default searches to 'very magic', more like the world outside Vim.
" Very magic mode and other seraching info: http://vimcasts.org/episodes/refining-search-patterns-with-the-command-line-window/
" Forward search
nnoremap / /\v
" Backwards search
nnoremap ? ?\v
vnoremap ? ?\v
"" Move by visual screen lines instead of file lines. (aka when navigating wrapped text)
"" http://vim.wikia.com/wiki/Moving_by_screen_lines_instead_of_file_lines
noremap [A gk
noremap [B gj
inoremap [B <C-o>gj
inoremap [A <C-o>gk
" mapping to make movements operate on 1 screen line in wrap mode
function! ScreenMovement(movement)
if &wrap
return "g" . a:movement
else
return a:movement
endif
endfunction
onoremap <silent> <expr> j ScreenMovement("j")
onoremap <silent> <expr> k ScreenMovement("k")
onoremap <silent> <expr> 0 ScreenMovement("0")
onoremap <silent> <expr> ^ ScreenMovement("^")
onoremap <silent> <expr> $ ScreenMovement("$")
nnoremap <silent> <expr> j ScreenMovement("j")
nnoremap <silent> <expr> k ScreenMovement("k")
nnoremap <silent> <expr> 0 ScreenMovement("0")
nnoremap <silent> <expr> ^ ScreenMovement("^")
nnoremap <silent> <expr> $ ScreenMovement("$")
" Tab/shift-tab to indent/outdent in visual mode.
vnoremap <Tab> >gv
vnoremap <S-Tab> <gv
" Keep selection when indenting/outdenting.
vnoremap > >gv
vnoremap < <gv
"NOTES ON ARROW KEYS
"http://od-eon.com/blogs/liviu/macos-vim-controlarrow-functionality/
"arrow keys, up=A, down=B, right=C and left=D
"<C-Up> == <Esc>[A
"END NOTES
" TABS
" ----
function! MoveCurrentTab(value)
if a:value == 0
return
endif
let move = a:value - 1
let move_to = tabpagenr() + move
if move_to < 0
let move_to = 0
endif
exe 'tabmove '.move_to
endfunction
" switch tab order with Ctrl+<left>/<right>
map <Esc>[C :call MoveCurrentTab(1)<Esc>
map <Esc>[D :call MoveCurrentTab(-1)<Esc>
" previous tab(F11), next tab (F12)
nmap <F11> :tabp<CR>
nmap <F12> :tabn<CR>
nmap <localleader>bt :tab sball<CR>
function! MoveToPrevTab()
"there is only one window
if tabpagenr('$') == 1 && winnr('$') == 1
return
endif
"preparing new window
let l:tab_nr = tabpagenr('$')
let l:cur_buf = bufnr('%')
if tabpagenr() != 1
close!
if l:tab_nr == tabpagenr('$')
tabprev
endif
sp
else
close!
exe "0tabnew"
endif
"opening current buffer in new window
exe "b".l:cur_buf
endfunc
function! MoveToNextTab()
"there is only one window
if tabpagenr('$') == 1 && winnr('$') == 1
return
endif
"preparing new window
let l:tab_nr = tabpagenr('$')
let l:cur_buf = bufnr('%')
if tabpagenr() < tab_nr
close!
if l:tab_nr == tabpagenr('$')
tabnext
endif
sp
else
close!
tabnew
endif
"opening current buffer in new window
exe "b".l:cur_buf
endfunc
map <Esc>[B :call MoveToNextTab()<CR>
map <Esc>[A :call MoveToPrevTab()<CR>
" toggle hide numbers
map <leader>1 :set nonumber! number?<CR>
" This allows you to share Vim's clipboard with OS X.
set clipboard=unnamed
" Yank to OS X pasteboard. (Need to have this installed and configured per the
" tmux book by Brian Hogan
" https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard.git)
" Only need this if clipboard=unnamed isn't enabled
"noremap <leader>y "*y
" Triggers align of cucumber tables when you close it out with a | and have at
" least two lines. Thanks tpope :)
function! s:align()
let p = '^\s*|\s.*\s|\s*$'
if exists(':Tabularize') && getline('.') =~# '^\s*|' && (getline(line('.')-1) =~# p || getline(line('.')+1) =~# p)
let column = strlen(substitute(getline('.')[0:col('.')],'[^|]','','g'))
let position = strlen(matchstr(getline('.')[0:col('.')],'.*|\s*\zs.*'))
Tabularize/|/l1
normal! 0
call search(repeat('[^|]*|',column).'\s\{-\}'.repeat('.',position),'ce',line('.'))
endif
endfunction
inoremap <silent> <Bar> <Bar><Esc>:call <SID>align()<CR>a
"folding settings
" ---------------
"" toggle folding with za.
"" fold everything with zM
"" unfold everything with zR.
"" zm and zr can be used too
"set foldmethod=syntax "fold based on syntax (except for haml below)
"set foldnestmax=10 "deepest fold is 10 levels
"set nofoldenable "dont fold by default
"autocmd BufNewFile,BufRead *.haml setl foldmethod=indent nofoldenable
"" Space to toggle folds.
"nnoremap <Space> za
"vnoremap <Space> za
"" Make zO recursively open whatever top level fold we're in, no matter where the
"" cursor happens to be.
"nnoremap zO zCzO
" Buffrgator settings
let g:buffergator_viewport_split_policy="B"
let g:buffergator_split_size=10
let g:buffergator_suppress_keymaps=1
let g:buffergator_sort_regime = "mru"
map <Leader>b :BuffergatorToggle<cr>
" go to the 80th column
noremap <leader>8 80\|
" commands from insert mode
inoremap II <Esc>I
inoremap AA <Esc>A
" Pull up the TODO And NOTE and FIXME definitions from the whole app
let g:TagmaTasksHeight = 10
map <Leader><Leader>tt :TagmaTasks * app/** config/** db/** doc/** features/** lib/** public/** spec/** test/** vendor/**<CR>
let g:TagmaTasksPrefix = '<localleader>t'
" VIMUX CONFIG
"=============
let VimuxHeight = "33" "this is percentage
let VimuxOrientation = "h"
let VimuxUseNearestPane = 1
" Inspect runner pane
map <Leader>vv :InspectVimTmuxRunner<CR>
" Close vim tmux runner opened by RunVimTmuxCommand
map <Leader>vq :CloseVimTmuxRunner<CR>
" If text is selected, save it in the v buffer and send that buffer it to tmux
vmap <Leader>vs "vy :call RunVimTmuxCommand(@v . "\n", 0)<CR>
" Select current paragraph and send it to tmux
nmap <Leader>vs vip<LocalLeader>vs<CR>
" Open vimux split with zflow support
map <Leader>vo :call RunVimTmuxCommand("zflow.native")<CR>
" For running minispec tests of a whole file (sort of focused...)
map <leader>m :call RunVimTmuxCommand('bundle exec ruby -Itest ' . @%,1)<CR>
" Set super tab to start completion with ctrl+j and move down the list with
" more j's, move back with ctrl+k
let g:SuperTabMappingForward = '<c-k>'
let g:SuperTabMappingBackward = '<c-j>'
" Toggle spellcheck with F6 (highlighted and underlined in stark WHITE)
" -----------------
" z= - view spelling suggestions for a misspelled word
" zg - add word to dictionary
" zug - undo add word to dict
hi SpellBad cterm=underline ctermfg=white
nn <F6> :setlocal spell! spell?<CR>
" YankRing plugin to manage yanked/deleted buffers
nnoremap <silent> <F7> :YRShow<CR>
" Scratch plugin for a little temp buffer that will be discarded when
map <leader><tab> :Sscratch <CR>
" STOP the help from being so... HELPFULL ;)
inoremap <F1> <ESC>
nnoremap <F1> <ESC>
vnoremap <F1> <ESC>
" Exit out of insert with jj
inoremap jj <ESC>
" Dig through the tree of undo possibilities for your current file
nnoremap <F3> :GundoToggle<CR>
let g:gundo_right = 1
let g:gundo_preview_bottom=1
let g:gundo_preview_height = 40
" Disable some built in commands I don't like
map K <Nop>
" Ensures color scheme works for the gutter diff indicators
highlight clear SignColumn
" Load up the vimrc_main file (this file) in vim to edit it
nnoremap <Leader>ev :tabnew ~/.vim/vimrc_main<CR>
" Automatically source this file after it's saved
autocmd! bufwritepost .vimrc_main source ~/.vimrc
"From Gary Bernhardt
function! ShowRoutes()
" Requires 'scratch' plugin
:topleft 100 :split __Routes__
" Make sure Vim doesn't write __Routes__ as a file
:set buftype=nofile
" Delete everything
:normal 1GdG
" Put routes output in buffer
:0r! rake -s routes
" Size window to number of lines (1 plus rake output length)
:exec ":normal " . line("$") . "_ "
" Move cursor to bottom
:normal 1GG
" Delete empty trailing line
:normal dd
endfunction
map <leader>gR :call ShowRoutes()<cr>
map <leader>gr :topleft :split config/routes.rb<cr>
map <leader>gg :topleft 100 :split Gemfile<cr>
" From Mislav - Tmux Vim Select Pane
let g:tmux_is_last_pane = 0
au WinEnter * let g:tmux_is_last_pane = 0
" Like `wincmd` but also change tmux panes instead of vim windows when needed.
function! TmuxWinCmd(direction)
let nr = winnr()
let tmux_last_pane = (a:direction == 'p' && g:tmux_is_last_pane)
if !tmux_last_pane
" try to switch windows within vim
exec 'wincmd ' . a:direction
endif
" Forward the switch panes command to tmux if:
" a) we're toggling between the last tmux pane;
" b) we tried switching windows in vim but it didn't have effect.
if tmux_last_pane || nr == winnr()
let cmd = 'tmux select-pane -' . tr(a:direction, 'phjkl', 'lLDUR')
exec 'silent !'.cmd
redraw! " because `exec` fucked up the screen. why is this needed?? arrghh
let g:tmux_is_last_pane = 1
echo cmd
else
let g:tmux_is_last_pane = 0
endif
endfunction
" navigate between split windows/tmux panes
nmap <c-j> :call TmuxWinCmd('j')<cr>
nmap <c-k> :call TmuxWinCmd('k')<cr>
nmap <c-h> :call TmuxWinCmd('h')<cr>
nmap <c-l> :call TmuxWinCmd('l')<cr>
"nmap <c-\> :call TmuxWinCmd('p')<cr>
" Highlight Word
"
" This mini-plugin provides a few mappings for highlighting words temporarily.
"
" Sometimes you're looking at a hairy piece of code and would like a certain
" word or two to stand out temporarily. You can search for it, but that only
" gives you one color of highlighting. Now you can use <leader>N where N is
" a number from 1-6 to highlight the current word in a specific color.
function! HiInterestingWord(n) "
" Save our location.
normal! mz
" Yank the current word into the z register.
normal! "zyiw
" Calculate an arbitrary match ID. Hopefully nothing else is using it.
let mid = 86750 + a:n
" Clear existing matches, but don't worry if they don't exist.
silent! call matchdelete(mid)
" Construct a literal pattern that has to match at boundaries.
let pat = '\V\<' . escape(@z, '\') . '\>'
" Actually match the words.
call matchadd("InterestingWord" . a:n, pat, 1, mid)
" Move back to our original location.
normal! `z
endfunction " }}}
" Mappings
nnoremap <silent> <localleader>1 :call HiInterestingWord(1)<cr>
nnoremap <silent> <localleader>2 :call HiInterestingWord(2)<cr>
nnoremap <silent> <localleader>3 :call HiInterestingWord(3)<cr>
nnoremap <silent> <localleader>4 :call HiInterestingWord(4)<cr>
nnoremap <silent> <localleader>5 :call HiInterestingWord(5)<cr>
nnoremap <silent> <localleader>6 :call HiInterestingWord(6)<cr>
" }}}
" Default Highlights
hi def InterestingWord1 guifg=#000000 ctermfg=16 guibg=#ffa724 ctermbg=214
hi def InterestingWord2 guifg=#000000 ctermfg=16 guibg=#aeee00 ctermbg=154
hi def InterestingWord3 guifg=#000000 ctermfg=16 guibg=#8cffba ctermbg=121
hi def InterestingWord4 guifg=#000000 ctermfg=16 guibg=#b88853 ctermbg=137
hi def InterestingWord5 guifg=#000000 ctermfg=16 guibg=#ff9eb8 ctermbg=211
hi def InterestingWord6 guifg=#000000 ctermfg=16 guibg=#ff2c4b ctermbg=195
"SEARCH OPTIONS
"--------------
" turn highlighting off after a search (and / or turn off highlights)
noremap <silent> <leader><space> :noh<cr>:call clearmatches()<cr>
" Toggle "keep current line in the center of the screen" mode
nnoremap <leader>C :let &scrolloff=999-&scrolloff<cr>
" Jumping to tags.
"
" Basically, <c-]> jumps to tags (like normal) and <c-\> opens the tag in a new
" split instead.
"
" Both of them will align the destination line to the upper middle part of the
" screen. Both will pulse the cursor line so you can see where the hell you
" are. <c-\> will also fold everything in the buffer and then unfold just
" enough for you to see the destination line.
nnoremap <c-]> <c-]>mzzvzz15<c-e>`z:Pulse<cr>
nnoremap <c-\> <c-w>v<c-]>mzzMzvzz15<c-e>`z:Pulse<cr>
" Keep search matches in the middle of the window.
nnoremap n nzzzv
nnoremap N Nzzzv
" Same when jumping around
nnoremap g; g;zz
nnoremap g, g,zz
nnoremap <c-o> <c-o>zz
" Easy filetype switching (good for commenting code in haml filters)
nnoremap _md :set ft=markdown<CR>
nnoremap _hm :set ft=haml<CR>
nnoremap _js :set ft=javascript<CR>
nnoremap _d :set ft=diff<CR>
" Send visual selection to gist.github.com as a private, filetyped Gist
" Requires the gist command line too (brew install gist)
"vnoremap <leader>G :w !gist -p -t %:e \| pbcopy<cr>
vnoremap <leader>G :w !gist -p -t % \| pbcopy<cr>
vnoremap <leader>UG :w !gist -p \| pbcopy<cr>
" Keep the cursor in place while joining lines
nnoremap J mzJ`z
" Make sure Vim returns to the same line when you reopen a file.
augroup line_return
au!
au BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ execute 'normal! g`"zvzz' |
\ endif
augroup END
" <m-j> and <m-k> to drag lines in any mode (m is alt/option)
" this is the textmate move lines around thing that I used to do do with arrow
" keys but less fragile because it works in tmux or not
noremap ∆ :m+<CR>
noremap ˚ :m-2<CR>
inoremap ∆ <Esc>:m+<CR>
inoremap ˚ <Esc>:m-2<CR>
vnoremap ∆ :m'>+<CR>gv
vnoremap ˚ :m-2<CR>gv
" Don't move on * (then you press n to go to the next one)
" the IndexedSearch plugin breaks this capability unfortunately
nnoremap * *<c-o>
augroup ft_markdown
au!
au BufNewFile,BufRead *.m*down setlocal filetype=markdown foldlevel=1
" Use <localleader>1/2/3 to add headings.
au Filetype markdown nnoremap <buffer> <localleader>1 mzI# <ESC>
au Filetype markdown nnoremap <buffer> <localleader>2 mzI## <ESC>
au Filetype markdown nnoremap <buffer> <localleader>3 mzI### <ESC>
augroup END
" Fugitive
nnoremap <leader>gd :Gdiff<cr>
nnoremap <leader>gs :Gstatus<cr>
nnoremap <leader>gw :Gwrite<cr>
nnoremap <leader>ga :Gadd<cr>
nnoremap <leader>gb :Gblame<cr>
nnoremap <leader>gco :Gcheckout<cr>
nnoremap <leader>gci :Gcommit<cr>
nnoremap <leader>gm :Gmove<cr>
nnoremap <leader>gr :Gremove<cr>
" Numbers
" Motion for numbers. Great for CSS. Lets you do things like this:
"
" margin-top: 200px; -> ciN -> margin-top: px;
" ^ ^
" TODO: Handle floats.
onoremap N :<c-u>call <SID>NumberTextObject(0)<cr>
xnoremap N :<c-u>call <SID>NumberTextObject(0)<cr>
onoremap aN :<c-u>call <SID>NumberTextObject(1)<cr>
xnoremap aN :<c-u>call <SID>NumberTextObject(1)<cr>
onoremap iN :<c-u>call <SID>NumberTextObject(1)<cr>
xnoremap iN :<c-u>call <SID>NumberTextObject(1)<cr>
function! s:NumberTextObject(whole)
normal! v
while getline('.')[col('.')] =~# '\v[0-9]'
normal! l
endwhile
if a:whole
normal! o
while col('.') > 1 && getline('.')[col('.') - 2] =~# '\v[0-9]'
normal! h
endwhile
endif
endfunction
" Pulse Line
function! s:Pulse() "
let current_window = winnr()
windo set nocursorline
execute current_window . 'wincmd w'
setlocal cursorline
redir => old_hi
silent execute 'hi CursorLine'
redir END
let old_hi = split(old_hi, '\n')[0]
let old_hi = substitute(old_hi, 'xxx', '', '')
let steps = 9
let width = 1
let start = width
let end = steps * width
let color = 233
for i in range(start, end, width)
execute "hi CursorLine ctermbg=" . (color + i)
redraw
sleep 6m
endfor
for i in range(end, start, -1 * width)
execute "hi CursorLine ctermbg=" . (color + i)
redraw
sleep 6m
endfor
execute 'hi ' . old_hi
endfunction " }}}
command! -nargs=0 Pulse call s:Pulse()
set encoding=utf-8
set rtp+=~/.vim/bundle/powerline/powerline/bindings/vim
let g:powerline_config_overrides={"ext": {"vim": {"colorscheme": "solarized"}}}
let g:InteractiveReplace_map = 'X'
"let g:signify_sign_color_guibg = '#032b36'
let g:signify_sign_color_inherit_from_linenr = 1
let g:signify_sign_weight = 'NONE'
let g:signify_update_on_bufenter = 0
" Reveal in Finder - opens finder to folder of the file that is currently open
command! Rif execute '!open %:p:h'
set formatoptions=1
set linebreak
set breakat=\ ^I!@*-+;:,./?\(\[\{
set nocompatible " be iMproved
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" let Vundle manage Vundle
" required!
Bundle 'gmarik/vundle'
" project wide search
Bundle 'mileszs/ack.vim'
" cmd-t replacement
Bundle 'kien/ctrlp.vim'
" comment multiple lines
Bundle 'scrooloose/nerdcommenter'
" project drawer
Bundle 'scrooloose/nerdtree'
" tab completion like textmate for snippets
Bundle 'garbas/vim-snipmate'
" vim-snipmate dependency
Bundle 'tomtom/tlib_vim'
" vim-snipmate dependency
Bundle 'MarcWeber/vim-addon-mw-utils'
" vim-snipmate dependency
Bundle 'honza/vim-snippets'
" TODO think about removing this
Bundle 'ervandew/supertab'
" syntax checking on save
Bundle 'scrooloose/syntastic'
" aligning => stuff
Bundle 'tsaleh/vim-align'
" drawer showing ctags
Bundle 'majutsushi/tagbar'
" easily switch between buffers
Bundle 'jeetsukumaran/vim-buffergator'
" enabled .feature files
Bundle 'tpope/vim-cucumber'
" <leader><leader>w jump to highlighted word
Bundle 'Lokaltog/vim-easymotion'
" auto adds end to method definitions, blocks, etc
Bundle 'tpope/vim-endwise'
" git wrapper
Bundle 'tpope/vim-fugitive'
" some vim runtime files that are more up to date than those distributed with vim itself
Bundle 'tpope/vim-git'
" enabled .haml extension
Bundle 'tpope/vim-haml'
" show indent guides to the left of the methods
Bundle 'nathanaelkane/vim-indent-guides'
" some nice text wrappers for editing erb or html, ctrl+x in insert mode then type = or - or @ or #,etc
Bundle 'tpope/vim-ragtag'
" essential rails plugin for navigating a rails proj
Bundle 'tpope/vim-rails'
" edit ruby in vim
Bundle 'vim-ruby/vim-ruby'
" easily change what something is surrounded by
Bundle 'tpope/vim-surround'
" repeat surround (and other) changes with .
Bundle 'tpope/vim-repeat'
" allows for moving blocks of text up and down in place like you could in textmate
Bundle 'tpope/vim-unimpaired'
" theme
Bundle 'altercation/vim-colors-solarized'
" lets you ctrl+w+o to toggle out a split to it's own buffer (easily can go back with the same command)
Bundle 'vim-scripts/ZoomWin'
" highlight code and send to pastie service
Bundle 'tpope/vim-pastie'
" send vim commands (or text) to adjacent tmux pane
Bundle 'benmills/vimux'
" sends focused tests to vimux with <leader>t
Bundle 'jgdavey/vim-turbux'
" show project wide list of TODO, NOTE, FIXME
Bundle 'LStinson/TagmaTasks'
" strip trailing whitespace on save
Bundle 'itspriddle/vim-stripper'
" enable coffeescript
Bundle 'kchmck/vim-coffee-script'
" highlights Gemfile and wraps bundle open
Bundle 'tpope/vim-bundler'
" tig inside of vim with more power to traverse file history
Bundle 'gregsexton/gitv'
" refactor model names
Bundle 'tpope/vim-abolish'
" cycle through yanks/deletes in a visual window or after pasting
Bundle 'vim-scripts/YankRing.vim'
" have a scratch pad to paste code temporairily or write notes
Bundle 'duff/vim-scratch'
" undo tree history navigation
Bundle 'sjl/gundo.vim'
" dependency of gist-vim
Bundle 'mattn/webapi-vim'
" better vertical column selection / changing (vic will visual in column)
Bundle 'coderifous/textobj-word-column.vim'
" show diff in the left gutter
Bundle 'airblade/vim-gitgutter'
" intelligent session management. Auto writes changes when opening splits or quitting Vim
Bundle 'tpope/vim-obsession'
" makes NERDTree awesome if you use tabs
Bundle 'jistr/vim-nerdtree-tabs'
" gives a count of the number of matches and which one you're on
Bundle 'henrik/vim-indexed-search'
" ensures windows are at least 80 chars wide
Bundle 'justincampbell/vim-eighties'
" lets you type new things for each search replacement
Bundle 'hwrod/interactive-replace'
" navigate with C-h/j/k/l in tmux and vim
Bundle 'christoomey/vim-tmux-navigator'
" like sublime multiple cursors
Bundle 'terryma/vim-multiple-cursors'
" powerline for tmux/vim
Bundle 'Lokaltog/powerline'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment