Skip to content

Instantly share code, notes, and snippets.

@jbosse
Created February 23, 2016 18:28
Show Gist options
  • Save jbosse/8a56690883a7ec8114b9 to your computer and use it in GitHub Desktop.
Save jbosse/8a56690883a7ec8114b9 to your computer and use it in GitHub Desktop.
Steps for setting up vim and gnu screen for rails development the way I like it.

Development Term Setup

Install Pathogen to Vim

mkdir -p ~/.vim/autoload ~/.vim/bundle && \
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim

Modify ~/.vimrc

execute pathogen#infect()
syntax on
filetype plugin indent on
set ts=2 sts=2 sw=2
set expandtab

Install Rails plugin for Vim

cd ~/.vim/bundle
git clone git://github.com/tpope/vim-rails.git
git clone git://github.com/tpope/vim-bundler.git

Install GNU Screen

sudo apt-get update
sudo apt-get install screen

Modify ~/.screenrc

# the following two lines give a two-line status, with the current window highlighted
hardstatus alwayslastline
hardstatus string '%{= kG}[%{G}%H%? %1`%?%{g}][%= %{= kw}%-w%{+b yk} %n*%t%?(%u)%? %{-}%+w %=%{g}][%{B}%m/%d %{W}%C%A%{g}]'

# huge scrollback buffer
defscrollback 5000

# no welcome message
startup_message off

# 256 colors
attrcolor b ".I"
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
defbce on

# mouse tracking allows to switch region focus by clicking
mousetrack on

# default windows
screen -t Vim1    1 bash --login
screen -t Vim2    2 bash --login
screen -t Git     3 bash --login
screen -t RailsC  4 bash --login
screen -t RailsS  5 bash --login
screen -t Guard   6 bash --login

#select 0
bind c screen 1 # window numbering starts at 1 not 0
bind 0 select 10

# get rid of silly xoff stuff
bind s split

# layouts
layout autosave on
layout new one
select 1
split
focus down
resize 20
split -v
split
select 3
focus down
select 4
focus right
split
select 6
focus down
select 5
focus up
focus up
split -v
focus right
select 2

bind j focus down
bind k focus up
bind h focus left
bind l focus right
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment