mirror of
https://github.com/nmasur/dotfiles
synced 2025-04-24 13:52:25 +00:00
Compare commits
No commits in common. "7128cd8d0dcb7ceb7e99e8058ed81f75048bb39a" and "ca1c7cc23f6bf646f5f7e5e2230bc505aa0e77d4" have entirely different histories.
7128cd8d0d
...
ca1c7cc23f
@ -1,23 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# Adapted from: https://gist.github.com/reegnz/b9e40993d410b75c2d866441add2cb55
|
|
||||||
|
|
||||||
if [[ -z $1 ]] || [[ $1 == "-" ]]; then
|
|
||||||
input=$(mktemp)
|
|
||||||
trap 'rm -f $input' EXIT
|
|
||||||
cat /dev/stdin >"$input"
|
|
||||||
else
|
|
||||||
input=$1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo '' |
|
|
||||||
fzf --phony \
|
|
||||||
--height 100% \
|
|
||||||
--preview-window='up:80%' \
|
|
||||||
--query '.' \
|
|
||||||
--print-query \
|
|
||||||
--header $'CTRL-O: jq output\nCTRL-Y: copy output\nALT-Y: copy query' \
|
|
||||||
--preview "jq --color-output -r {q} $input" \
|
|
||||||
--bind "ctrl-o:execute(jq -r {q} $input)+clear-query+accept" \
|
|
||||||
--bind "alt-y:execute(echo {q} | pbcopy)" \
|
|
||||||
--bind "ctrl-y:execute(jq -r {q} $input | pbcopy)"
|
|
@ -41,16 +41,5 @@
|
|||||||
FZF_CTRL_T_COMMAND = fzfCommand;
|
FZF_CTRL_T_COMMAND = fzfCommand;
|
||||||
FZF_DEFAULT_OPTS = "-m --height 50% --border";
|
FZF_DEFAULT_OPTS = "-m --height 50% --border";
|
||||||
};
|
};
|
||||||
|
|
||||||
home.packages = [
|
|
||||||
(pkgs.writeShellApplication {
|
|
||||||
name = "jqr";
|
|
||||||
runtimeInputs = [
|
|
||||||
pkgs.jq
|
|
||||||
pkgs.fzf
|
|
||||||
];
|
|
||||||
text = builtins.readFile ./bash/scripts/jqr.sh;
|
|
||||||
})
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user