Skip to content

Instantly share code, notes, and snippets.

@iheanyi
Created February 23, 2020 19:44
Show Gist options
  • Save iheanyi/c33b3049cda66cf4003e525360dd94fa to your computer and use it in GitHub Desktop.
Save iheanyi/c33b3049cda66cf4003e525360dd94fa to your computer and use it in GitHub Desktop.
Iheanyi's Window Terminals stuff
# Let's use 256 colors for the screen
set -g default-terminal "tmux-256color"
set -ga terminal-overrides ",xterm-256color:Tc"
#urxvt tab like window switching (-n: no prior escape seq)
bind -n S-down new-window
bind -n S-left prev
bind -n S-right next
bind -n C-left swap-window -t -1
bind -n C-right swap-window -t +1
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
is_fzf="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?fzf$'"
bind -n C-h run "($is_vim && tmux send-keys C-h) || \
tmux select-pane -L"
bind -n C-j run "($is_vim && tmux send-keys C-j) || \
($is_fzf && tmux send-keys C-j) || \
tmux select-pane -D"
bind -n C-k run "($is_vim && tmux send-keys C-k) || \
($is_fzf && tmux send-keys C-k) || \
tmux select-pane -U"
bind -n C-l run "($is_vim && tmux send-keys C-l) || \
tmux select-pane -R"
bind-key -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
# Let's use C-a for natural movement with fingers. :D
unbind C-b
set -gw prefix C-a
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @continuum-restore 'on'
# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'git@github.com/user/plugin'
# set -g @plugin 'git@bitbucket.com/user/plugin'
# Initialize TMUX plugin manager (keep this line at the very bottom of
# tmux.conf)
run -b '~/.tmux/plugins/tpm/tpm'
// Base 16 Tomorrow Night 256 Color Configuration - Windows Terminal
// Colors made by Chris Kempson (http://chriskempson.com)
{
"name": "Tomorrow Night",
"background": "#2d2d2d",
"foreground": "#cccccc",
"black": "#2d2d2d",
"red": "#f2777a",
"green": "#99cc99",
"yellow": "#ffcc66",
"blue": "#6699cc",
"magenta": "#cc99cc",
"cyan": "#66cccc",
"white": "#cccccc",
"brightBlack": "#999999",
"brightRed": "#f2777a",
"brightGreen": "#99cc99",
"brightYellow": "#ffcc66",
"brightBlue": "#6699cc",
"brightMagenta": "#cc99cc",
"brightCyan": "#66cccc",
"brightWhite": "#ffffff"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment