mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 06:39:14 +00:00
ref(nix): dropped tmux legacy support
This commit is contained in:
parent
81abd93ffb
commit
710441a578
3 changed files with 15 additions and 6 deletions
|
|
@ -17,6 +17,8 @@
|
|||
./git
|
||||
./btop
|
||||
|
||||
./tmux
|
||||
|
||||
./neovim
|
||||
./vim
|
||||
];
|
||||
|
|
@ -37,15 +39,12 @@
|
|||
stow
|
||||
fd
|
||||
vivid
|
||||
gcc
|
||||
|
||||
# utils
|
||||
tree
|
||||
rsync
|
||||
tldr
|
||||
irssi
|
||||
|
||||
# Editors
|
||||
tmux
|
||||
gcc
|
||||
];
|
||||
}
|
||||
|
|
|
|||
9
nix/home/common/tmux/default.nix
Normal file
9
nix/home/common/tmux/default.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{pkgs, ...}: {
|
||||
home.file = {
|
||||
tmux = {
|
||||
source = ./tmux.conf;
|
||||
target = ".tmux.conf";
|
||||
};
|
||||
};
|
||||
home.packages = [pkgs.tmux];
|
||||
}
|
||||
126
nix/home/common/tmux/tmux.conf
Normal file
126
nix/home/common/tmux/tmux.conf
Normal file
|
|
@ -0,0 +1,126 @@
|
|||
###########
|
||||
# Options #
|
||||
###########
|
||||
|
||||
set -s escape-time 0 # escape delay
|
||||
set -g mouse on # mouse control
|
||||
set -g focus-events on # focus-events for vim
|
||||
set -g default-terminal "tmux-256color" # enable italics
|
||||
set -g base-index 1 # start counting pane number from 1
|
||||
set -g renumber-windows on # auto reorder window number
|
||||
set -g mode-keys vi # global vi mode
|
||||
set -g history-limit 10000 # I want more history
|
||||
|
||||
# NOTE: this file is will be processed by nix
|
||||
set -g default-command "(${fish} || ${bash})" # Use fish
|
||||
set -g default-shell "(${fish} || ${bash})"
|
||||
|
||||
# Display style
|
||||
fg="#000000"
|
||||
bg="#fafafa"
|
||||
grey="#a0a1a7"
|
||||
visual="#dedede"
|
||||
accent="#645199"
|
||||
red="#ca1243"
|
||||
|
||||
set -g message-style fg=$fg,bold,bg=$visual
|
||||
|
||||
# status bar
|
||||
set -g status-position top
|
||||
set -g status-style "fg=$fg,bg=$visual"
|
||||
set -g status-left "#{?window_name,#I:#W}"
|
||||
set -g status-right "#(basename #S) [#(uname -n)]"
|
||||
|
||||
# window name
|
||||
set -g window-status-style "fg=$grey,bg=$visual"
|
||||
set -g window-status-current-style "fg=$fg,bold,bg=$visual"
|
||||
set -g window-status-format " #{pane_current_command}"
|
||||
set -g window-status-current-format " #{pane_current_command}"
|
||||
|
||||
# pane border (separator)
|
||||
set -g pane-border-style "fg=$visual"
|
||||
set -g pane-active-border-style "fg=$accent"
|
||||
|
||||
############
|
||||
# Bindings #
|
||||
############
|
||||
# remap prefix
|
||||
bind C-a send-prefix
|
||||
set -g prefix C-a
|
||||
unbind C-b
|
||||
|
||||
# easy config reload
|
||||
bind r source-file ~/.tmux.conf \; display-message "tmux.conf reloaded."
|
||||
|
||||
# organic jumping
|
||||
bind -n C-h select-window -t 1
|
||||
bind -n C-t select-window -t 2
|
||||
bind -n C-n select-window -t 3
|
||||
bind -n C-s select-window -t 4
|
||||
bind -T copy-mode-vi C-h select-window -t 1
|
||||
bind -T copy-mode-vi C-t select-window -t 2
|
||||
bind -T copy-mode-vi C-n select-window -t 3
|
||||
bind -T copy-mode-vi C-s select-window -t 4
|
||||
|
||||
# stop the clock madness
|
||||
unbind t
|
||||
|
||||
# vim-sytle pane jumping
|
||||
bind h select-pane -L
|
||||
bind l select-pane -R
|
||||
bind j select-pane -D
|
||||
bind k select-pane -U
|
||||
|
||||
# unbind built-in select-pane jumping
|
||||
unbind Left
|
||||
unbind Right
|
||||
unbind Down
|
||||
unbind Up
|
||||
|
||||
# improve window swapping
|
||||
bind [ swap-window -d -t -1
|
||||
bind ] swap-window -d -t +1
|
||||
|
||||
# Prime says the find window is for chumps. Don't use the find window
|
||||
bind -n C-f popup -h 25 -w 70 -E "fish -c tmux_sessionizer"
|
||||
bind -n C-g run-shell "fish -c tmux_home"
|
||||
bind s run-shell "fish -c tmux_last"
|
||||
|
||||
# fast kill
|
||||
bind C-k confirm-before kill-session
|
||||
|
||||
# pane movement
|
||||
bind < command-prompt -p "join pane from:" "join-pane -s '%%'"
|
||||
bind > command-prompt -p "send pane to:" "join-pane -t '%%'"
|
||||
bind b command-prompt -p "break pane to " "break-pane -t '%%'"
|
||||
|
||||
# Disable toggle
|
||||
# credit https://github.com/samoshkin/tmux-config/blob/master/tmux/tmux.conf
|
||||
bind -T root F12 \
|
||||
set prefix None \;\
|
||||
set key-table off \;\
|
||||
set window-status-current-style fg=$grey,bold,bg=$visual \;\
|
||||
refresh-client -S
|
||||
|
||||
bind -T off F12 \
|
||||
set -u prefix \;\
|
||||
set -u key-table \;\
|
||||
set -u status \;\
|
||||
set window-status-current-style fg=$fg,bold,bg=$visual \;\
|
||||
refresh-client -S
|
||||
|
||||
# Better copy
|
||||
bind v copy-mode
|
||||
bind -T copy-mode-vi v send-keys -X begin-selection
|
||||
if-shell "uname | grep -q Darwin" {
|
||||
bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel 'pbcopy'
|
||||
bind-key -T copy-mode-vi Enter send -X copy-pipe-and-cancel 'pbcopy'
|
||||
} {
|
||||
bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
|
||||
bind-key -T copy-mode-vi Enter send -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
|
||||
}
|
||||
|
||||
# if-shell "[ -n \"$SSH_CLIENT\"]" {
|
||||
# bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel 'ssh leana@10.0.0.10 pbcopy'
|
||||
# bind-key -T copy-mode-vi 'Y' send -X copy-pipe-and-cancel 'ssh leana@10.66.66.10 pbcopy'
|
||||
# }
|
||||
Loading…
Add table
Add a link
Reference in a new issue