Skip to content

Instantly share code, notes, and snippets.

@cloud8421
cloud8421 / how_to.md
Created September 18, 2012 15:03
Vim and Tmux workshop - 06 - Tmux and Vim

Setup

The following setup is pretty custom, but works pretty good for me.

The only caveat is that it requires a version of Vim compiled with ruby support, so you need to install it through Homebrew:

brew install macvim --override-system-vim

Next, you need to install a few plugins:

@cloud8421
cloud8421 / run_tmux_copy
Created September 18, 2012 14:52
Vim and Tmux workshop - 06 - Tmux
/usr/local/bin/tmux_copy &
@cloud8421
cloud8421 / rails_vim_and_ctags.md
Created September 18, 2012 14:36
Vim and Tmux workshop - 05 - Working with Rails

Working with Rails tips and tricks

Navigation

  • Pressing gf is usually a good shortcut to open a file:
    • on model names (as symbols or class names) will take you to the file
    • on partial calls it will open the partial
  • Pressing :R<tab> will give you all available commands
  • :R commands can be customized, see these custom extensions for Backbone
@cloud8421
cloud8421 / pathogen_how_to.md
Created September 18, 2012 10:34
Vim and Tmux workshop - 03 - How to use Pathogen

First step is creating a dotfiles directory:

cd ~/dev/
mkdir dotfiles

Then we move and symlink our .vimrc file":

mv ~/.vimrc dotfiles/vimrc
ln -s ~/dev/dotfiles/vimrc ~/.vimrc
@cloud8421
cloud8421 / plugins.md
Created September 18, 2012 10:21
Vim and Tmux workshop - 02 - Functionality

Vim provides a lot of functionality out of the box, however some plugins are extremely powerful and can make everything even better. Here are some:

  • Ctrlp: fuzzy finder, supports file and tag based search.
  • Snipmate: heavily inspired by Textmate, tab completion based on snippet files that can be language specific.
  • The silver searcher: vim bindings for the crazy fast ack alternative.
  • TComment: toggle comments in any language.
@cloud8421
cloud8421 / .vimrc
Created September 18, 2012 10:02
Vim and Tmux workshop - 01 - A basic .vimrc
set nocompatible
set nobackup
set nowritebackup
set notimeout
set ttimeout
set ttimeoutlen=10
set noswapfile
set history=50
set ruler
set showcmd
@cloud8421
cloud8421 / rails.rb
Created August 10, 2012 13:53
Tlux sample
# Declare you configuration in this file, below is a quick sample of what
# is possible.
#
window :editor do
split :vertical, percentage: 90 do
command "vim"
end
end
window :logs do
@cloud8421
cloud8421 / gist:3121704
Created July 16, 2012 09:11 — forked from olivernn/gist:3121642
tlux dsl
name "rails"
description "rails development environment"
window "editor", selected: true do
command "vim ."
split :horizontal, height: 20
split :vertical do
dir "~/code/hotrod"
@cloud8421
cloud8421 / bootstrap-chef.sh
Last active October 6, 2015 08:38
Bootstrap Puppet/Chef on Ubuntu 11.04 and Ruby 1.9.3
#!/usr/bin/env bash
sudo apt-get -y update
sudo apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p374.tar.gz
tar -xvzf ruby-1.9.3-p374.tar.gz
cd ruby-1.9.3-p374/
./configure --prefix=/usr/local
make
sudo make install
@cloud8421
cloud8421 / chef_solo_bootstrap.sh
Created June 16, 2012 18:32 — forked from cjoudrey/chef_solo_bootstrap.sh
Bootstrap Chef Solo (Ubuntu 12.04)
#!/usr/bin/env bash
sudo apt-get -y update
sudo apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz
tar -xvzf ruby-1.9.3-p194.tar.gz
cd ruby-1.9.3-p194/
./configure --prefix=/usr/local
make
sudo make install