From a3d910655ea3a0090b40c9216559a840680cd353 Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Thu, 24 Dec 2020 10:37:25 -0600 Subject: [PATCH] Add Access Past Copy Buffer History as a tmux til --- README.md | 3 ++- tmux/access-past-copy-buffer-history.md | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 tmux/access-past-copy-buffer-history.md diff --git a/README.md b/README.md index b49fe47..972cc2e 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ pairing with smart people at Hashrocket. For a steady stream of TILs, [sign up for my newsletter](https://tinyletter.com/jbranchaud). -_982 TILs and counting..._ +_983 TILs and counting..._ --- @@ -861,6 +861,7 @@ _982 TILs and counting..._ ### tmux +- [Access Past Copy Buffer History](tmux/access-past-copy-buffer-history.md) - [Adjusting Window Pane Size](tmux/adjusting-window-pane-size.md) - [Break Current Pane Out To Separate Window](tmux/break-current-pane-out-to-separate-window.md) - [Change Base Directory Of Existing Session](tmux/change-base-directory-of-existing-session.md) diff --git a/tmux/access-past-copy-buffer-history.md b/tmux/access-past-copy-buffer-history.md new file mode 100644 index 0000000..a39948a --- /dev/null +++ b/tmux/access-past-copy-buffer-history.md @@ -0,0 +1,21 @@ +# Access Past Copy Buffer History + +Each time you perform a copy (as in copy/paste) within tmux using its built-in +copy functionality (i.e. `set-buffer` and `save-buffer`), the text that you +copied to the buffer is recorded in the server's history. + +_Note: you may have `Cmd-c` or the mouse configured to copy to a tmux buffer._ + +So, while `tmux paste-buffer` (or `Cmd-v` if you have that configured) will +only paste in the most recently copied value to a tmux buffer, you can still +access more of the history. + +Run `tmux choose-buffer` (or `:choose-buffer`) to open an interactive +prompt that lists the tmux buffer history in reverse chronological order (most +recent to oldest). + +You can navigate up and down through these buffers until you find the one that +contains what you're looking for. Then hit `Enter` and the value will be pasted +to the current window and pane. + +See `man tmux` and search for `choose-buffer` for more details.