Skip to content

Commit b0174eb

Browse files
committed
feat(user/refnode): let home-manager manage first part of tmux config
1 parent 41cf02e commit b0174eb

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed

users/refnode/common/core/default.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
./direnv.nix
1010
./bat.nix
1111
./neovim.nix
12+
./tmux.nix
1213
];
1314

1415
home.stateVersion = "24.11";

users/refnode/common/core/tmux.nix

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
config,
3+
lib,
4+
pkgs,
5+
...
6+
}: {
7+
programs.tmux = {
8+
enable = true;
9+
baseIndex = 1;
10+
keyMode = "vi";
11+
prefix = "C-Space";
12+
sensibleOnTop = true;
13+
mouse = true;
14+
# shell = "reattach-to-user-namespace -l ${pkgs.zsh}/bin/zsh";
15+
# shell = "${pkgs.zsh}/bin/zsh";
16+
plugins = with pkgs; [
17+
tmuxPlugins.nord
18+
tmuxPlugins.vim-tmux-navigator
19+
tmuxPlugins.tmux-fzf
20+
{
21+
plugin = tmuxPlugins.fzf-tmux-url;
22+
extraConfig = ''
23+
set -g @fzf-url-history-limit '2000'
24+
'';
25+
}
26+
{
27+
plugin = tmuxPlugins.session-wizard;
28+
}
29+
];
30+
extraConfig = ''
31+
# unbind some unliked defaults
32+
unbind '"'
33+
unbind %
34+
unbind Up
35+
unbind Down
36+
unbind Left
37+
unbind Right
38+
39+
# Rebind split plane and let the new pane open with the current
40+
# working directory of the current pane.
41+
bind _ split-window -h -c "#{pane_current_path}"
42+
bind - split-window -v -c "#{pane_current_path}"
43+
44+
bind-key Enter run-shell "${pkgs.ref-main}/bin/ref-main"
45+
46+
# Enable a keybind layer for additional mappings.
47+
# As tmux only accepts a single key for keybinds, this configuration
48+
# creates a new table similar to the ones of copy-mode or copy-mode-vi.
49+
# So Ctrl-Space as the choosen prefix for this tmux config,
50+
# followed by another Space enters the "leader" with the following
51+
# keybindings to the given features.
52+
bind-key Space switch-client -T leader
53+
bind-key -T leader , command-prompt -I "#W" "rename-window '%%'"
54+
bind-key -T leader Enter run-shell "${pkgs.ref-main}/bin/ref-main"
55+
56+
set-option -g default-command "reattach-to-user-namespace -l zsh"
57+
58+
source-file ~/.config/tmux/local.tmux
59+
'';
60+
};
61+
}

0 commit comments

Comments
 (0)