Make it a point to be able to use the keyboard as much as you can. In OS X the spotlight is great for this. By default the spotlight hotkey is Cmd+Space
. Make it a point to try and always use iTerm in fullscreen. Remember that your tmux prefix is set to Ctrl+z
- Open iTerm with spotlight with
Cmd+Space
search iTerm and open with Enter - Fullscreen iTerm with
Cmd+Enter
- Pop out of iTerm with the hotkey you added
Ctrl+Enter
- Pop back into iTerm with
Ctrl+Enter
again - Nagivate to your intended project directory
- Check for running tmux sessions with
tmux ls
(Failed to connect to server just means no tmux sessions yet) - Start a named tmux session with
tmux new -s myprojectname
- Detach from that session with
prefix d
- List tmux sessions again with
tmux ls
- Connect to your detatched, running session with
tmux att -t myprojectname
- Split your screen vertically with
prefix %
or use the aliasprefix |
- Move the split border so that the pane on the right occupies about 80% screen real estate with
prefix H
orprefix L
- Move between the vertical splits with
prefix h
orprefix l
- Open vim in the large pane. In your project directory run
vim .
- Keep the smaller pane of this window free for test output and running rake tasks or git commands
- Open a new window with
prefix c
- Split this window vertically with
prefix %
orprefix |
- In the pane on the left run
rails c
and in the pane on the right runrails s
ortail -f log/development.log
when using POW - Go forward and backward between your two windows with
prefix n
(next) andprefix p
(previous), with only two windows it doesn't matter too much which. - Learn the vim-rails commands for navigation https://github.com/tpope/vim-rails
- Learn how
:Econtroller
,:Emodel
,:Eview
work to find files. Note that you can type:Eco
and tab for example. - Create a new model with
:Emodel my_new_model!
- Create a new controller with
:Econtroller my_new_controller!
- Create a new view with
:Eview path/to/my_new_view.html.erb!
- Jump from a controller action to its view template with
:Eview
from inside the controller action - Jump from a view template to its controller with
:Econtroller
- Jump from a model or controller to its test with
:A
- Open an alternate file in a new vertical split with
:AV
- Open an alternate file in a new horizontal split with
:AS
- Open a model in a new tab with
:Tmodel
and the model name - Nagivate splits in vim with the prefix
Ctrl+w
and then one ofh,j,k,l
- Nagivate tabs in vim with
gt
andgT
- Open a controller in a horizonal split with
:Scontroller
and the controller name - Remember you can always open or create new files with the standard vim command
:e
followed by a space and a filename with or without a relative path.