Tags
webcam vindaloo vim version vegan unix unicef trojan todo tmux thinkpad textmate testing tagging syntax svn sugar subversion stubbing sphinx spam spaces solaris sitemap site sinatra shoulda sheet set security search schema_info SchemaInfo ruby rinari restaurant relationships refresh rdiff-backup ramaze railsconf08 railsconf07 rails protools production power placeboeffect pink floyd PIC perl overheat outbreak osx os x NYHS NYC nginx netbeans nested nanophotonics mysql music MPEG-4 mongrel model migration microvolunteer macbook mac logrotate logic log linux less leopard keynote JAX javascript java jacksonville iterm2 iterm imunizator highlighting hanna Handbrake haml hacks google geocoding genghistron gem gaming gabrielle's funny functional fun friends food fixesThe Decider said over 2 years ago permalink Comment? (1)
Tagged: tmux vim iterm iterm2
iTerm2, tmux and vim
Switching up my development environment.
Recently I came across some posts describing tmux, a gnu/screen alternative. I use screen quite a bit but only when doing remote system admin and really enjoy it’s features. Especially being able to attach to a session that was terminated due to connectivity problems.
I had never given a second thought about using screen on my dev machine since
Anyway, there are 3 tools needed to make this work on my Mac.
iTerm2
Probably any terminal will do but iTerm2 is much faster at resizing than iTerm and is actively being developed.
tmux
This is a terminial multiplexor with many of the features of gnu/screen but in my opinion easier to configure. Recommended Tutorial The port version is a bit dated so I recommend installing from source. Follow the instructions. It’s your basic configure, make, make install.
vim
Now normally I run MacVim on my mac. It’s pretty. The console version courtesy of Apple seems just fine. It reads my .vimrc with no issues and behaves just great with Tim Pope’s Rails plugin.
Modifying my Behavior
This is the hardest part of the switch. I really hate my mouse and really thought that I had shun using it for many years now. However, I find myself reaching for it to switch windows when a command-tab is easier. It’s strange if I’m in my terminal I always command-tab to chrome but for some reason reach for the mouse when switching to macvim. Now that macvim is no longer in the equation I still find myself reaching for the mouse to move from my bash tmux pane to my vim pane.
Speaking of panes I run tmux full screen divided into 3 panes.
my .tmux.conf file:
set -g prefix C-a unbind C-b bind C-a send-prefix bind-key C-a last-window # Set status bar set -g status-bg blue set -g status-fg white # Highlight active window set-window-option -g window-status-current-bg red # Automatically set window title setw -g automatic-rename # use "v" and "s" to do vertical/horizontal splits, like vim bind s split-window -v bind v split-window -h # use the vim motion keys to move between panes bind h select-pane -L bind j select-pane -D bind k select-pane -U bind l select-pane -R # use vim motion keys while in copy mode setw -g mode-keys vi # force a reload of the config file unbind r bind r source-file ~/.tmux.conf # # # quick pane cyclingunbind ^A bind ^A select-pane -t :.+
Comments
Andrew said over 2 years ago
Now just split it some more for Finch and Lynx. You won’t even need a window manager!
