Skip to content

Instantly share code, notes, and snippets.

@cravacuore
Created April 30, 2019 14:06
Show Gist options
  • Select an option

  • Save cravacuore/9cf1f26c18b952a12f6f4ba0d45401d5 to your computer and use it in GitHub Desktop.

Select an option

Save cravacuore/9cf1f26c18b952a12f6f4ba0d45401d5 to your computer and use it in GitHub Desktop.

Revisions

  1. cravacuore created this gist Apr 30, 2019.
    79 changes: 79 additions & 0 deletions tmux.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,79 @@
    # Setting shell to use in tmux
    # set-option -g default-shell "/usr/bin/fish"

    # Vim-like config
    setw -g mode-keys vi

    # Bind prefix
    unbind C-b
    set -g prefix C-a

    # Enter copy mode
    bind Space copy-mode

    # start window numbers at 1 to match keyboard order with tmux window order
    set -g base-index 1
    set-window-option -g pane-base-index 1

    # Current pane to new window
    bind-key b break-pane -d

    # Change between open tmux sessions
    bind-key C-j choose-tree

    # renumber windows sequentially after closing any of them
    set -g renumber-windows on

    # turn off auto window rename
    set-option -g allow-rename off

    # position statusline on top of the window
    set -g status-position top

    # remove administrative debris (session name, hostname, time) in status bar
    set -g status-left ''
    set -g status-right ''

    # Truecolor support
    set -g default-terminal "tmux-256color"
    set -ga terminal-overrides ",*256col*:Tc,"

    # For use with vim-tmux-navigator plugin
    # Smart pane switching with awareness of vim splits
    # is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(diff)?$"'
    # bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
    # bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
    # bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
    # bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
    # bind -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"

    # reload config file
    bind r source-file /etc/tmux.conf \; display "Config Reloaded!"

    # online_status icons to text (use when icons not displaying)
    set -g @online_icon "ok"
    set -g @offline_icon "offline!"

    # last saved environment is automatically restored when tmux is started (needs continuum plugin)
    # set -g @continuum-restore 'on'

    # List of plugins
    # Supports `github_username/repo` or full git repo URLs
    set -g @tpm_plugins ' \
    tmux-plugins/tpm \
    tmux-plugins/tmux-yank \
    tmux-plugins/tmux-sensible \
    tmux-plugins/tmux-pain-control \
    tmux-plugins/tmux-battery \
    tmux-plugins/tmux-online-status \
    # tmux-plugins/tmux-resurrect \
    # tmux-plugins/tmux-continuum \
    '
    # Other examples:
    # github_username/plugin_name \
    # git@github.com/user/plugin \
    # git@bitbucket.com/user/plugin \

    # Initializes TMUX plugin manager.
    # Keep this line at the very bottom of tmux.conf.
    run-shell '~/.tmux/plugins/tpm/tpm'