doing 2.0.20 → 2.0.24
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/doing.rdoc +1 -1
- data/lib/doing/log_adapter.rb +3 -1
- data/lib/doing/version.rb +1 -1
- data/lib/doing/wwid.rb +19 -8
- data/lib/helpers/fzf/.goreleaser.yml +119 -0
- data/lib/helpers/fzf/.rubocop.yml +28 -0
- data/lib/helpers/fzf/ADVANCED.md +565 -0
- data/lib/helpers/fzf/BUILD.md +49 -0
- data/lib/helpers/fzf/CHANGELOG.md +1193 -0
- data/lib/helpers/fzf/Dockerfile +11 -0
- data/lib/helpers/fzf/LICENSE +21 -0
- data/lib/helpers/fzf/Makefile +166 -0
- data/lib/helpers/fzf/README-VIM.md +486 -0
- data/lib/helpers/fzf/README.md +712 -0
- data/lib/helpers/fzf/bin/fzf-tmux +233 -0
- data/lib/helpers/fzf/doc/fzf.txt +512 -0
- data/lib/helpers/fzf/go.mod +17 -0
- data/lib/helpers/fzf/go.sum +31 -0
- data/lib/helpers/fzf/install +382 -0
- data/lib/helpers/fzf/install.ps1 +65 -0
- data/lib/helpers/fzf/main.go +14 -0
- data/lib/helpers/fzf/man/man1/fzf-tmux.1 +68 -0
- data/lib/helpers/fzf/man/man1/fzf.1 +1001 -0
- data/lib/helpers/fzf/plugin/fzf.vim +1048 -0
- data/lib/helpers/fzf/shell/completion.bash +381 -0
- data/lib/helpers/fzf/shell/completion.zsh +329 -0
- data/lib/helpers/fzf/shell/key-bindings.bash +96 -0
- data/lib/helpers/fzf/shell/key-bindings.fish +172 -0
- data/lib/helpers/fzf/shell/key-bindings.zsh +114 -0
- data/lib/helpers/fzf/src/LICENSE +21 -0
- data/lib/helpers/fzf/src/algo/algo.go +884 -0
- data/lib/helpers/fzf/src/algo/algo_test.go +197 -0
- data/lib/helpers/fzf/src/algo/normalize.go +492 -0
- data/lib/helpers/fzf/src/ansi.go +409 -0
- data/lib/helpers/fzf/src/ansi_test.go +427 -0
- data/lib/helpers/fzf/src/cache.go +81 -0
- data/lib/helpers/fzf/src/cache_test.go +39 -0
- data/lib/helpers/fzf/src/chunklist.go +89 -0
- data/lib/helpers/fzf/src/chunklist_test.go +80 -0
- data/lib/helpers/fzf/src/constants.go +85 -0
- data/lib/helpers/fzf/src/core.go +351 -0
- data/lib/helpers/fzf/src/history.go +96 -0
- data/lib/helpers/fzf/src/history_test.go +68 -0
- data/lib/helpers/fzf/src/item.go +44 -0
- data/lib/helpers/fzf/src/item_test.go +23 -0
- data/lib/helpers/fzf/src/matcher.go +235 -0
- data/lib/helpers/fzf/src/merger.go +120 -0
- data/lib/helpers/fzf/src/merger_test.go +88 -0
- data/lib/helpers/fzf/src/options.go +1691 -0
- data/lib/helpers/fzf/src/options_test.go +457 -0
- data/lib/helpers/fzf/src/pattern.go +425 -0
- data/lib/helpers/fzf/src/pattern_test.go +209 -0
- data/lib/helpers/fzf/src/protector/protector.go +8 -0
- data/lib/helpers/fzf/src/protector/protector_openbsd.go +10 -0
- data/lib/helpers/fzf/src/reader.go +201 -0
- data/lib/helpers/fzf/src/reader_test.go +63 -0
- data/lib/helpers/fzf/src/result.go +243 -0
- data/lib/helpers/fzf/src/result_others.go +16 -0
- data/lib/helpers/fzf/src/result_test.go +159 -0
- data/lib/helpers/fzf/src/result_x86.go +16 -0
- data/lib/helpers/fzf/src/terminal.go +2832 -0
- data/lib/helpers/fzf/src/terminal_test.go +638 -0
- data/lib/helpers/fzf/src/terminal_unix.go +26 -0
- data/lib/helpers/fzf/src/terminal_windows.go +45 -0
- data/lib/helpers/fzf/src/tokenizer.go +253 -0
- data/lib/helpers/fzf/src/tokenizer_test.go +112 -0
- data/lib/helpers/fzf/src/tui/dummy.go +46 -0
- data/lib/helpers/fzf/src/tui/light.go +987 -0
- data/lib/helpers/fzf/src/tui/light_unix.go +110 -0
- data/lib/helpers/fzf/src/tui/light_windows.go +145 -0
- data/lib/helpers/fzf/src/tui/tcell.go +721 -0
- data/lib/helpers/fzf/src/tui/tcell_test.go +392 -0
- data/lib/helpers/fzf/src/tui/ttyname_unix.go +47 -0
- data/lib/helpers/fzf/src/tui/ttyname_windows.go +14 -0
- data/lib/helpers/fzf/src/tui/tui.go +625 -0
- data/lib/helpers/fzf/src/tui/tui_test.go +20 -0
- data/lib/helpers/fzf/src/util/atomicbool.go +34 -0
- data/lib/helpers/fzf/src/util/atomicbool_test.go +17 -0
- data/lib/helpers/fzf/src/util/chars.go +198 -0
- data/lib/helpers/fzf/src/util/chars_test.go +46 -0
- data/lib/helpers/fzf/src/util/eventbox.go +96 -0
- data/lib/helpers/fzf/src/util/eventbox_test.go +61 -0
- data/lib/helpers/fzf/src/util/slab.go +12 -0
- data/lib/helpers/fzf/src/util/util.go +138 -0
- data/lib/helpers/fzf/src/util/util_test.go +40 -0
- data/lib/helpers/fzf/src/util/util_unix.go +47 -0
- data/lib/helpers/fzf/src/util/util_windows.go +83 -0
- data/lib/helpers/fzf/test/fzf.vader +175 -0
- data/lib/helpers/fzf/test/test_go.rb +2626 -0
- data/lib/helpers/fzf/uninstall +117 -0
- metadata +88 -2
@@ -0,0 +1,382 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
|
3
|
+
set -u
|
4
|
+
|
5
|
+
version=0.28.0
|
6
|
+
auto_completion=
|
7
|
+
key_bindings=
|
8
|
+
update_config=2
|
9
|
+
shells="bash zsh fish"
|
10
|
+
prefix='~/.fzf'
|
11
|
+
prefix_expand=~/.fzf
|
12
|
+
fish_dir=${XDG_CONFIG_HOME:-$HOME/.config}/fish
|
13
|
+
|
14
|
+
help() {
|
15
|
+
cat << EOF
|
16
|
+
usage: $0 [OPTIONS]
|
17
|
+
|
18
|
+
--help Show this message
|
19
|
+
--bin Download fzf binary only; Do not generate ~/.fzf.{bash,zsh}
|
20
|
+
--all Download fzf binary and update configuration files
|
21
|
+
to enable key bindings and fuzzy completion
|
22
|
+
--xdg Generate files under \$XDG_CONFIG_HOME/fzf
|
23
|
+
--[no-]key-bindings Enable/disable key bindings (CTRL-T, CTRL-R, ALT-C)
|
24
|
+
--[no-]completion Enable/disable fuzzy completion (bash & zsh)
|
25
|
+
--[no-]update-rc Whether or not to update shell configuration files
|
26
|
+
|
27
|
+
--no-bash Do not set up bash configuration
|
28
|
+
--no-zsh Do not set up zsh configuration
|
29
|
+
--no-fish Do not set up fish configuration
|
30
|
+
EOF
|
31
|
+
}
|
32
|
+
|
33
|
+
for opt in "$@"; do
|
34
|
+
case $opt in
|
35
|
+
--help)
|
36
|
+
help
|
37
|
+
exit 0
|
38
|
+
;;
|
39
|
+
--all)
|
40
|
+
auto_completion=1
|
41
|
+
key_bindings=1
|
42
|
+
update_config=1
|
43
|
+
;;
|
44
|
+
--xdg)
|
45
|
+
prefix='"${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf'
|
46
|
+
prefix_expand=${XDG_CONFIG_HOME:-$HOME/.config}/fzf/fzf
|
47
|
+
mkdir -p "${XDG_CONFIG_HOME:-$HOME/.config}/fzf"
|
48
|
+
;;
|
49
|
+
--key-bindings) key_bindings=1 ;;
|
50
|
+
--no-key-bindings) key_bindings=0 ;;
|
51
|
+
--completion) auto_completion=1 ;;
|
52
|
+
--no-completion) auto_completion=0 ;;
|
53
|
+
--update-rc) update_config=1 ;;
|
54
|
+
--no-update-rc) update_config=0 ;;
|
55
|
+
--bin) ;;
|
56
|
+
--no-bash) shells=${shells/bash/} ;;
|
57
|
+
--no-zsh) shells=${shells/zsh/} ;;
|
58
|
+
--no-fish) shells=${shells/fish/} ;;
|
59
|
+
*)
|
60
|
+
echo "unknown option: $opt"
|
61
|
+
help
|
62
|
+
exit 1
|
63
|
+
;;
|
64
|
+
esac
|
65
|
+
done
|
66
|
+
|
67
|
+
cd "$(dirname "${BASH_SOURCE[0]}")"
|
68
|
+
fzf_base=$(pwd)
|
69
|
+
fzf_base_esc=$(printf %q "$fzf_base")
|
70
|
+
|
71
|
+
ask() {
|
72
|
+
while true; do
|
73
|
+
read -p "$1 ([y]/n) " -r
|
74
|
+
REPLY=${REPLY:-"y"}
|
75
|
+
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
76
|
+
return 1
|
77
|
+
elif [[ $REPLY =~ ^[Nn]$ ]]; then
|
78
|
+
return 0
|
79
|
+
fi
|
80
|
+
done
|
81
|
+
}
|
82
|
+
|
83
|
+
check_binary() {
|
84
|
+
echo -n " - Checking fzf executable ... "
|
85
|
+
local output
|
86
|
+
output=$("$fzf_base"/bin/fzf --version 2>&1)
|
87
|
+
if [ $? -ne 0 ]; then
|
88
|
+
echo "Error: $output"
|
89
|
+
binary_error="Invalid binary"
|
90
|
+
else
|
91
|
+
output=${output/ */}
|
92
|
+
if [ "$version" != "$output" ]; then
|
93
|
+
echo "$output != $version"
|
94
|
+
binary_error="Invalid version"
|
95
|
+
else
|
96
|
+
echo "$output"
|
97
|
+
binary_error=""
|
98
|
+
return 0
|
99
|
+
fi
|
100
|
+
fi
|
101
|
+
rm -f "$fzf_base"/bin/fzf
|
102
|
+
return 1
|
103
|
+
}
|
104
|
+
|
105
|
+
link_fzf_in_path() {
|
106
|
+
if which_fzf="$(command -v fzf)"; then
|
107
|
+
echo " - Found in \$PATH"
|
108
|
+
echo " - Creating symlink: bin/fzf -> $which_fzf"
|
109
|
+
(cd "$fzf_base"/bin && rm -f fzf && ln -sf "$which_fzf" fzf)
|
110
|
+
check_binary && return
|
111
|
+
fi
|
112
|
+
return 1
|
113
|
+
}
|
114
|
+
|
115
|
+
try_curl() {
|
116
|
+
command -v curl > /dev/null &&
|
117
|
+
if [[ $1 =~ tar.gz$ ]]; then
|
118
|
+
curl -fL $1 | tar -xzf -
|
119
|
+
else
|
120
|
+
local temp=${TMPDIR:-/tmp}/fzf.zip
|
121
|
+
curl -fLo "$temp" $1 && unzip -o "$temp" && rm -f "$temp"
|
122
|
+
fi
|
123
|
+
}
|
124
|
+
|
125
|
+
try_wget() {
|
126
|
+
command -v wget > /dev/null &&
|
127
|
+
if [[ $1 =~ tar.gz$ ]]; then
|
128
|
+
wget -O - $1 | tar -xzf -
|
129
|
+
else
|
130
|
+
local temp=${TMPDIR:-/tmp}/fzf.zip
|
131
|
+
wget -O "$temp" $1 && unzip -o "$temp" && rm -f "$temp"
|
132
|
+
fi
|
133
|
+
}
|
134
|
+
|
135
|
+
download() {
|
136
|
+
echo "Downloading bin/fzf ..."
|
137
|
+
if [ -x "$fzf_base"/bin/fzf ]; then
|
138
|
+
echo " - Already exists"
|
139
|
+
check_binary && return
|
140
|
+
fi
|
141
|
+
link_fzf_in_path && return
|
142
|
+
mkdir -p "$fzf_base"/bin && cd "$fzf_base"/bin
|
143
|
+
if [ $? -ne 0 ]; then
|
144
|
+
binary_error="Failed to create bin directory"
|
145
|
+
return
|
146
|
+
fi
|
147
|
+
|
148
|
+
local url
|
149
|
+
url=https://github.com/junegunn/fzf/releases/download/$version/${1}
|
150
|
+
set -o pipefail
|
151
|
+
if ! (try_curl $url || try_wget $url); then
|
152
|
+
set +o pipefail
|
153
|
+
binary_error="Failed to download with curl and wget"
|
154
|
+
return
|
155
|
+
fi
|
156
|
+
set +o pipefail
|
157
|
+
|
158
|
+
if [ ! -f fzf ]; then
|
159
|
+
binary_error="Failed to download ${1}"
|
160
|
+
return
|
161
|
+
fi
|
162
|
+
|
163
|
+
chmod +x fzf && check_binary
|
164
|
+
}
|
165
|
+
|
166
|
+
# Try to download binary executable
|
167
|
+
archi=$(uname -sm)
|
168
|
+
binary_available=1
|
169
|
+
binary_error=""
|
170
|
+
case "$archi" in
|
171
|
+
Darwin\ arm64) download fzf-$version-darwin_arm64.zip ;;
|
172
|
+
Darwin\ x86_64) download fzf-$version-darwin_amd64.zip ;;
|
173
|
+
Linux\ armv5*) download fzf-$version-linux_armv5.tar.gz ;;
|
174
|
+
Linux\ armv6*) download fzf-$version-linux_armv6.tar.gz ;;
|
175
|
+
Linux\ armv7*) download fzf-$version-linux_armv7.tar.gz ;;
|
176
|
+
Linux\ armv8*) download fzf-$version-linux_arm64.tar.gz ;;
|
177
|
+
Linux\ aarch64*) download fzf-$version-linux_arm64.tar.gz ;;
|
178
|
+
Linux\ *64) download fzf-$version-linux_amd64.tar.gz ;;
|
179
|
+
FreeBSD\ *64) download fzf-$version-freebsd_amd64.tar.gz ;;
|
180
|
+
OpenBSD\ *64) download fzf-$version-openbsd_amd64.tar.gz ;;
|
181
|
+
CYGWIN*\ *64) download fzf-$version-windows_amd64.zip ;;
|
182
|
+
MINGW*\ *64) download fzf-$version-windows_amd64.zip ;;
|
183
|
+
MSYS*\ *64) download fzf-$version-windows_amd64.zip ;;
|
184
|
+
Windows*\ *64) download fzf-$version-windows_amd64.zip ;;
|
185
|
+
*) binary_available=0 binary_error=1 ;;
|
186
|
+
esac
|
187
|
+
|
188
|
+
cd "$fzf_base"
|
189
|
+
if [ -n "$binary_error" ]; then
|
190
|
+
if [ $binary_available -eq 0 ]; then
|
191
|
+
echo "No prebuilt binary for $archi ..."
|
192
|
+
else
|
193
|
+
echo " - $binary_error !!!"
|
194
|
+
fi
|
195
|
+
if command -v go > /dev/null; then
|
196
|
+
echo -n "Building binary (go get -u github.com/junegunn/fzf) ... "
|
197
|
+
if [ -z "${GOPATH-}" ]; then
|
198
|
+
export GOPATH="${TMPDIR:-/tmp}/fzf-gopath"
|
199
|
+
mkdir -p "$GOPATH"
|
200
|
+
fi
|
201
|
+
if go get -ldflags "-s -w -X main.version=$version -X main.revision=go-get" github.com/junegunn/fzf; then
|
202
|
+
echo "OK"
|
203
|
+
cp "$GOPATH/bin/fzf" "$fzf_base/bin/"
|
204
|
+
else
|
205
|
+
echo "Failed to build binary. Installation failed."
|
206
|
+
exit 1
|
207
|
+
fi
|
208
|
+
else
|
209
|
+
echo "go executable not found. Installation failed."
|
210
|
+
exit 1
|
211
|
+
fi
|
212
|
+
fi
|
213
|
+
|
214
|
+
[[ "$*" =~ "--bin" ]] && exit 0
|
215
|
+
|
216
|
+
for s in $shells; do
|
217
|
+
if ! command -v "$s" > /dev/null; then
|
218
|
+
shells=${shells/$s/}
|
219
|
+
fi
|
220
|
+
done
|
221
|
+
|
222
|
+
if [[ ${#shells} -lt 3 ]]; then
|
223
|
+
echo "No shell configuration to be updated."
|
224
|
+
exit 0
|
225
|
+
fi
|
226
|
+
|
227
|
+
# Auto-completion
|
228
|
+
if [ -z "$auto_completion" ]; then
|
229
|
+
ask "Do you want to enable fuzzy auto-completion?"
|
230
|
+
auto_completion=$?
|
231
|
+
fi
|
232
|
+
|
233
|
+
# Key-bindings
|
234
|
+
if [ -z "$key_bindings" ]; then
|
235
|
+
ask "Do you want to enable key bindings?"
|
236
|
+
key_bindings=$?
|
237
|
+
fi
|
238
|
+
|
239
|
+
echo
|
240
|
+
for shell in $shells; do
|
241
|
+
[[ "$shell" = fish ]] && continue
|
242
|
+
src=${prefix_expand}.${shell}
|
243
|
+
echo -n "Generate $src ... "
|
244
|
+
|
245
|
+
fzf_completion="[[ \$- == *i* ]] && source \"$fzf_base/shell/completion.${shell}\" 2> /dev/null"
|
246
|
+
if [ $auto_completion -eq 0 ]; then
|
247
|
+
fzf_completion="# $fzf_completion"
|
248
|
+
fi
|
249
|
+
|
250
|
+
fzf_key_bindings="source \"$fzf_base/shell/key-bindings.${shell}\""
|
251
|
+
if [ $key_bindings -eq 0 ]; then
|
252
|
+
fzf_key_bindings="# $fzf_key_bindings"
|
253
|
+
fi
|
254
|
+
|
255
|
+
cat > "$src" << EOF
|
256
|
+
# Setup fzf
|
257
|
+
# ---------
|
258
|
+
if [[ ! "\$PATH" == *$fzf_base_esc/bin* ]]; then
|
259
|
+
export PATH="\${PATH:+\${PATH}:}$fzf_base/bin"
|
260
|
+
fi
|
261
|
+
|
262
|
+
# Auto-completion
|
263
|
+
# ---------------
|
264
|
+
$fzf_completion
|
265
|
+
|
266
|
+
# Key bindings
|
267
|
+
# ------------
|
268
|
+
$fzf_key_bindings
|
269
|
+
EOF
|
270
|
+
echo "OK"
|
271
|
+
done
|
272
|
+
|
273
|
+
# fish
|
274
|
+
if [[ "$shells" =~ fish ]]; then
|
275
|
+
echo -n "Update fish_user_paths ... "
|
276
|
+
fish << EOF
|
277
|
+
echo \$fish_user_paths | \grep "$fzf_base"/bin > /dev/null
|
278
|
+
or set --universal fish_user_paths \$fish_user_paths "$fzf_base"/bin
|
279
|
+
EOF
|
280
|
+
[ $? -eq 0 ] && echo "OK" || echo "Failed"
|
281
|
+
|
282
|
+
mkdir -p "${fish_dir}/functions"
|
283
|
+
if [ -e "${fish_dir}/functions/fzf.fish" ]; then
|
284
|
+
echo -n "Remove unnecessary ${fish_dir}/functions/fzf.fish ... "
|
285
|
+
rm -f "${fish_dir}/functions/fzf.fish" && echo "OK" || echo "Failed"
|
286
|
+
fi
|
287
|
+
|
288
|
+
fish_binding="${fish_dir}/functions/fzf_key_bindings.fish"
|
289
|
+
if [ $key_bindings -ne 0 ]; then
|
290
|
+
echo -n "Symlink $fish_binding ... "
|
291
|
+
ln -sf "$fzf_base/shell/key-bindings.fish" \
|
292
|
+
"$fish_binding" && echo "OK" || echo "Failed"
|
293
|
+
else
|
294
|
+
echo -n "Removing $fish_binding ... "
|
295
|
+
rm -f "$fish_binding"
|
296
|
+
echo "OK"
|
297
|
+
fi
|
298
|
+
fi
|
299
|
+
|
300
|
+
append_line() {
|
301
|
+
set -e
|
302
|
+
|
303
|
+
local update line file pat lno
|
304
|
+
update="$1"
|
305
|
+
line="$2"
|
306
|
+
file="$3"
|
307
|
+
pat="${4:-}"
|
308
|
+
lno=""
|
309
|
+
|
310
|
+
echo "Update $file:"
|
311
|
+
echo " - $line"
|
312
|
+
if [ -f "$file" ]; then
|
313
|
+
if [ $# -lt 4 ]; then
|
314
|
+
lno=$(\grep -nF "$line" "$file" | sed 's/:.*//' | tr '\n' ' ')
|
315
|
+
else
|
316
|
+
lno=$(\grep -nF "$pat" "$file" | sed 's/:.*//' | tr '\n' ' ')
|
317
|
+
fi
|
318
|
+
fi
|
319
|
+
if [ -n "$lno" ]; then
|
320
|
+
echo " - Already exists: line #$lno"
|
321
|
+
else
|
322
|
+
if [ $update -eq 1 ]; then
|
323
|
+
[ -f "$file" ] && echo >> "$file"
|
324
|
+
echo "$line" >> "$file"
|
325
|
+
echo " + Added"
|
326
|
+
else
|
327
|
+
echo " ~ Skipped"
|
328
|
+
fi
|
329
|
+
fi
|
330
|
+
echo
|
331
|
+
set +e
|
332
|
+
}
|
333
|
+
|
334
|
+
create_file() {
|
335
|
+
local file="$1"
|
336
|
+
shift
|
337
|
+
echo "Create $file:"
|
338
|
+
for line in "$@"; do
|
339
|
+
echo " $line"
|
340
|
+
echo "$line" >> "$file"
|
341
|
+
done
|
342
|
+
echo
|
343
|
+
}
|
344
|
+
|
345
|
+
if [ $update_config -eq 2 ]; then
|
346
|
+
echo
|
347
|
+
ask "Do you want to update your shell configuration files?"
|
348
|
+
update_config=$?
|
349
|
+
fi
|
350
|
+
echo
|
351
|
+
for shell in $shells; do
|
352
|
+
[[ "$shell" = fish ]] && continue
|
353
|
+
[ $shell = zsh ] && dest=${ZDOTDIR:-~}/.zshrc || dest=~/.bashrc
|
354
|
+
append_line $update_config "[ -f ${prefix}.${shell} ] && source ${prefix}.${shell}" "$dest" "${prefix}.${shell}"
|
355
|
+
done
|
356
|
+
|
357
|
+
if [ $key_bindings -eq 1 ] && [[ "$shells" =~ fish ]]; then
|
358
|
+
bind_file="${fish_dir}/functions/fish_user_key_bindings.fish"
|
359
|
+
if [ ! -e "$bind_file" ]; then
|
360
|
+
create_file "$bind_file" \
|
361
|
+
'function fish_user_key_bindings' \
|
362
|
+
' fzf_key_bindings' \
|
363
|
+
'end'
|
364
|
+
else
|
365
|
+
append_line $update_config "fzf_key_bindings" "$bind_file"
|
366
|
+
fi
|
367
|
+
fi
|
368
|
+
|
369
|
+
if [ $update_config -eq 1 ]; then
|
370
|
+
echo 'Finished. Restart your shell or reload config file.'
|
371
|
+
if [[ "$shells" =~ bash ]]; then
|
372
|
+
echo -n ' source ~/.bashrc # bash'
|
373
|
+
[[ "$archi" =~ Darwin ]] && echo -n ' (.bashrc should be loaded from .bash_profile)'
|
374
|
+
echo
|
375
|
+
fi
|
376
|
+
[[ "$shells" =~ zsh ]] && echo " source ${ZDOTDIR:-~}/.zshrc # zsh"
|
377
|
+
[[ "$shells" =~ fish ]] && [ $key_bindings -eq 1 ] && echo ' fzf_key_bindings # fish'
|
378
|
+
echo
|
379
|
+
echo 'Use uninstall script to remove fzf.'
|
380
|
+
echo
|
381
|
+
fi
|
382
|
+
echo 'For more information, see: https://github.com/junegunn/fzf'
|
@@ -0,0 +1,65 @@
|
|
1
|
+
$version="0.28.0"
|
2
|
+
|
3
|
+
$fzf_base=Split-Path -Parent $MyInvocation.MyCommand.Definition
|
4
|
+
|
5
|
+
function check_binary () {
|
6
|
+
Write-Host " - Checking fzf executable ... " -NoNewline
|
7
|
+
$output=cmd /c $fzf_base\bin\fzf.exe --version 2>&1
|
8
|
+
if (-not $?) {
|
9
|
+
Write-Host "Error: $output"
|
10
|
+
$binary_error="Invalid binary"
|
11
|
+
} else {
|
12
|
+
$output=(-Split $output)[0]
|
13
|
+
if ($version -ne $output) {
|
14
|
+
Write-Host "$output != $version"
|
15
|
+
$binary_error="Invalid version"
|
16
|
+
} else {
|
17
|
+
Write-Host "$output"
|
18
|
+
$binary_error=""
|
19
|
+
return 1
|
20
|
+
}
|
21
|
+
}
|
22
|
+
Remove-Item "$fzf_base\bin\fzf.exe"
|
23
|
+
return 0
|
24
|
+
}
|
25
|
+
|
26
|
+
function download {
|
27
|
+
param($file)
|
28
|
+
Write-Host "Downloading bin/fzf ..."
|
29
|
+
if (Test-Path "$fzf_base\bin\fzf.exe") {
|
30
|
+
Write-Host " - Already exists"
|
31
|
+
if (check_binary) {
|
32
|
+
return
|
33
|
+
}
|
34
|
+
}
|
35
|
+
if (-not (Test-Path "$fzf_base\bin")) {
|
36
|
+
md "$fzf_base\bin"
|
37
|
+
}
|
38
|
+
if (-not $?) {
|
39
|
+
$binary_error="Failed to create bin directory"
|
40
|
+
return
|
41
|
+
}
|
42
|
+
cd "$fzf_base\bin"
|
43
|
+
$url="https://github.com/junegunn/fzf/releases/download/$version/$file"
|
44
|
+
$temp=$env:TMP + "\fzf.zip"
|
45
|
+
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
46
|
+
if ($PSVersionTable.PSVersion.Major -ge 3) {
|
47
|
+
Invoke-WebRequest -Uri $url -OutFile $temp
|
48
|
+
} else {
|
49
|
+
(New-Object Net.WebClient).DownloadFile($url, $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath("$temp"))
|
50
|
+
}
|
51
|
+
if ($?) {
|
52
|
+
(Microsoft.PowerShell.Archive\Expand-Archive -Path $temp -DestinationPath .); (Remove-Item $temp)
|
53
|
+
} else {
|
54
|
+
$binary_error="Failed to download with powershell"
|
55
|
+
}
|
56
|
+
if (-not (Test-Path fzf.exe)) {
|
57
|
+
$binary_error="Failed to download $file"
|
58
|
+
return
|
59
|
+
}
|
60
|
+
echo y | icacls $fzf_base\bin\fzf.exe /grant Administrator:F ; check_binary >$null
|
61
|
+
}
|
62
|
+
|
63
|
+
download "fzf-$version-windows_amd64.zip"
|
64
|
+
|
65
|
+
Write-Host 'For more information, see: https://github.com/junegunn/fzf'
|
@@ -0,0 +1,14 @@
|
|
1
|
+
package main
|
2
|
+
|
3
|
+
import (
|
4
|
+
fzf "github.com/junegunn/fzf/src"
|
5
|
+
"github.com/junegunn/fzf/src/protector"
|
6
|
+
)
|
7
|
+
|
8
|
+
var version string = "0.28"
|
9
|
+
var revision string = "devel"
|
10
|
+
|
11
|
+
func main() {
|
12
|
+
protector.Protect()
|
13
|
+
fzf.Run(fzf.ParseOptions(), version, revision)
|
14
|
+
}
|
@@ -0,0 +1,68 @@
|
|
1
|
+
.ig
|
2
|
+
The MIT License (MIT)
|
3
|
+
|
4
|
+
Copyright (c) 2013-2021 Junegunn Choi
|
5
|
+
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
8
|
+
in the Software without restriction, including without limitation the rights
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
11
|
+
furnished to do so, subject to the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be included in
|
14
|
+
all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
|
+
THE SOFTWARE.
|
23
|
+
..
|
24
|
+
.TH fzf-tmux 1 "Nov 2021" "fzf 0.28.0" "fzf-tmux - open fzf in tmux split pane"
|
25
|
+
|
26
|
+
.SH NAME
|
27
|
+
fzf-tmux - open fzf in tmux split pane
|
28
|
+
|
29
|
+
.SH SYNOPSIS
|
30
|
+
.B fzf-tmux [LAYOUT OPTIONS] [--] [FZF OPTIONS]
|
31
|
+
|
32
|
+
.SH DESCRIPTION
|
33
|
+
fzf-tmux is a wrapper script for fzf that opens fzf in a tmux split pane or in
|
34
|
+
a tmux popup window. It is designed to work just like fzf except that it does
|
35
|
+
not take up the whole screen. You can safely use fzf-tmux instead of fzf in
|
36
|
+
your scripts as the extra options will be silently ignored if you're not on
|
37
|
+
tmux.
|
38
|
+
|
39
|
+
.SH LAYOUT OPTIONS
|
40
|
+
|
41
|
+
(default layout: \fB-d 50%\fR)
|
42
|
+
|
43
|
+
.SS Popup window
|
44
|
+
(requires tmux 3.2 or above)
|
45
|
+
.TP
|
46
|
+
.B "-p [WIDTH[%][,HEIGHT[%]]]"
|
47
|
+
.TP
|
48
|
+
.B "-w WIDTH[%]"
|
49
|
+
.TP
|
50
|
+
.B "-h WIDTH[%]"
|
51
|
+
.TP
|
52
|
+
.B "-x COL"
|
53
|
+
.TP
|
54
|
+
.B "-y ROW"
|
55
|
+
|
56
|
+
.SS Split pane
|
57
|
+
.TP
|
58
|
+
.B "-u [height[%]]"
|
59
|
+
Split above (up)
|
60
|
+
.TP
|
61
|
+
.B "-d [height[%]]"
|
62
|
+
Split below (down)
|
63
|
+
.TP
|
64
|
+
.B "-l [width[%]]"
|
65
|
+
Split left
|
66
|
+
.TP
|
67
|
+
.B "-r [width[%]]"
|
68
|
+
Split right
|