tmux: general improvements and added options

See #575 for discussion.
This commit is contained in:
Wael M. Nasreddine 2019-02-09 17:19:56 -08:00 committed by Robert Helgesson
parent a3462daeb1
commit 2093cf425f
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
8 changed files with 334 additions and 11 deletions

View file

@ -0,0 +1,5 @@
{
tmux-emacs-with-plugins = ./emacs-with-plugins.nix;
tmux-not-enabled = ./not-enabled.nix;
tmux-vi-all-true = ./vi-all-true.nix;
}

View file

@ -0,0 +1,52 @@
# ============================================= #
# Start with defaults from the Sensible plugin #
# --------------------------------------------- #
run-shell @tmuxplugin_sensible_rtp@
# ============================================= #
set -g default-terminal "screen"
set -g base-index 0
setw -g pane-base-index 0
new-session
bind v split-window -h
bind s split-window -v
set -g status-keys emacs
set -g mode-keys emacs
setw -g aggressive-resize on
setw -g clock-mode-style 24
set -s escape-time 500
set -g history-limit 2000
# ============================================= #
# Load plugins with Home Manager #
# --------------------------------------------- #
# tmuxplugin-logging
# ---------------------
run-shell @tmuxplugin_logging@/share/tmux-plugins/logging/logging.tmux
# tmuxplugin-prefix-highlight
# ---------------------
run-shell @tmuxplugin_prefix_highlight@/share/tmux-plugins/prefix-highlight/prefix_highlight.tmux
# tmuxplugin-fzf-tmux-url
# ---------------------
run-shell @tmuxplugin_fzf_tmux_url@/share/tmux-plugins/fzf-tmux-url/fzf-url.tmux
# ============================================= #

View file

@ -0,0 +1,41 @@
{ config, lib, pkgs, ... }:
with lib;
let
substituteExpected = path: pkgs.substituteAll {
src = path;
tmuxplugin_fzf_tmux_url = pkgs.tmuxPlugins.fzf-tmux-url;
tmuxplugin_logging = pkgs.tmuxPlugins.logging;
tmuxplugin_prefix_highlight = pkgs.tmuxPlugins.prefix-highlight;
tmuxplugin_sensible_rtp = pkgs.tmuxPlugins.sensible.rtp;
};
in
{
config = {
programs.tmux = {
aggressiveResize = true;
clock24 = true;
enable = true;
keyMode = "emacs";
newSession = true;
reverseSplit = true;
plugins = with pkgs.tmuxPlugins; [
logging
prefix-highlight
fzf-tmux-url
];
};
nmt.script = ''
assertFileExists home-files/.tmux.conf
assertFileContent home-files/.tmux.conf \
${substituteExpected ./emacs-with-plugins.conf}
'';
};
}

View file

@ -0,0 +1,13 @@
{ config, lib, ... }:
with lib;
{
config = {
programs.tmux = { enable = false; };
nmt.script = ''
assertFileNotExists home-files/.tmux.conf
'';
};
}

View file

@ -0,0 +1,29 @@
# ============================================= #
# Start with defaults from the Sensible plugin #
# --------------------------------------------- #
run-shell @sensible_rtp@
# ============================================= #
set -g default-terminal "screen"
set -g base-index 0
setw -g pane-base-index 0
new-session
bind v split-window -h
bind s split-window -v
set -g status-keys vi
set -g mode-keys vi
setw -g aggressive-resize on
setw -g clock-mode-style 24
set -s escape-time 500
set -g history-limit 2000

View file

@ -0,0 +1,30 @@
{ config, lib, pkgs, ... }:
with lib;
let
substituteExpected = path: pkgs.substituteAll {
src = path;
sensible_rtp = pkgs.tmuxPlugins.sensible.rtp;
};
in {
config = {
programs.tmux = {
aggressiveResize = true;
clock24 = true;
enable = true;
keyMode = "vi";
newSession = true;
reverseSplit = true;
};
nmt.script = ''
assertFileExists home-files/.tmux.conf
assertFileContent home-files/.tmux.conf \
${substituteExpected ./vi-all-true.conf}
'';
};
}