From fc21e3a1b2255d82afcc45770704920da875cbfc Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Tue, 14 Feb 2023 22:00:22 +0100 Subject: refactor basic tools a bit --- modules/basic-tools/multiplexers.nix | 43 ++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 modules/basic-tools/multiplexers.nix (limited to 'modules/basic-tools/multiplexers.nix') diff --git a/modules/basic-tools/multiplexers.nix b/modules/basic-tools/multiplexers.nix new file mode 100644 index 0000000..c089128 --- /dev/null +++ b/modules/basic-tools/multiplexers.nix @@ -0,0 +1,43 @@ +{ pkgs, ... }: { + programs.tmux = { + enable = true; + keyMode = "vi"; + escapeTime = 0; + historyLimit = 500000; + aggressiveResize = true; + terminal = "tmux-256color"; + }; + + programs.zsh.interactiveShellInit = '' + # create new tmux session with $1 as a name + # if no arguments supplied, use name of current dir + + function tn { + if [ $# -eq 0 ] + then + tmux new-session -s $(basename $(pwd)) + else + tmux new-session -s $1 + fi + } + ''; + + environment.shellAliases = { + tl = "tmux list-sessions"; + ta = "tmux attach -t"; + }; + + environment.systemPackages = [ + pkgs.screen + ]; + + programs.screen.screenrc = '' + defscrollback 10000 + + startup_message off + + hardstatus on + hardstatus alwayslastline + hardstatus string "%w" + ''; +} -- cgit v1.3.1