feat: tmux in home-manager
This commit is contained in:
parent
40f8e35909
commit
f4c22e26ea
2 changed files with 54 additions and 49 deletions
|
@ -81,6 +81,60 @@
|
|||
bandwhich # bandwidth utility
|
||||
];
|
||||
|
||||
programs.tmux = {
|
||||
enable = true;
|
||||
clock24 = true;
|
||||
mouse = true;
|
||||
keyMode = "emacs";
|
||||
sensibleOnTop = true;
|
||||
terminal = "screen-256color";
|
||||
plugins = with pkgs;
|
||||
[
|
||||
{
|
||||
plugin = tmuxPlugins.resurrect;
|
||||
extraConfig = "set -g @resurrect-strategy-nvim 'session'";
|
||||
}
|
||||
{
|
||||
plugin = tmuxPlugins.continuum;
|
||||
extraConfig = ''
|
||||
set -g @continuum-restore 'on'
|
||||
set -g @continuum-save-interval '60' # minutes
|
||||
'';
|
||||
}
|
||||
tmuxPlugins.yank
|
||||
tmuxPlugins.extrakto
|
||||
tmuxPlugins.fpp
|
||||
];
|
||||
extraConfig = ''
|
||||
# Fix any binds
|
||||
set -g prefix C-a
|
||||
unbind C-b
|
||||
bind-key C-a send-prefix
|
||||
|
||||
unbind %
|
||||
bind | split-window -h
|
||||
|
||||
unbind '"'
|
||||
bind - split-window -v
|
||||
|
||||
unbind r
|
||||
bind r source-file ~/.tmux.conf
|
||||
|
||||
bind -r m resize-pane -Z
|
||||
|
||||
# Focus events enabled for terminals that support them
|
||||
set -g focus-events on
|
||||
|
||||
# Allow the arrow key to be used immediately after changing windows
|
||||
set-option -g repeat-time 0
|
||||
|
||||
# Vi parts here.
|
||||
set-window-option -g mode-keys vi
|
||||
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"
|
||||
|
||||
'';
|
||||
};
|
||||
|
||||
programs.git = {
|
||||
enable = true;
|
||||
|
|
49
.tmux.conf
49
.tmux.conf
|
@ -1,49 +0,0 @@
|
|||
# If tpm is not installed, install it
|
||||
if "test ! -d ~/.tmux/plugins/tpm" \
|
||||
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
|
||||
|
||||
set-option -g default-terminal screen-256color
|
||||
|
||||
set -g prefix C-a
|
||||
unbind C-b
|
||||
bind-key C-a send-prefix
|
||||
|
||||
unbind %
|
||||
bind | split-window -h
|
||||
|
||||
unbind '"'
|
||||
bind - split-window -v
|
||||
|
||||
unbind r
|
||||
bind r source-file ~/.tmux.conf
|
||||
|
||||
bind -r m resize-pane -Z
|
||||
|
||||
set -g mouse on
|
||||
|
||||
set-window-option -g mode-keys vi
|
||||
set -g status-keys emacs
|
||||
|
||||
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
|
||||
|
||||
# Focus events enabled for terminals that support them
|
||||
set -g focus-events on
|
||||
|
||||
# Allow the arrow key to be used immediately after changing windows
|
||||
set-option -g repeat-time 0
|
||||
|
||||
# tpm plugin
|
||||
set -g @plugin 'tmux-plugins/tpm'
|
||||
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 'tmux-plugins/tmux-yank' # integrates system clipboard
|
||||
set-option -g @plugin 'b0o/tmux-autoreload' #automatically reloads the config
|
||||
set -g @plugin 'noscript/tmux-mighty-scroll' # better mouse scroll
|
||||
set -g @plugin 'tmux-plugins/tmux-fpp'
|
||||
set -g @plugin 'laktak/extrakto'
|
||||
|
||||
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
|
||||
run '~/.tmux/plugins/tpm/tpm'
|
Loading…
Add table
Reference in a new issue