Thanks to visit codestin.com
Credit goes to github.com

Skip to content
 
 

Latest commit

 

History

111 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Use github to sync tmux config

NOTE: This repo was forked from tony/tmux-config and I made adaptation

  • Tmux version should be higher than 2.5
  • <prefix> changed to Ctrl + a (because vim use Ctrl + b)
  • Use tpm to manage tmux plug-in, already integrated:
    • tmux-resurrect: Restore tmux environment after system restart
    • tmux-continuum: tmux environment will be saved at the interval of 15 minutes. All the saving happens in the background without the impact to your workflow
    • tmux-mem-cpu-load: A simple, lightweight program provided for system monitoring in the status line of tmux

Download & Installation

Download:

git clone https://github.com/howhow/tmux-config ~/.my_config/tmux

Download tpm:

git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm

Link tmux config to home:

ln -s ~/.my_config/tmux/tmux.conf ~/.tmux.conf

Start tmux

  1. type tmux in terminal
  2. Press <prefix> + I (capital I, as in Install) to fetch the plugin.

You're good to go! The plugin was cloned to ~/.tmux/plugins/ dir and sourced.

Basic usage

  1. pass color option to xterm, set tmux in alias
tmux='TERM=xterm-256color /usr/local/bin'
  1. list all session
tmux ls
  1. create a new session
tmux new -s <session_name>
  1. attach to a session
tmux attch -t <session_name>
  1. kill a session
tmux kill-session -t <session_name>
  1. kill all session
tmux ls | grep : | cut -d. -f1 | awk '{print substr($1, 0, length($1)-1)}' | xargs kill

Keymaps in this tmux.config

Our prefix/leader key is Ctrl + a now (just like the screen multiplexer). This sequence must be typed before any tmux shortcut. Some keymaps are customized, use <prefix> + ? to bring up list of keyboard shortcuts

For session

keymap desc
<prefix> + : + type new + enter new session
<prefix> + s list sessions
<prefix> + $ name session
<prefix> + d de-attach from session

For window

keymap desc
<prefix> + w list window
<prefix> + c create a new window
<prefix> + , rename current window
<prefix> + n next window
<prefix> + p previous window
<prefix> + f find window
<prefix> + 0 ~ 9 move to window number 0 ~ 9
<prefix> + & kill window

For panel

keymap desc
<prefix> + - split current window horizontally
<prefix> + | split current window vertically
<prefix> + q show panel number
<prefix> + x kill a panel
<prefix> + Space> to change pane arrangement
<prefix> + o to rotate panes
<prefix> + h/j/k/l to move left/down/up/right. Respectively. (vim hjkl)
<prefix> + ; to go to last panel

Copy-paste mode work flow

  1. enter copy mode by <prefix> + [ or scroll the mouse
  2. move around text via h/j/k/l
  3. press v to start select word
  4. h/j/k/l or other vi key-bind to select, like e
  5. y to yank
  6. exit copy mode by press q
  7. <prefix> + P to paste (capital P)

Other

  • LICENSE: MIT

About

Example tmux configuration + vim key-bindings, system stat, cpu load bar.

Topics

Resources

Stars

6 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages