#+TITLE: tmux #+SUBTITLE: #+DATE: <2024-07-12 Fri> #+AUTHOR: Tuomas Pyyhtiä #+EMAIL: pyyhttu+tmux@pm.me #+DESCRIPTION: Setting up tmux #+KEYWORDS: tmux #+LANGUAGE: en # Don't show table of contents, export underscore as underscore instead of # highlight in HTML (was: ^:nil), include priority cookies: #+OPTIONS: toc:nil ':t pri:t # Rest of options (as explained here: https://orgmode.org/manual/Export-Settings.html): #+OPTIONS: num:nil p:nil stat:t tags:t tasks:t tex:t timestamp:t #+BEGIN_COMMENT #+PROPERTY: header-args :eval never-export :exports both :results replace #+END_COMMENT # Include usable macros from https://github.com/fniessen/org-macros: #+INCLUDE: ../org-mode/macros/org-macros.setup #+BEGIN_COMMENT #+INFOJS_OPT: view:content ltoc:nil path:../org-mode/js/org-info.js # for more info see: https://orgmode.org/worg/code/org-info-js #+END_COMMENT #+HTML_HEAD: #+TOC: headlines 2 * Install ~$ sudo aptitude install tmux~ * Configure =~/.tmux.conf= #+begin_src bash # See default configurations by doing 'tmux show -g' inside tmux # See default key bindings by pressing 'C-b ?' # To test changes to ~/.tmux.conf, do inside tmux session 'tmux source-file ~/.tmux.conf' # Configurations set -g default-terminal "screen-256color" # Support full color palette set -g base-index 1 # tmux indexes windows from 0. Start from 1. setw -g pane-base-index 1 # Custom key bindings unbind C-b # Change prefix key C-b to C-a (as in screen) set-option -g prefix C-a bind-key C-a send-prefix # Default key bindings (most used) # Press prefix C-a first. bind-key % split-window -h # Split window vertically bind-key '"' split-window # Split window horizontally bind-key -r Up select-pane -U # Select top pane bind-key -r Down select-pane -D # Select bottom pane bind-key -r Left select-pane -L # Select left pane bind-key -r Right select-pane -R # Select right pane bind-key -r M-Up resize-pane -U 5 # Resize pane bind-key -r M-Down resize-pane -D 5 # Resize pane bind-key -r M-Left resize-pane -L 5 # Resize pane bind-key -r M-Right resize-pane -R 5 # Resize pane bind-key C-o rotate-window # Switch two panes bind-key c new-window # Create new window (exit it by doing 'exit') bind-key n next-window # Next window bind-key p previous-window # Previous window #+end_src * DONE Tmux Plugin Manager Tmux functionalities can be broadened with [[https://github.com/tmux-plugins/list][plugins]]. Plugins can be installed either manually or with [[https://github.com/tmux-plugins/tpm][Tmux Plugin Manager]]. Install Tmux Plugin Manager by doing: ~$ git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm~ Then add the following at the bottom of =~/.tmux.conf=: #+begin_src bash # Tmux Plugin Manager set -g @plugin 'tmux-plugins/tpm' # Tmux-sensible settings set -g @plugin 'tmux-plugins/tmux-sensible' # Theme for Tmux set -g @plugin 'sei40kr/tmux-airline-dracula' # Run Tpm run -b '~/.tmux/plugins/tpm/tpm' #+end_src So that the tmux-airline-dracula theme would work, add powerline font: ~$ sudo aptitude install fonts-powerline~ Rebuild font-cache file: ~$ fc-cache -fv~ Plugins are installed with {{{kbd(Ctrl-a i)}}}, and updated with {{{kbd(Ctrl-a u)}}}.