blob: a538023801663ff9389d19ac620a78f2af84a5db (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#!/usr/bin/env bash
# vim: set filetype=sh :
#
# Author: Cody Hiar
# Date: 2017-06-09
#
# Description:: Check the operatig system of the host and load the os specific
# options
#
# Set options:
# e: Stop script if command fails
# u: Stop script if unset variable is referenced
# x: Debug, print commands as they are executed
# o pipeline: If any command in a pipeline fails it all fails
#
set -euo pipefail
# Main loop of program
main() {
if [ "$(uname)" == "Darwin" ]; then
bind -T copy-mode-vi y send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi Enter copy-pipe "reattach-to-user-namespace pbcopy"
set-option -g default-command "reattach-to-user-namespace -l zsh"
elif [ "$(uname)" == "Linux" ]; then
bind -T copy-mode-vi y send -X copy-pipe-and-cancel "tmux save-buffer - | xp"
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi Enter copy-pipe "tmux save-buffer - | xp"
fi
}
main
|