diff options
| author | Shubham Saini <me@ubh.sh> | 2023-09-30 07:09:49 +0000 |
|---|---|---|
| committer | Shubham Saini <me@ubh.sh> | 2023-09-30 07:09:49 +0000 |
| commit | 6adea13069f1e58aa7f3db6be322d112b52daf4a (patch) | |
| tree | 4710c39bda828ab793643770efea9353be3b5e2c | |
| parent | b79f5dce70b3ad0f36ddf14032545cd004afe5f4 (diff) | |
module: tmux
| -rw-r--r-- | modules/common.nix | 1 | ||||
| -rw-r--r-- | modules/tmux.nix | 52 |
2 files changed, 53 insertions, 0 deletions
diff --git a/modules/common.nix b/modules/common.nix index 747a9cc..3cede6e 100644 --- a/modules/common.nix +++ b/modules/common.nix | |||
| @@ -13,5 +13,6 @@ | |||
| 13 | ./fzf.nix | 13 | ./fzf.nix |
| 14 | ./git.nix | 14 | ./git.nix |
| 15 | ./zsh.nix | 15 | ./zsh.nix |
| 16 | ./tmux.nix | ||
| 16 | ]; | 17 | ]; |
| 17 | } | 18 | } |
diff --git a/modules/tmux.nix b/modules/tmux.nix new file mode 100644 index 0000000..a049d39 --- /dev/null +++ b/modules/tmux.nix | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | { config, pkgs, ... }: | ||
| 2 | |||
| 3 | { | ||
| 4 | programs.tmux = { | ||
| 5 | enable = true; | ||
| 6 | extraConfig = '' | ||
| 7 | set -g default-terminal "xterm-256color" | ||
| 8 | set -g history-limit 50000 | ||
| 9 | set -g base-index 1 | ||
| 10 | set -s escape-time 0 | ||
| 11 | set -g mouse on | ||
| 12 | set-option -g prefix C-a | ||
| 13 | unbind-key C-b | ||
| 14 | bind-key C-a send-prefix | ||
| 15 | bind h select-pane -L | ||
| 16 | bind j select-pane -D | ||
| 17 | bind k select-pane -U | ||
| 18 | bind l select-pane -R | ||
| 19 | bind r source-file ~/.tmux.conf | ||
| 20 | |||
| 21 | # Enable vi keys. | ||
| 22 | setw -g mode-keys vi | ||
| 23 | |||
| 24 | # Escape turns on copy mode | ||
| 25 | bind Escape copy-mode | ||
| 26 | |||
| 27 | # v in copy mode starts making selection | ||
| 28 | bind-key -T copy-mode v send -X begin-selection | ||
| 29 | bind-key -T copy-mode y send -X copy-selection | ||
| 30 | |||
| 31 | # make Prefix p paste the buffer. | ||
| 32 | unbind p | ||
| 33 | bind p paste-buffer | ||
| 34 | |||
| 35 | set-option -g status-position top | ||
| 36 | set -g pane-border-style fg=colour8 | ||
| 37 | set -g pane-active-border-style fg=colour8 | ||
| 38 | |||
| 39 | set -g status-justify right | ||
| 40 | set -g status-right "" | ||
| 41 | set -g status-left "" | ||
| 42 | set -g status-style "bg=default" | ||
| 43 | set -ag status-style "fg=colour7" | ||
| 44 | |||
| 45 | set -g window-status-current-format "#[fg=colour15] #W" | ||
| 46 | set -g window-status-format "#[fg=colour8] #W" | ||
| 47 | |||
| 48 | set -g status-left-length 100 | ||
| 49 | set -ag status-left "#[fg=colour8]time #[fg=colour15]#(date +"%I:%M%p") " | ||
| 50 | ''; | ||
| 51 | }; | ||
| 52 | } | ||
