develop: init tmux profile

This commit is contained in:
Timothy DeHerrera 2019-12-15 00:25:04 -07:00
parent b1716f9bbe
commit ab896c6dd7
No known key found for this signature in database
GPG Key ID: 8985725DB5B0C122
4 changed files with 131 additions and 0 deletions

View File

@ -3,6 +3,7 @@
imports = [ imports = [
./zsh ./zsh
./kakoune ./kakoune
./tmux
]; ];
environment.shellAliases = { environment.shellAliases = {

View File

@ -0,0 +1,50 @@
{ lib, pkgs, ... }:
let
inherit (builtins)
readFile
concatStringsSep
;
inherit (lib)
removePrefix
;
pluginConf = plugins:
concatStringsSep "\n\n"
(
map (
plugin: let
name = removePrefix "tmuxplugin-" plugin.name;
in
"run-shell ${plugin}/share/tmux-plugins/${name}/${name}.tmux"
) plugins
);
plugins = with pkgs.tmuxPlugins; [
copycat
open
resurrect
yank
vim-tmux-navigator
];
in
{
programs.tmux = {
enable = true;
aggressiveResize = true;
escapeTime = 10;
historyLimit = 5000;
keyMode = "vi";
shortcut = "a";
terminal = "tmux-256color";
baseIndex = 1;
extraTmuxConf = ''
${readFile ./tmuxline.conf}
${readFile ./tmux.conf}
${pluginConf plugins}
'';
};
}

View File

@ -0,0 +1,54 @@
# Enable mouse mode (tmux 2.1 and above)
set -g mouse on
# autmatic window name
setw -g automatic-rename on
# Enable focus events
set -g focus-events on
# truecolor in xterm
set -ga terminal-overrides ",*col*:Tc"
# Start a non login shell
set -g default-command "${SHELL}"
# pane movement
# Grab pane from the target window & joins to current,
bind-key j command-prompt -p "join pane from:" "join-pane -s '%%'"
# does reverse.
bind-key s command-prompt -p "send pane to:" "join-pane -t '%%'"
# Key binds
bind -n ^_ send-keys 'C-l'
bind-key -r C-h select-window -t :-
bind-key -r C-l select-window -t :+
bind-key C-a last-window
bind-key | split-window -h
bind-key - split-window -v
bind-key _ split-window -v -p 38
bind-key \ split-window -h -p 38
bind-key b break-pane -d
bind-key x kill-pane
bind-key X kill-window
bind-key q confirm-before kill-session
bind-key Q confirm-before kill-server
bind-key , previous-window # <
bind-key . next-window # >
bind-key -r < swap-window -t :-
bind-key -r > swap-window -t :+
bind-key n command-prompt 'rename-window %%'
bind-key N command-prompt 'rename-session %%'
bind-key Escape copy-mode -u
bind-key Up copy-mode -u
bind-key r source-file ~/.tmux.conf
bind-key R refresh-client
bind-key S set-option status
# Resize panes with alt-jkhl
bind-key -n C-M-j resize-pane -D
bind-key -n C-M-k resize-pane -U
bind-key -n C-M-h resize-pane -L
bind-key -n C-M-l resize-pane -R
bind -T copy-mode-vi 'v' send-keys -X begin-selection

View File

@ -0,0 +1,26 @@
# statusbar configuration
set -g status-justify "left"
set -g status "on"
set -g status-style "none"
set -g message-command-style bg="colour31"
set -g status-left-length "100"
set -g pane-active-border-style fg="colour254"
set -g status-bg "colour234"
set -g message-command-style fg="colour231"
set -g pane-border-style fg="colour240"
set -g message-style bg="colour31"
set -g status-left-style "none"
set -g status-right-style "none"
set -g status-right-length "100"
set -g message-style fg="colour231"
setw -g window-status-style fg="colour250"
setw -g window-status-style "none"
setw -g window-status-activity-style bg="colour234"
setw -g window-status-activity-style "none"
setw -g window-status-activity-style fg="colour250"
setw -g window-status-separator ""
setw -g window-status-style bg="colour234"
set -g status-left "#[fg=colour16,bg=colour254,bold] #S #[fg=colour254,bg=colour234,nobold,nounderscore,noitalics]"
set -g status-right "#[fg=colour236,bg=colour234,nobold,nounderscore,noitalics]#[fg=colour247,bg=colour236] %l:%M%p #[fg=colour252,bg=colour236,nobold,nounderscore,noitalics]#[fg=colour235,bg=colour252] #h "
setw -g window-status-format "#[fg=colour244,bg=colour234] #I #[fg=colour250,bg=colour234] #W "
setw -g window-status-current-format "#[fg=colour234,bg=colour31,nobold,nounderscore,noitalics]#[fg=colour117,bg=colour31] #I #[fg=colour231,bg=colour31,bold] #W #[fg=colour31,bg=colour234,nobold,nounderscore,noitalics]"