From 4bcabd4bd846feb0800e6186c2504e326e7d211d Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Fri, 23 Aug 2019 09:45:26 -0500 Subject: [PATCH] Tmux buffer handling --- apps/neovim/plugins.vim | 2 +- scripts/bin/tmux-save-buffer | 8 ++++++++ shell/bash/aliases | 1 + shell/tmux/tmux.conf | 3 +++ 4 files changed, 13 insertions(+), 1 deletion(-) create mode 100755 scripts/bin/tmux-save-buffer diff --git a/apps/neovim/plugins.vim b/apps/neovim/plugins.vim index 0592825..df51100 100644 --- a/apps/neovim/plugins.vim +++ b/apps/neovim/plugins.vim @@ -101,7 +101,7 @@ Plug 'editorconfig/editorconfig-vim' " loads project- Plug 'sheerun/vim-polyglot' " vim plugin loader for many languages Plug 'leafo/moonscript-vim', {'for': ['moon', 'moonscript']} " moonscript language Plug 'OmniSharp/omnisharp-vim', {'for': ['cs']} " C# language -Plug 'junegunn/vim-peekaboo' " preview registers +" Plug 'junegunn/vim-peekaboo' " preview registers Plug 'scrooloose/nerdtree' " file browser Plug 'tpope/vim-eunuch' " unix helper commands Plug 'sheerun/vim-polyglot' " vim plugin loader for many languages diff --git a/scripts/bin/tmux-save-buffer b/scripts/bin/tmux-save-buffer new file mode 100755 index 0000000..329c547 --- /dev/null +++ b/scripts/bin/tmux-save-buffer @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +sess="$1"; shift +d="$(date +%Y-%m-%d_%H-%M-%S)" +f="$HOME/$d.tmux-buffer.log" +touch "$f" +chmod 600 "$f" +tmux capture-pane -pS -1000000000 > "$f" diff --git a/shell/bash/aliases b/shell/bash/aliases index 43969f4..7c79047 100644 --- a/shell/bash/aliases +++ b/shell/bash/aliases @@ -30,6 +30,7 @@ alias cdd="cd \"\$DOTFILES_PATH\"" # go to dotfiles alias cdc="cd \"\$XDG_CONFIG_HOME\"" # go to alias cdn="cd \"\$NOTES_PATH\"" alias cdl="cd \"\$NICE_HOME/dl\"" +alias cdg="cd \"\$NICE_HOME/games\"" # quick parent-directory aliases alias ..="cd .." diff --git a/shell/tmux/tmux.conf b/shell/tmux/tmux.conf index a32876a..48c6d54 100644 --- a/shell/tmux/tmux.conf +++ b/shell/tmux/tmux.conf @@ -35,6 +35,7 @@ bind-key h split-window # show tmux status bar by default with (C-s, H) to toggle it set -g status on +set-option -g history-limit 1024000 bind-key H set -s status # simple session switching @@ -58,6 +59,8 @@ set -g status-right "#[fg=colour4]#W#[fg=default]#[bg=default] #H" set -g status-left-length 200 set -g status-left "#[fg=colour7]#(~/.config/dotfiles/scripts/bin/tmux-session-list #S)" +bind-key O run-shell "~/.config/dotfiles/scripts/bin/tmux-save-buffer #S" \; display-message "Saved buffer to ~/.tmux-buffer.log" + # pane split line colors set -g pane-active-border-style bg=black,fg=black set -g pane-border-style fg=black