Skip to content

Commit

Permalink
tmux configs
Browse files Browse the repository at this point in the history
  • Loading branch information
cursorzz committed Jul 22, 2012
1 parent ed9794e commit 96be198
Show file tree
Hide file tree
Showing 2 changed files with 137 additions and 0 deletions.
114 changes: 114 additions & 0 deletions .tmux.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# $Id: screen-keys.conf,v 1.7 2010-07-31 11:39:13 nicm Exp $
#
# By Nicholas Marriott. Public domain.
#
# This configuration file binds many of the common GNU screen key bindings to
# appropriate tmux key bindings. Note that for some key bindings there is no
# tmux analogue and also that this set omits binding some commands available in
# tmux but not in screen.
#
# Note this is only a selection of key bindings and they are in addition to the
# normal tmux key bindings. This is intended as an example not as to be used
# as-is.

# Set the prefix to ^A.
unbind C-b
set -g prefix ^A
bind a send-prefix

# Bind appropriate commands similar to screen.
# lockscreen ^X x
unbind ^X
bind ^X lock-server
unbind x
bind x lock-server

# screen ^C c
unbind ^C
bind ^C new-window
unbind c
bind c new-window

# detach ^D d
unbind ^D
bind ^D detach

# displays *
unbind *
bind * list-clients

# next ^@ ^N sp n
unbind ^@
bind ^@ next-window
unbind ^N
bind ^N next-window
unbind " "
bind " " next-window
unbind n
bind n next-window

# title A
unbind A
bind A command-prompt "rename-window %%"

# other ^A
unbind ^A
bind ^A last-window

# prev ^H ^P p ^?
unbind ^H
bind ^H previous-window
unbind ^P
bind ^P previous-window
unbind p
bind p previous-window
unbind BSpace
bind BSpace previous-window

# windows ^W w
unbind ^W
bind ^W list-windows
unbind w
bind w list-windows

# quit \
#unbind \
#bind \ confirm-before "kill-server"

# kill K k
unbind K
bind K confirm-before "kill-window"
unbind k
bind k confirm-before "kill-window"

# redisplay ^L l
unbind ^L
bind ^L refresh-client
unbind l
bind l refresh-client

# split -v -
unbind -
unbind %
bind - split-window
# split -h |
unbind |
bind | split-window -h

# :kB: focus up
unbind Tab
bind Tab select-pane -t:.+
unbind BTab
bind BTab select-pane -t:.-

# " windowlist -b
unbind '"'
bind '"' choose-window

#-----------------------------
#app
set -g automatic-rename off

#set color to 256
set -g default-terminal "screen-256color"#"screen-256color"
set -g base-index 1
23 changes: 23 additions & 0 deletions bin/ztmux
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh

cmd=$(which tmux)
session=zzpc

if [ -z $cmd ];then
echo "You need to install tmux first"
exit 1
fi

$cmd has -t $session

if [ $? != 0 ]; then
$cmd -2 new -d -n vim -s $session "vim"
$cmd splitw -v -p 20 -t $session "pry"
$cmd neww -n cmus -t $session "cmus"
$cmd neww -n htop -t $session "htop"
$cmd selectw -t $session:1

fi

$cmd att -t $session
exit 0

0 comments on commit 96be198

Please sign in to comment.