2010-05-06 10:19:54 +02:00
|
|
|
# $Id: vim-keys.conf,v 1.1 2010/01/17 16:24:09 nicm Exp $
|
|
|
|
#
|
|
|
|
# vim-keys.conf, v1.0 2010/01/15
|
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
2020-06-24 23:23:52 +02:00
|
|
|
# prefix is CTRL-B and CTRL-X
|
|
|
|
set -g prefix C-b
|
|
|
|
set -g prefix2 C-x
|
|
|
|
|
|
|
|
# enable CTRL-B and CTRL-X under other programs (like vim) - you'll have to press twice le combination to have the old one
|
|
|
|
bind C-b send-prefix
|
|
|
|
bind C-x send-prefix
|
|
|
|
|
2010-05-06 10:19:54 +02:00
|
|
|
# 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
|
|
|
|
|
|
|
|
# move around panes with j and k, a bit like vim
|
|
|
|
# as of tmux 1.1, there is no way to move based on pane position (ie, no way to
|
|
|
|
# move the pane to the right)
|
2013-02-25 17:15:03 +01:00
|
|
|
#bind j down-pane
|
|
|
|
#bind k up-pane
|
2010-05-06 10:19:54 +02:00
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
|
# Change the prefix key (screen friendly).
|
|
|
|
#set-option -g prefix C-a
|
|
|
|
#unbind-key C-b
|
|
|
|
#bind-key C-a last-window
|
|
|
|
|
|
|
|
# set-option -g default-terminal "screen-256color"
|
|
|
|
set-option -g status-keys vi
|
|
|
|
set-option -g bell-action any
|
|
|
|
set-option -g set-titles on
|
|
|
|
set-option -g set-titles-string '#H:#S.#I.#P #W #T'
|
|
|
|
set-option -g visual-bell on
|
|
|
|
|
2016-05-23 14:59:23 +02:00
|
|
|
#set-option -g -q mouse on
|
|
|
|
#bind-key -T root PPage if-shell -F "#{alternate_on}" "send-keys PPage" "copy-mode -e; send-keys PPage"
|
|
|
|
#bind-key -t vi-copy PPage page-up
|
|
|
|
#bind-key -t vi-copy NPage page-down
|
|
|
|
|
2016-09-01 10:11:55 +02:00
|
|
|
set-window-option -g xterm-keys on
|
|
|
|
|
2016-05-23 14:59:23 +02:00
|
|
|
set -g mouse on
|
|
|
|
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
|
|
|
|
bind -n WheelDownPane select-pane -t= \; send-keys -M
|
2015-12-08 14:59:00 +01:00
|
|
|
|
2010-05-06 10:19:54 +02:00
|
|
|
setw -g mode-keys vi
|
|
|
|
setw -g monitor-activity on
|
|
|
|
|
|
|
|
bind C-j previous-window
|
|
|
|
bind C-k next-window
|
|
|
|
|
2019-09-05 15:38:01 +02:00
|
|
|
#bind -n M-Left select-pane -L
|
|
|
|
#bind -n M-Right select-pane -R
|
|
|
|
#bind -n M-Up select-pane -U
|
|
|
|
#bind -n M-Down select-pane -D
|
|
|
|
|
|
|
|
# Smart pane switching with awareness of Vim splits.
|
|
|
|
# See: https://github.com/christoomey/vim-tmux-navigator
|
|
|
|
bind -n M-Up if "[ $(tmux display -p '#{pane_current_command}') = vim ]" "send-keys M-Up" "select-pane -U"
|
|
|
|
bind -n M-Down if "[ $(tmux display -p '#{pane_current_command}') = vim ]" "send-keys M-Down" "select-pane -D"
|
|
|
|
bind -n M-Left if "[ $(tmux display -p '#{pane_current_command}') = vim ]" "send-keys M-Left" "select-pane -L"
|
|
|
|
bind -n M-Right if "[ $(tmux display -p '#{pane_current_command}') = vim ]" "send-keys M-Right" "select-pane -R"
|
|
|
|
|
|
|
|
bind -n C-Right if "[ $(tmux display -p '#{pane_current_command}') = vim ]" "send-keys C-Right" "next-window"
|
2019-09-13 11:26:04 +02:00
|
|
|
bind -n C-Left if "[ $(tmux display -p '#{pane_current_command}') = vim ]" "send-keys C-Left" "previous-window"
|
2019-09-05 15:38:01 +02:00
|
|
|
|
2016-05-04 00:30:30 +02:00
|
|
|
#set-option -g status-utf8 on
|
2010-05-06 10:19:54 +02:00
|
|
|
set-option -g status-justify left
|
|
|
|
set-option -g status-bg black
|
|
|
|
set-option -g status-fg white
|
|
|
|
set-option -g status-left-length 40
|
|
|
|
|
2019-05-07 11:55:00 +02:00
|
|
|
set-option -g pane-active-border-style fg=green,bg=black
|
|
|
|
set-option -g pane-border-style fg=white,bg=black
|
2010-05-06 10:19:54 +02:00
|
|
|
|
2019-05-07 11:55:00 +02:00
|
|
|
set-option -g message-style fg=black,bg=green
|
2010-05-06 10:19:54 +02:00
|
|
|
|
2019-05-07 11:55:00 +02:00
|
|
|
setw -g window-status-style bg=black
|
|
|
|
setw -g window-status-current-style fg=green
|
2010-05-06 10:19:54 +02:00
|
|
|
|
|
|
|
set -g status-left '#[fg=red]#H#[fg=green]:#[fg=white]#S #[fg=green]][#[default]'
|
|
|
|
|
|
|
|
# this one draws the window title in the status bar, but eats up a lot of space
|
|
|
|
# set -g status-right '#[fg=green]][#[fg=white] #T #[fg=green]][ #[fg=blue]%Y-%m-%d #[fg=white]%H:%M#[default]'
|
|
|
|
set -g status-right '#[fg=green]][ #[fg=blue]%Y-%m-%d #[fg=white]%H:%M#[default]'
|
|
|
|
|
2018-03-09 16:08:53 +01:00
|
|
|
#Scroll up
|
|
|
|
bind -n S-Pageup copy-mode -u
|
|
|
|
|
2016-05-23 14:59:23 +02:00
|
|
|
# Scroll History
|
|
|
|
set -g history-limit 30000
|
2010-05-06 10:19:54 +02:00
|
|
|
|
2015-12-08 14:59:32 +01:00
|
|
|
#improve communication with vim
|
|
|
|
set -g focus-events on
|
|
|
|
|
2016-05-23 14:59:23 +02:00
|
|
|
#New pane in same directory
|
|
|
|
bind c new-window -c "#{pane_current_path}"
|
|
|
|
|
2010-05-06 10:19:54 +02:00
|
|
|
bind r source-file ~/.tmux.conf
|
2020-06-24 23:23:52 +02:00
|
|
|
|
|
|
|
# number windows starting from 1 - handy for direct access
|
|
|
|
set -g base-index 1
|
|
|
|
|
|
|
|
# Configure tmux buffer to clipbard
|
|
|
|
#setw -g mode-keys vi
|
|
|
|
#bind-key -T copy-mode-vi v send-keys -X begin-selection
|
|
|
|
#bind -T copy-mode-vi y send-keys -X copy-pipe 'xclip -in -selection clipboard'
|