feat: tmux reinit
This commit is contained in:
parent
48ab0ba163
commit
3b5f6fed77
2 changed files with 87 additions and 0 deletions
|
@ -17,6 +17,7 @@
|
|||
./newsboat.nix
|
||||
./rice.nix
|
||||
./sway.nix
|
||||
./tmux.nix
|
||||
./vscode.nix
|
||||
./waybar.nix
|
||||
./wezterm.nix
|
||||
|
|
86
home/apps/tmux.nix
Normal file
86
home/apps/tmux.nix
Normal file
|
@ -0,0 +1,86 @@
|
|||
{pkgs, ...}: let
|
||||
inherit (pkgs.tmuxPlugins) mkTmuxPlugin;
|
||||
|
||||
menus = mkTmuxPlugin {
|
||||
pluginName = "menus";
|
||||
version = "unstable-2024-04-09";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "jaclu";
|
||||
repo = "tmux-menus";
|
||||
rev = "66700dd790374d40482d836b3e12e88231da79e6";
|
||||
sha256 = "sha256-Q0zVLIQ9f0KTO1Y3gDJU+5CbfnpGeUQhp1OPaml1FuU=";
|
||||
};
|
||||
};
|
||||
themepack = mkTmuxPlugin {
|
||||
pluginName = "themepack";
|
||||
version = "unstable-2022-12-23";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "jimeh";
|
||||
repo = "tmux-themepack";
|
||||
rev = "7c59902f64dcd7ea356e891274b21144d1ea5948";
|
||||
sha256 = "sha256-c5EGBrKcrqHWTKpCEhxYfxPeERFrbTuDfcQhsUAbic4=";
|
||||
};
|
||||
};
|
||||
in {
|
||||
programs.tmux = {
|
||||
enable = true;
|
||||
sensibleOnTop = true;
|
||||
prefix = "C-s";
|
||||
plugins = with pkgs.tmuxPlugins; [
|
||||
{
|
||||
plugin = menus;
|
||||
extraConfig = ''
|
||||
set -g @menus_location_x 'C'
|
||||
set -g @menus_location_y 'C'
|
||||
set -g @menus_trigger 'm'
|
||||
|
||||
# nix-specific, cache dir would be read-only
|
||||
set -g @menus_use_cache 'no'
|
||||
'';
|
||||
}
|
||||
{
|
||||
plugin = jump;
|
||||
extraConfig = "set -g @jump-key 'f'";
|
||||
}
|
||||
{
|
||||
plugin = open;
|
||||
extraConfig = "set -g @open-S 'https://duckduckgo.com/?q='";
|
||||
}
|
||||
{
|
||||
plugin = urlview;
|
||||
extraConfig = "set -g @urlview-key 'u'";
|
||||
}
|
||||
{
|
||||
plugin = themepack;
|
||||
extraConfig = "set -g @themepack 'basic'";
|
||||
}
|
||||
];
|
||||
terminal = "tmux-256color";
|
||||
|
||||
baseIndex = 1;
|
||||
clock24 = true;
|
||||
mouse = true;
|
||||
|
||||
keyMode = "vi";
|
||||
customPaneNavigationAndResize = true;
|
||||
|
||||
extraConfig = ''
|
||||
# neovim fixes
|
||||
set-option -g terminal-overrides ',xterm-256color:RGB'
|
||||
set-option -g focus-events on
|
||||
set-option -sg escape-time 10
|
||||
|
||||
# split with | and -
|
||||
unbind-key \\
|
||||
unbind-key -
|
||||
bind-key \\ split-window -h -c "#{pane_current_path}"
|
||||
bind-key - split-window -v -c "#{pane_current_path}"
|
||||
|
||||
# couple of vi mode keybinds
|
||||
unbind -T copy-mode-vi Space; # Default for begin-selection
|
||||
unbind -T copy-mode-vi Enter; # Default for copy-selection
|
||||
bind -T copy-mode-vi v send-keys -X begin-selection
|
||||
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "clipcopy"
|
||||
'';
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue