Skip to content

Instantly share code, notes, and snippets.

@ozgun
Last active April 28, 2016 13:03
Show Gist options
  • Save ozgun/214e27b54a02e6497bc9f7b1bbf9584a to your computer and use it in GitHub Desktop.
Save ozgun/214e27b54a02e6497bc9f7b1bbf9584a to your computer and use it in GitHub Desktop.
# $Id: vim-keys.conf,v 1.2 2010-09-18 09:36:15 nicm Exp $
#
# vim-keys.conf, v1.2 2010/09/12
#
# By Daniel Thau. Public domain.
#
# This configuration file binds many vi- and vim-like bindings to the
# appropriate tmux key bindings. Note that for many key bindings there is no
# tmux analogue. This is intended for tmux 1.3, which handles pane selection
# differently from the previous versions
# use UTF8
set -g utf8
set-window-option -g utf8 on
# tmux ve neovim'de colorscheme kullanabilmek icin.
set -g default-terminal "screen-256color"
# split windows like vim
# vim's definition of a horizontal/vertical split is reversed from tmux's
bind s split-window -v
bind v split-window -h
# splitting panes
#bind | split-window -h -c '#{pane_current_path}'
#bind - split-window -c '#{pane_current_path}'
#bind '"' split-window -c '#{pane_current_path}'
#bind c new-window -c '#{pane_current_path}'
# move around panes with hjkl, as one would in vim after pressing ctrl-w
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# resize panes like vim
# feel free to change the "1" to however many lines you want to resize by, only
# one at a time can be slow
bind < resize-pane -L 1
bind > resize-pane -R 1
bind - resize-pane -D 1
bind + resize-pane -U 1
# bind : to command-prompt like vim
# this is the default in tmux already
#bind : command-prompt
# vi-style controls for copy mode
setw -g mode-keys vi
#set -g status-keys vi
# Set the base index for windows to 1 instead of 0
#set -g base-index 1
# Set the base index for panes to 1 instead of 0
#setw -g pane-base-index 1
# session initialization
new -s tmux
neww -d -t 1 -n 'editor'
neww -d -t 2 -n 'cons'
neww -d -t 3 -n 'db'
neww -d -t 4 -n 'core'
neww -d -t 5 -n 'server'
neww -d -t 6 -n 'sh'
neww -d -t 7 -n 'sh'
neww -d -t 8 -n 'sh'
neww -d -t 9 -n 'sh'
#neww -d -t 1 -n 'server'
#neww -d -t 2 -n 'cons'
#neww -d -t 3 -n 'db'
#neww -d -t 4 -n 'sh'
#neww -d -t 5 -n 'sh'
#neww -d -t 6 -n 'sh'
#neww -d -t 7 -n 'sh'
#neww -d -t 8 -n 'sh'
#neww -d -t 9 -n 'sh'
selectw -t 1
# Bind function keys.
bind -n M-1 select-window -t 1
bind -n M-2 select-window -t 2
bind -n M-3 select-window -t 3
bind -n M-4 select-window -t 4
bind -n M-5 select-window -t 5
bind -n M-6 select-window -t 6
bind -n M-7 select-window -t 7
bind -n M-8 select-window -t 8
bind -n M-9 select-window -t 9
bind -n M-0 select-window -t 0
# statusbar --------------------------------------------------------------
set -g display-time 2000
# default statusbar colors
set -g status-fg white
#set -g status-bg default
set -g status-bg colour235
set -g status-attr default
# default window title colors
set-window-option -g window-status-fg cyan
set-window-option -g window-status-bg default
set-window-option -g window-status-attr dim
# active window title colors
set-window-option -g window-status-current-fg white
set-window-option -g window-status-current-bg default
set-window-option -g window-status-current-attr bright
# command/message line colors
set -g message-fg white
set -g message-bg black
set -g message-attr bright
# center align the window list
#set -g status-justify centre
set -g bell-action none
# reload ~/.tmux.conf using PREFIX r
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# Log output to a text file on demand
#bind P pipe-pane -o "cat >>~/#W.log" \; display "Toggled logging to ~/#W.log"
# Copy
#bind C-c run "tmux save-buffer - | xclip -i -sel clipboard"
# Pasta
#bind C-v run "tmux set-buffer \"$(xclip -o -sel clipboard)\"; tmux paste-buffer"
# Center the window list
set -g status-justify centre
# Quick pane selection
bind -r C-h select-window -t :-
bind -r C-l select-window -t :+
# mouse support - set to on if you want to use the mouse
# setw -g mode-mouse on
# set -g mouse-select-pane on
# set -g mouse-resize-pane on
# set -g mouse-select-window on
#set -g set-titles on
#set -g set-titles-string "#T"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment