mirror of
https://github.com/Aloxaf/fzf-tab.git
synced 2026-09-10 07:26:16 -04:00
* Use zstyle for configuration * Fix bug when disable sort * Fix typo * Fix curcontext * Update doc * All via zstyle and change delimiter to \x02 * Better support of preview * Fix bug when disable sort * Change `fzf_tab` to `fzf-tab` * Add basic test * \2 to \0 * Update
30 lines
459 B
Bash
Executable file
30 lines
459 B
Bash
Executable file
#!/usr/bin/env zsh
|
|
|
|
zmodload zsh/zutil
|
|
|
|
local -A headers range query
|
|
|
|
zparseopts -E h:=headers n:=range q:=query
|
|
|
|
print -r -- "<QUERY>${query//\"/}</QUERY>" >&2
|
|
|
|
local -a lines=()
|
|
while read input; do
|
|
lines+=($input)
|
|
done
|
|
|
|
for ((i = 1; i <= headers; i++)); do
|
|
print -r -- $lines[i] >&2
|
|
done
|
|
|
|
lines[1,headers]=()
|
|
|
|
for i in {1..$#lines}; do
|
|
print -r -- ${lines[i]//$'\0'}"<EC>" >&2
|
|
done
|
|
|
|
|
|
for i in ${(s:,:)range}; do
|
|
print -r -- $lines[i]
|
|
done
|