We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 989d092 + eba4cbe commit 8e8043cCopy full SHA for 8e8043c
sensible.tmux
@@ -64,6 +64,15 @@ key_binding_not_changed() {
64
fi
65
}
66
67
+get_tmux_config() {
68
+ local tmux_config_xdg="${XDG_CONFIG_HOME:-$HOME/.config}/tmux/tmux.conf"
69
+ local tmux_config="$HOME/.tmux.conf"
70
+
71
+ [[ -f "${tmux_config_xdg}" ]] && tmux_config=${tmux_config_xdg}
72
73
+ echo ${tmux_config}
74
+}
75
76
main() {
77
# OPTIONS
78
@@ -147,9 +156,11 @@ main() {
147
156
148
157
# source `.tmux.conf` file - as suggested in `man tmux`
149
158
if key_binding_not_set "R"; then
150
- tmux bind-key R run-shell ' \
151
- tmux source-file ~/.tmux.conf > /dev/null; \
152
- tmux display-message "Sourced .tmux.conf!"'
159
+ local tmux_config=$(get_tmux_config)
160
161
+ tmux bind-key R run-shell " \
162
+ tmux source-file ${tmux_config} > /dev/null; \
163
+ tmux display-message 'Sourced ${tmux_config}!'"
153
164
154
165
155
166
main
0 commit comments