aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/%HOME%/.tmux.conf
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-02-09 10:09:15 +0000
committerEgor Tensin <Egor.Tensin@gmail.com>2023-02-09 10:09:15 +0000
commit68ad145b3884158a0fc04f0c506e11c12dd43a18 (patch)
treebe1cd8193db4b1d31fe403ea1bab387db76b363e /%HOME%/.tmux.conf
parentssh: update my hosts (diff)
downloadlinux-home-68ad145b3884158a0fc04f0c506e11c12dd43a18.tar.gz
linux-home-68ad145b3884158a0fc04f0c506e11c12dd43a18.zip
tmux: split some config parts into multiple parts
Diffstat (limited to '')
-rw-r--r--%HOME%/.tmux.conf43
1 files changed, 4 insertions, 39 deletions
diff --git a/%HOME%/.tmux.conf b/%HOME%/.tmux.conf
index 21db6d6..c6d0fb6 100644
--- a/%HOME%/.tmux.conf
+++ b/%HOME%/.tmux.conf
@@ -106,45 +106,10 @@ bind-key -T copy-mode-vi v send -X begin-selection
# M-y is y and Y combined.
# ! to copy excluding line endings (most useful for one-line selections).
-# 1. Cygwin
-
-if-shell 'uname | grep -q -F CYGWIN' {
- bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'cat > /dev/clipboard'
- bind-key -T copy-mode-vi Y send-keys -X copy-pipe-and-cancel 'tmux paste-buffer'
- bind-key -T copy-mode-vi M-y send-keys -X copy-pipe-and-cancel 'cat > /dev/clipboard; tmux paste-buffer'
- bind-key -T copy-mode-vi '!' send-keys -X copy-pipe-and-cancel "tr -d '\n' > /dev/clipboard"
- bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel 'cat > /dev/clipboard'
- bind-key -T root MouseDown2Pane run 'cat /dev/clipboard | tmux load-buffer - && tmux paste-buffer'
- bind-key ] run 'cat /dev/clipboard | tmux load-buffer - && tmux paste-buffer'
-}
-
-# 2. Linux
-
-# Depends on xsel.
-# The simple `xsel -i --clipboard` doesn't work, but `xsel -i -p && xsel -o -p
-# | xsel -i -b` [1] does. How fun!
-
-if-shell 'uname | grep -q -F Linux && which xsel' {
- bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xsel -i -p && xsel -o -p | xsel -i -b'
- bind-key -T copy-mode-vi Y send-keys -X copy-pipe-and-cancel 'tmux paste-buffer'
- bind-key -T copy-mode-vi M-y send-keys -X copy-pipe-and-cancel 'xsel -i -p && xsel -o -p | xsel -i -b; tmux paste-buffer'
- bind-key -T copy-mode-vi '!' send-keys -X copy-pipe-and-cancel "tr -d '\n' | xsel -i -p && xsel -o -p | xsel -i -b"
- bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel 'xsel -i -p && xsel -o -p | xsel -i -b'
- bind-key -T root MouseDown2Pane run 'xsel -o | tmux load-buffer - && tmux paste-buffer'
- bind-key ] run 'xsel -o | tmux load-buffer - && tmux paste-buffer'
-}
-
-# 3. macOS
-
-if-shell 'uname | grep -q -F Darwin' {
- bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'pbcopy'
- bind-key -T copy-mode-vi Y send-keys -X copy-pipe-and-cancel 'tmux paste-buffer'
- bind-key -T copy-mode-vi M-y send-keys -X copy-pipe-and-cancel 'pbpaste; tmux paste-buff'
- bind-key -T copy-mode-vi '!' send-keys -X copy-pipe-and-cancel "tr -d '\n' | pbcopy"
- bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel 'pbcopy'
- bind-key -T root MouseDown2Pane run 'pbpaste | tmux load-buffer - && tmux paste-buffer'
- bind-key ] run 'pbpaste | tmux load-buffer - && tmux paste-buffer'
-}
+if-shell 'uname | grep -q -F CYGWIN' source-file ~/.config/tmux/cygwin.conf
+if-shell 'uname | grep -q -F Linux && command -v xsel' \
+ source-file ~/.config/tmux/linux.conf
+if-shell 'uname | grep -q -F Darwin' source-file ~/.config/tmux/macos.conf
# Appearance
# ----------