Skip to content

Instantly share code, notes, and snippets.

@drmats
Last active February 9, 2018 15:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drmats/4b4f8167e75b36910ddda084c852ee8b to your computer and use it in GitHub Desktop.
Save drmats/4b4f8167e75b36910ddda084c852ee8b to your computer and use it in GitHub Desktop.
tmux
source "/usr/share/tmux/powerline.conf"
# remap prefix to Control + a
set -g prefix C-a
unbind C-b
bind C-a send-prefix
# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf
# quick pane cycling
# unbind ^A
# bind ^A select-pane -t :.+
# open new window/pane in the same working directory
bind-key c new-window -c "#{pane_current_path}"
bind-key % split-window -h -c "#{pane_current_path}"
bind-key '"' split-window -v -c "#{pane_current_path}"
@drmats
Copy link
Author

drmats commented Sep 21, 2017

dnf install tmux tmux-powerline

@drmats
Copy link
Author

drmats commented Sep 21, 2017

^a then c - create a new window
^a then d - detach session
^a then n - switch to the next window
^a then , then [type something] then [enter] - rename the current window
^a then % - split the current window into panes vertically
^a then " - split the current window into panes horizontally
^a then ↑ to move to the above pane (works for all four arrows)
^a then q - show pane numbers, then (optionally) the number to switch to that pane
^a then [alt]+↑ - resize the current pane up (works for all four arrows)
^a then x - kill the current pane (or window if it only has one pane)
^a then [ - enter copy mode, then four arrow keys to move, [ctrl]+[space] - enter block mode, [alt]+w - copy
^a then ] - paste buffer

@drmats
Copy link
Author

drmats commented Sep 21, 2017

tmux list-sessions
tmux attach-session -t [number]
tmux show-buffer

@drmats
Copy link
Author

drmats commented Nov 16, 2017

# .bashrc

if [ -f `which powerline-daemon` ]; then
  powerline-daemon -q
  POWERLINE_BASH_CONTINUATION=1
  POWERLINE_BASH_SELECT=1
  . /usr/share/powerline/bash/powerline.sh
fi

@drmats
Copy link
Author

drmats commented Nov 20, 2017

^a then w - list windows
^a then t - big clock

tmux list-sessions = tmux ls
tmux attach-session = tmux a

@drmats
Copy link
Author

drmats commented Jan 4, 2018

^a : setw synchronize-panes on
^a : setw synchronize-panes off

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment