Skip to content

Commit c6a73eb

Browse files
committed
run shfmt on scripts
shfmt -f . | xargs -E'\n' shfmt -w -i 4 -s
1 parent 302a61e commit c6a73eb

File tree

5 files changed

+49
-49
lines changed

5 files changed

+49
-49
lines changed

citest

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,26 @@ set -euo pipefail
55
cd "$(dirname "$0")"
66

77
bash_scripts=(
8-
yank.tmux
9-
scripts/*.sh
8+
yank.tmux
9+
scripts/*.sh
1010
)
1111

1212
set -x
1313
docker run \
14-
--rm \
15-
--volume="${PWD}:/mnt:ro" \
16-
--workdir="/mnt" \
17-
bash:latest \
18-
bash -Dn "${bash_scripts[@]}"
14+
--rm \
15+
--volume="${PWD}:/mnt:ro" \
16+
--workdir="/mnt" \
17+
bash:latest \
18+
bash -Dn "${bash_scripts[@]}"
1919

2020
docker run \
21-
--rm \
22-
--volume="${PWD}:/mnt:ro" \
23-
--workdir="/mnt" \
24-
koalaman/shellcheck:stable \
25-
--shell=bash \
26-
--external-sources \
27-
--color=always \
28-
"${bash_scripts[@]}"
21+
--rm \
22+
--volume="${PWD}:/mnt:ro" \
23+
--workdir="/mnt" \
24+
koalaman/shellcheck:stable \
25+
--shell=bash \
26+
--external-sources \
27+
--color=always \
28+
"${bash_scripts[@]}"
2929

3030
# EOF

scripts/copy_line.sh

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
3+
CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
44
HELPERS_DIR="$CURRENT_DIR"
55
TMUX_COPY_MODE=""
66

@@ -19,7 +19,7 @@ get_tmux_copy_mode() {
1919
add_sleep_for_remote_shells() {
2020
local pane_command
2121
pane_command="$(tmux display-message -p '#{pane_current_command}')"
22-
if [[ "$pane_command" =~ (ssh|mosh) ]]; then
22+
if [[ $pane_command =~ (ssh|mosh) ]]; then
2323
sleep "$REMOTE_SHELL_WAIT_TIME"
2424
fi
2525
}
@@ -51,23 +51,23 @@ start_tmux_selection() {
5151
# works when command spans accross multiple lines
5252
end_of_line_in_copy_mode() {
5353
if tmux_is_at_least 2.4; then
54-
tmux send -X -N 150 'cursor-down' # 'down' key. 'vi' mode is faster so we're
54+
tmux send -X -N 150 'cursor-down' # 'down' key. 'vi' mode is faster so we're
5555
# jumping more lines than emacs.
56-
tmux send -X 'end-of-line' # End of line (just in case we are already at the last line).
57-
tmux send -X 'previous-word' # Beginning of the previous word.
58-
tmux send -X 'next-word-end' # End of next word.
56+
tmux send -X 'end-of-line' # End of line (just in case we are already at the last line).
57+
tmux send -X 'previous-word' # Beginning of the previous word.
58+
tmux send -X 'next-word-end' # End of next word.
5959
elif [ "$TMUX_COPY_MODE" == "vi" ]; then
6060
# vi copy mode
6161
# This sequence of keys consistently selects multiple lines
62-
tmux send-key '150' # Go to the bottom of scrollback buffer by using
63-
tmux send-key 'j' # 'down' key. 'vi' mode is faster so we're
62+
tmux send-key '150' # Go to the bottom of scrollback buffer by using
63+
tmux send-key 'j' # 'down' key. 'vi' mode is faster so we're
6464
# jumping more lines than emacs.
65-
tmux send-key '$' # End of line (just in case we are already at the last line).
66-
tmux send-key 'b' # Beginning of the previous word.
67-
tmux send-key 'e' # End of next word.
65+
tmux send-key '$' # End of line (just in case we are already at the last line).
66+
tmux send-key 'b' # Beginning of the previous word.
67+
tmux send-key 'e' # End of next word.
6868
else
6969
# emacs copy mode
70-
for (( c=1; c<='30'; c++ )); do # go to the bottom of scrollback buffer
70+
for ((c = 1; c <= '30'; c++)); do # go to the bottom of scrollback buffer
7171
tmux send-key 'C-n'
7272
done
7373
tmux send-key 'C-e'

scripts/copy_pane_pwd.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
3+
CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
44
HELPERS_DIR="$CURRENT_DIR"
55

66
# shellcheck source=scripts/helpers.sh

vagrant_provisioning.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ sudo apt-get update
1010
sudo apt-get install -y tmux=1.9a-1~ppa1~p
1111

1212
# configure X11 for xclip testing
13-
echo "export DISPLAY='IP:0.0'" >> /home/vagrant/.bashrc
13+
echo "export DISPLAY='IP:0.0'" >>/home/vagrant/.bashrc

yank.tmux

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
3+
CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
44
SCRIPTS_DIR="${CURRENT_DIR}/scripts"
55
HELPERS_DIR="${CURRENT_DIR}/scripts"
66

@@ -18,10 +18,10 @@ set_error_bindings() {
1818
for key in $key_bindings; do
1919
if tmux_is_at_least 2.4; then
2020
tmux bind-key -t copy-mode-vi "$key" send-keys -X copy-pipe-and-cancel "tmux display-message 'Error! tmux-yank dependencies not installed!'"
21-
tmux bind-key -t copy-mode "$key" send-keys -X copy-pipe-and-cancel "tmux display-message 'Error! tmux-yank dependencies not installed!'"
21+
tmux bind-key -t copy-mode "$key" send-keys -X copy-pipe-and-cancel "tmux display-message 'Error! tmux-yank dependencies not installed!'"
2222
else
23-
tmux bind-key -t vi-copy "$key" copy-pipe "tmux display-message 'Error! tmux-yank dependencies not installed!'"
24-
tmux bind-key -t emacs-copy "$key" copy-pipe "tmux display-message 'Error! tmux-yank dependencies not installed!'"
23+
tmux bind-key -t vi-copy "$key" copy-pipe "tmux display-message 'Error! tmux-yank dependencies not installed!'"
24+
tmux bind-key -t emacs-copy "$key" copy-pipe "tmux display-message 'Error! tmux-yank dependencies not installed!'"
2525
fi
2626
done
2727
}
@@ -41,25 +41,25 @@ set_copy_mode_bindings() {
4141
local copy_wo_newline_command
4242
copy_wo_newline_command="$(clipboard_copy_without_newline_command "$copy_command")"
4343
if tmux_is_at_least 2.4; then
44-
tmux bind-key -T copy-mode-vi "$(yank_key)" send-keys -X "$(yank_action)" "$copy_command"
45-
tmux bind-key -T copy-mode-vi "$(put_key)" send-keys -X copy-pipe-and-cancel "tmux paste-buffer"
46-
tmux bind-key -T copy-mode-vi "$(yank_put_key)" send-keys -X copy-pipe-and-cancel "$copy_command; tmux paste-buffer"
47-
tmux bind-key -T copy-mode-vi "$(yank_wo_newline_key)" send-keys -X "$(yank_action)" "$copy_wo_newline_command"
44+
tmux bind-key -T copy-mode-vi "$(yank_key)" send-keys -X "$(yank_action)" "$copy_command"
45+
tmux bind-key -T copy-mode-vi "$(put_key)" send-keys -X copy-pipe-and-cancel "tmux paste-buffer"
46+
tmux bind-key -T copy-mode-vi "$(yank_put_key)" send-keys -X copy-pipe-and-cancel "$copy_command; tmux paste-buffer"
47+
tmux bind-key -T copy-mode-vi "$(yank_wo_newline_key)" send-keys -X "$(yank_action)" "$copy_wo_newline_command"
4848

49-
tmux bind-key -T copy-mode "$(yank_key)" send-keys -X "$(yank_action)" "$copy_command"
50-
tmux bind-key -T copy-mode "$(put_key)" send-keys -X copy-pipe-and-cancel "tmux paste-buffer"
51-
tmux bind-key -T copy-mode "$(yank_put_key)" send-keys -X copy-pipe-and-cancel "$copy_command; tmux paste-buffer"
52-
tmux bind-key -T copy-mode "$(yank_wo_newline_key)" send-keys -X "$(yank_action)" "$copy_wo_newline_command"
49+
tmux bind-key -T copy-mode "$(yank_key)" send-keys -X "$(yank_action)" "$copy_command"
50+
tmux bind-key -T copy-mode "$(put_key)" send-keys -X copy-pipe-and-cancel "tmux paste-buffer"
51+
tmux bind-key -T copy-mode "$(yank_put_key)" send-keys -X copy-pipe-and-cancel "$copy_command; tmux paste-buffer"
52+
tmux bind-key -T copy-mode "$(yank_wo_newline_key)" send-keys -X "$(yank_action)" "$copy_wo_newline_command"
5353
else
54-
tmux bind-key -t vi-copy "$(yank_key)" copy-pipe "$copy_command"
55-
tmux bind-key -t vi-copy "$(put_key)" copy-pipe "tmux paste-buffer"
56-
tmux bind-key -t vi-copy "$(yank_put_key)" copy-pipe "$copy_command; tmux paste-buffer"
57-
tmux bind-key -t vi-copy "$(yank_wo_newline_key)" copy-pipe "$copy_wo_newline_command"
54+
tmux bind-key -t vi-copy "$(yank_key)" copy-pipe "$copy_command"
55+
tmux bind-key -t vi-copy "$(put_key)" copy-pipe "tmux paste-buffer"
56+
tmux bind-key -t vi-copy "$(yank_put_key)" copy-pipe "$copy_command; tmux paste-buffer"
57+
tmux bind-key -t vi-copy "$(yank_wo_newline_key)" copy-pipe "$copy_wo_newline_command"
5858

59-
tmux bind-key -t emacs-copy "$(yank_key)" copy-pipe "$copy_command"
60-
tmux bind-key -t emacs-copy "$(put_key)" copy-pipe "tmux paste-buffer"
61-
tmux bind-key -t emacs-copy "$(yank_put_key)" copy-pipe "$copy_command; tmux paste-buffer"
62-
tmux bind-key -t emacs-copy "$(yank_wo_newline_key)" copy-pipe "$copy_wo_newline_command"
59+
tmux bind-key -t emacs-copy "$(yank_key)" copy-pipe "$copy_command"
60+
tmux bind-key -t emacs-copy "$(put_key)" copy-pipe "tmux paste-buffer"
61+
tmux bind-key -t emacs-copy "$(yank_put_key)" copy-pipe "$copy_command; tmux paste-buffer"
62+
tmux bind-key -t emacs-copy "$(yank_wo_newline_key)" copy-pipe "$copy_wo_newline_command"
6363
fi
6464
}
6565

0 commit comments

Comments
 (0)