custom-hypr - change ui tmux
This commit is contained in:
@@ -1,94 +1,73 @@
|
||||
# Terminal colors
|
||||
set -g default-terminal "tmux-256color"
|
||||
set -ag terminal-overrides ",xterm-256color:RGB"
|
||||
|
||||
set-option -g focus-events on
|
||||
|
||||
set -sag terminal-features ",*:RGB"
|
||||
set -sag terminal-features ",*:usstyle"
|
||||
# set-option -g focus-events on
|
||||
# -- general -------------------------------------------------------------------
|
||||
|
||||
# Activity
|
||||
# set -g monitor-activity on
|
||||
# set -g visual-activity on
|
||||
# set -g monitor-activity off
|
||||
# set -g bell-action none
|
||||
# set -g visual-bell off
|
||||
|
||||
set -g mouse on
|
||||
setw -g xterm-keys on
|
||||
set -s escape-time 10 # faster command sequences
|
||||
set -sg repeat-time 500 # increase repeat timeout
|
||||
set -s focus-events on
|
||||
|
||||
set -g prefix2 C-b # GNU-Screen compatible prefix
|
||||
bind C-b send-prefix -2
|
||||
|
||||
set -q -g status-utf8 on # expect UTF-8 (tmux < 2.2)
|
||||
setw -q -g utf8 on
|
||||
|
||||
# Status
|
||||
set -g status-interval 1
|
||||
set -sg escape-time 10
|
||||
set -g repeat-time 500
|
||||
set -g display-time 1500
|
||||
set -g history-limit 5000 # boost history
|
||||
set -g mouse on
|
||||
set -g xterm-keys on
|
||||
|
||||
|
||||
bind-key -T copy-mode-vi 'v' send -X begin-selection # start selecting text with "v"
|
||||
bind-key -T copy-mode-vi 'y' send -X copy-selection # copy text with "y"
|
||||
|
||||
unbind -T copy-mode-vi MouseDragEnd1Pane # don't exit copy mode when dragging with mouse
|
||||
|
||||
# remove delay for exiting insert mode with ESC in Neovim
|
||||
set -sg escape-time 10
|
||||
# choose tree format
|
||||
set -g @custom_choose_tree_format "\
|
||||
#{?pane_format,\
|
||||
#{?pane_marked,#[bg=#{@thm_surface_1}],}\
|
||||
#[fg=#{@thm_green}] #{session_name} \
|
||||
#{E:#{@custom_separator}}#[fg=#{@thm_maroon}] #{pane_current_command} \
|
||||
#{E:#{@custom_separator}}#[fg=#{@thm_blue}] #{pane_current_path} \
|
||||
#{?window_zoomed_flag,#{?pane_active,#{E:#{@custom_separator}}#[fg=#{@thm_yellow}] zoom ,},}\
|
||||
#{?pane_marked,#{E:#{@custom_separator}}#[fg=#{@thm_yellow}] marked ,}\
|
||||
#{?pane_active,#{E:#{@custom_separator}}#[fg=#{@thm_yellow}] active ,}\
|
||||
,}\
|
||||
#{?window_format,\
|
||||
#{?window_marked_flag,#[bg=#{@thm_surface_1}],}\
|
||||
#{?window_active,#{#[fg=#{@thm_peach},reverse]},\
|
||||
#{?window_last_flag,#[fg=#{@thm_peach}],#[fg=#{@thm_rosewater}]}\
|
||||
}\
|
||||
#I #{window_name} \
|
||||
#{#[fg=#{@thm_rosewater},none]}\
|
||||
#{?#{==:#{window_panes},1},\
|
||||
#[fg=#{@thm_green}] #{session_name} \
|
||||
#{E:#{@custom_separator}}#[fg=#{@thm_maroon}] #{pane_current_command} \
|
||||
#{E:#{@custom_separator}}#[fg=#{@thm_blue}] #{pane_current_path} \
|
||||
#{?window_marked_flag,#{E:#{@custom_separator}}#[fg=#{@thm_yellow}] marked ,}\
|
||||
,}\
|
||||
,}\
|
||||
#{?session_format,\
|
||||
#{session_windows} windows\
|
||||
#{?session_grouped, (group #{session_group}: #{session_group_list}),}\
|
||||
#{?session_attached, (attached),}\
|
||||
,}
|
||||
"
|
||||
|
||||
# edit configuration
|
||||
%if #{>=:#{version},3.0}
|
||||
bind e new-window -n "#{TMUX_CONF_LOCAL}" -e EDITOR="$EDITOR" sh -c 'case "${EDITOR:-vim}" in *vim*) ${EDITOR:-vim} -c ":set syntax=tmux" "$TMUX_CONF_LOCAL";; *) $EDITOR "$TMUX_CONF_LOCAL";; esac && "$TMUX_PROGRAM" ${TMUX_SOCKET:+-S "$TMUX_SOCKET"} source "$TMUX_CONF" \; display "$TMUX_CONF_LOCAL sourced"'
|
||||
%else
|
||||
set-environment -g EDITOR "$EDITOR"
|
||||
bind e new-window -n "#{TMUX_CONF_LOCAL}" sh -c 'case "${EDITOR:-vim}" in *vim*) ${EDITOR:-vim} -c ":set syntax=tmux" "$TMUX_CONF_LOCAL";; *) $EDITOR "$TMUX_CONF_LOCAL";; esac && "$TMUX_PROGRAM" ${TMUX_SOCKET:+-S "$TMUX_SOCKET"} source "$TMUX_CONF" \; display "$TMUX_CONF_LOCAL sourced"'
|
||||
%endif
|
||||
# Windows
|
||||
bind-key -T copy-mode-vi 'v' send -X begin-selection # start selecting text with "v"
|
||||
bind-key -T copy-mode-vi 'y' send -X copy-selection # copy text with "y"
|
||||
|
||||
# reload configuration
|
||||
bind r run "sh -c '\"\$TMUX_PROGRAM\" \${TMUX_SOCKET:+-S \"\$TMUX_SOCKET\"} source \"\$TMUX_CONF\"'" \; display "#{TMUX_CONF} sourced"
|
||||
|
||||
set-window-option -g mode-keys vi
|
||||
|
||||
# -- display -------------------------------------------------------------------
|
||||
|
||||
set -g base-index 1 # start windows numbering at 1
|
||||
setw -g pane-base-index 1 # make pane numbering consistent with windows
|
||||
|
||||
setw -g automatic-rename on # rename window to reflect current program
|
||||
set -g renumber-windows on # renumber windows when a window is closed
|
||||
|
||||
set -g set-titles on # set terminal title
|
||||
|
||||
set -g display-panes-time 800 # slightly longer pane indicators display time
|
||||
set -g display-time 1000 # slightly longer status messages display time
|
||||
|
||||
set -g status-interval 10 # redraw status line every 10 seconds
|
||||
|
||||
# activity
|
||||
set -g monitor-activity on
|
||||
set -g visual-activity off
|
||||
|
||||
set -g monitor-activity off
|
||||
set -g bell-action none
|
||||
set -g visual-bell off
|
||||
# -- navigation ----------------------------------------------------------------
|
||||
|
||||
# create session
|
||||
# bind C-c new-session
|
||||
|
||||
# find session
|
||||
bind C-f command-prompt -p find-session 'switch-client -t %%'
|
||||
|
||||
# session navigation
|
||||
bind BTab switch-client -l # move to last session
|
||||
|
||||
# split current window horizontally
|
||||
bind - split-window -v -c "#{pane_current_path}"
|
||||
# split current window vertically
|
||||
bind _ split-window -h -c "#{pane_current_path}"
|
||||
|
||||
# pane navigation
|
||||
# Panes
|
||||
bind -r h select-pane -L # move left
|
||||
bind -r j select-pane -D # move down
|
||||
bind -r k select-pane -U # move up
|
||||
bind -r l select-pane -R # move right
|
||||
bind C-q swap-pane -D # swap current pane with the next one
|
||||
bind C-e swap-pane -U # swap current pane with the previous one
|
||||
|
||||
# maximize current pane
|
||||
bind + run "cut -c3- '#{TMUX_CONF}' | sh -s _maximize_pane '#{session_name}' '#D'"
|
||||
|
||||
# pane resizing
|
||||
bind -r H resize-pane -L 2
|
||||
@@ -96,11 +75,29 @@ bind -r J resize-pane -D 2
|
||||
bind -r K resize-pane -U 2
|
||||
bind -r L resize-pane -R 2
|
||||
|
||||
# bind -r \} swap-pane -D
|
||||
# bind -r \{ swap-pane -U
|
||||
# bind -r space select-layout -n
|
||||
|
||||
bind V split-window -h -c "#{pane_current_path}"
|
||||
bind v split-window -v -c "#{pane_current_path}"
|
||||
|
||||
# bind j choose-tree -F "#{E:@custom_choose_tree_format}" -Z "join-pane -h -s "%%""
|
||||
# bind J choose-tree -F "#{E:@custom_choose_tree_format}" -Z "join-pane -v -s "%%""
|
||||
bind w choose-tree -F "#{E:@custom_choose_tree_format}" -Z "select-window -t "%%""
|
||||
|
||||
# find session
|
||||
bind C-f command-prompt -p find-session 'switch-client -t %%'
|
||||
|
||||
# maximize current pane
|
||||
# bind + run "cut -c3- '#{TMUX_CONF}' | sh -s _maximize_pane '#{session_name}' '#D'"
|
||||
|
||||
# window navigation
|
||||
unbind n
|
||||
unbind p
|
||||
bind -r C-h previous-window # select previous window
|
||||
bind -r C-l next-window # select next window
|
||||
unbind C-l
|
||||
bind -r h previous-window # select previous window
|
||||
bind -r l next-window
|
||||
bind Tab last-window # move to last active window
|
||||
|
||||
|
||||
@@ -115,60 +112,158 @@ bind -T copy-mode-vi Escape send -X cancel
|
||||
bind -T copy-mode-vi H send -X start-of-line
|
||||
bind -T copy-mode-vi L send -X end-of-line
|
||||
|
||||
|
||||
|
||||
|
||||
# NOTE: --------------------------------------------------------------------------------------------------------------------
|
||||
# tpm plugin
|
||||
set -g @plugin 'catppuccin/tmux'
|
||||
# set -g @plugin 'xamut/tmux-weather'
|
||||
# reload config file
|
||||
bind r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded"
|
||||
# List of plugins
|
||||
set -g @plugin 'tmux-plugins/tpm'
|
||||
# list of tmux plugins
|
||||
set -g @plugin 'catppuccin/tmux'
|
||||
set -g @plugin 'christoomey/vim-tmux-navigator'
|
||||
set -g @plugin 'tmux-plugins/tmux-resurrect' # persist tmux sessions after computer restart
|
||||
set -g @plugin 'tmux-plugins/tmux-continuum' # automatically saves sessions for you every 15 minutes
|
||||
# set -g @plugin 'fabioluciano/tmux-tokyo-night'
|
||||
# run ~/.tmux/plugins/catppuccin/catppuccin.tmux
|
||||
|
||||
# NOTE: ...alongside
|
||||
set -g @catppuccin_flavour "mocha"
|
||||
set -g @catppuccin_window_left_separator " "
|
||||
set -g @catppuccin_window_right_separator " "
|
||||
set -g @catppuccin_window_middle_separator "|"
|
||||
# set -g @catppuccin_window_middle_separator ""
|
||||
|
||||
set -g @catppuccin_window_number_position "right"
|
||||
|
||||
set -g @catppuccin_window_default_fill "all"
|
||||
set -g @catppuccin_window_default_text "#W"
|
||||
|
||||
set -g @catppuccin_window_current_fill "number"
|
||||
set -g @catppuccin_window_current_text "#W"
|
||||
|
||||
set -g @catppuccin_status_modules_right "user host"
|
||||
set -g @catppuccin_status_modules_left "session "
|
||||
set -g @catppuccin_status_right_separator ""
|
||||
|
||||
set -g @catppuccin_status_left_separator " "
|
||||
# set -g @catppuccin_status_right_separator " "
|
||||
set -g @catppuccin_status_middle_separator "|"
|
||||
|
||||
set -g @catppuccin_status_fill "all"
|
||||
set -g @catppuccin_status_connect_separator "yes"
|
||||
set -g @catppuccin_window_status_icon_enable "yes"
|
||||
set -g @catppuccin_window_status_enable "yes"
|
||||
set -g @catppuccin_status_default "on"
|
||||
# icons
|
||||
set -g @catppuccin_icon_window_last " "
|
||||
set -g @catppuccin_icon_window_current " "
|
||||
|
||||
set -g status-position top
|
||||
|
||||
# set -g @catppuccin_directory_text "#{pane_current_path}"
|
||||
# end it
|
||||
|
||||
# Configure Catppuccin
|
||||
set -g @catppuccin_flavor "macchiato"
|
||||
set -g @catppuccin_status_background "none" # none == default
|
||||
set -g @catppuccin_pane_status_enabled "off"
|
||||
set -g @catppuccin_pane_border_status "off"
|
||||
|
||||
set -g @resurrect-capture-pane-contents 'on'
|
||||
set -g @continuum-restore 'on'
|
||||
set-window-option -g mode-keys vi
|
||||
# Configure battery
|
||||
# set -g @batt_icon_charge_tier8 ''
|
||||
# set -g @batt_icon_charge_tier7 ''
|
||||
# set -g @batt_icon_charge_tier6 ''
|
||||
# set -g @batt_icon_charge_tier5 ''
|
||||
# set -g @batt_icon_charge_tier4 ''
|
||||
# set -g @batt_icon_charge_tier3 ''
|
||||
# set -g @batt_icon_charge_tier2 ''
|
||||
# set -g @batt_icon_charge_tier1 ''
|
||||
# set -g @batt_icon_status_charged ''
|
||||
# set -g @batt_icon_status_charging ''
|
||||
# set -g @batt_icon_status_discharging ''
|
||||
# set -g @batt_icon_status_attached ''
|
||||
# set -g @batt_icon_status_unknown ''
|
||||
|
||||
# Configure Cpu
|
||||
set -g @cpu_percentage_format "%03d%%"
|
||||
|
||||
# Configure Mem
|
||||
set -g @ram_percentage_format "%03d%%"
|
||||
|
||||
# status left look and feel
|
||||
set -g status-left-length 80
|
||||
set -g status-left ""
|
||||
|
||||
# status right look and feel
|
||||
set -g status-right-length 160
|
||||
set -g status-right ""
|
||||
|
||||
# custom var
|
||||
set -g @custom_separator "#[fg=#{@thm_overlay_0},none]|"
|
||||
|
||||
# session
|
||||
set -ga status-right "#[fg=#{@thm_green},bg=default]"
|
||||
set -ga status-right "#{?client_prefix,#[#{fg=#{@thm_green}}]#[reverse]#[bold],}"
|
||||
set -ga status-right " #{?#{e|>:#{window_width},90}, #S,} "
|
||||
set -ga status-right "#{?client_prefix,#[none],}"
|
||||
set -ga status-right "#{E:#{@custom_separator}}"
|
||||
|
||||
# application
|
||||
set -ga status-right "#[fg=#{@thm_maroon},bg=default]"
|
||||
set -ga status-right " #{?#{e|>:#{window_width},80}, #{pane_current_command},} "
|
||||
set -ga status-right "#{E:#{@custom_separator}}"
|
||||
|
||||
# directory
|
||||
set -ga status-right "#[fg=#{@thm_blue},bg=default]"
|
||||
set -ga status-right " #{?#{e|>:#{window_width},80}, #{=/24/...:#{b:pane_current_path}},} "
|
||||
set -ga status-right "#{E:#{@custom_separator}}"
|
||||
|
||||
# window zoom flag
|
||||
set -ga status-right "#{?window_zoomed_flag,"
|
||||
set -ga status-right "#[fg=#{@thm_yellow}]#[bg=default]"
|
||||
set -ga status-right " #{?#{e|>:#{window_width},110}, zoom,} "
|
||||
set -ga status-right "#{E:#{@custom_separator}}"
|
||||
set -ga status-right ",}"
|
||||
|
||||
# pane marked flag
|
||||
set -ga status-right "#{?pane_marked,"
|
||||
set -ga status-right "#[fg=#{@thm_yellow}]#[bg=default]"
|
||||
set -ga status-right " #{?#{e|>:#{window_width},110}, marked,} "
|
||||
set -ga status-right "#{E:#{@custom_separator}}"
|
||||
set -ga status-right ",}"
|
||||
|
||||
# cpu
|
||||
# set -ga status-right "#[fg=#{@thm_teal},bg=default]"
|
||||
# set -ga status-right " #{?#{e|>:#{window_width},115}, #{cpu_percentage},} "
|
||||
# set -ga status-right "#{E:#{@custom_separator}}"
|
||||
|
||||
# ram
|
||||
# set -ga status-right "#[fg=#{@thm_sky},bg=default]"
|
||||
# set -ga status-right " #{?#{e|>:#{window_width},115}, #{ram_percentage},} "
|
||||
# set -ga status-right "#{E:#{@custom_separator}}"
|
||||
|
||||
# battery
|
||||
# set -ga status-right "#[fg=#{@thm_pink},bg=default]"
|
||||
# set -ga status-right "#{?#{e|>:#{window_width},105},"
|
||||
# set -ga status-right " #{?#{battery_percentage},#{battery_icon} #{battery_percentage},#{@batt_icon_status_charged} cable} "
|
||||
# set -ga status-right ","
|
||||
# set -ga status-right " #{?#{battery_percentage},#{battery_icon},#{@batt_icon_status_charged}} "
|
||||
# set -ga status-right "}"
|
||||
# set -ga status-right "#{E:#{@custom_separator}}"
|
||||
|
||||
# date
|
||||
set -ga status-right "#[fg=#{@thm_lavender},bg=default]"
|
||||
set -ga status-right " #{?#{e|>:#{window_width},95}, %Y-%m-%d,} "
|
||||
set -ga status-right "#{E:#{@custom_separator}}"
|
||||
|
||||
|
||||
# time
|
||||
# set -ga status-right "#[fg=#{@thm_fg},bg=default]"
|
||||
# set -ga status-right " #{?#{e|>:#{window_width},85}, %H:%M,} "
|
||||
|
||||
# bootstrap tpm
|
||||
if "test ! -d ~/.tmux/plugins/tpm" \
|
||||
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
|
||||
|
||||
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
|
||||
run '~/.tmux/plugins/tpm/tpm'
|
||||
|
||||
# Configure Tmux
|
||||
set -g status 2
|
||||
set -g status-position top
|
||||
set -g status-style "bg=#{@thm_mantle}"
|
||||
set -g status-justify "left"
|
||||
|
||||
set -gF status-format[1] "#[fg=#{@thm_surface_2},bg=#{@thm_bg}]\
|
||||
───────────────────────────────────────────────────────────────────────────────\
|
||||
───────────────────────────────────────────────────────────────────────────────\
|
||||
───────────────────────────────────────────────────────────────────────────────\
|
||||
───────────────────────────────────────────────────────────────────────────────\
|
||||
───────────────────────────────────────────────────────────────────────────────\
|
||||
───────────────────────────────────────────────────────────────────────────────\
|
||||
"
|
||||
|
||||
# pane border look and feel
|
||||
setw -g pane-border-status off
|
||||
setw -g pane-border-format ""
|
||||
setw -g pane-active-border-style "bg=default,fg=#{@thm_peach}"
|
||||
setw -g pane-border-style "bg=default,fg=#{@thm_overlay_1}"
|
||||
setw -g pane-border-lines single
|
||||
|
||||
# window look and feel
|
||||
set -gF window-status-separator "#[fg=#{@thm_overlay_0}]"
|
||||
set -wg automatic-rename on
|
||||
set -g automatic-rename-format "window"
|
||||
|
||||
set -g window-status-format " #{?#{==:#{window_name},window},#I,#W} "
|
||||
set -g window-status-style "fg=#{@thm_rosewater},bg=default"
|
||||
set -g window-status-last-style "fg=#{@thm_peach}"
|
||||
set -g window-status-activity-style "fg=#{@thm_red},bold"
|
||||
set -g window-status-bell-style "fg=#{@thm_red},bold"
|
||||
|
||||
set -g window-status-current-format " #{?#{==:#{window_name},window},#I,#W} "
|
||||
set -g window-status-current-style "fg=#{@thm_peach},bold,reverse"
|
||||
# show startup screen
|
||||
# hook to run fastfetch on session jreation
|
||||
# set-hook -g after-new-session 'send-keys " clear && fastfetch" C-m'
|
||||
|
||||
Reference in New Issue
Block a user