commit 8ff00256c54f90bcc31c523dfa5ba76f14e1ca43
parent 72807b98444e651eefda5d5431ee170bbc467549
Author: Alex Balgavy <a.balgavy@gmail.com>
Date: Thu, 15 Aug 2019 19:43:05 +0200
commonprofile: more functions
Former-commit-id: 063d71e2c3906ac09f7a41b113319571885be1e7
Diffstat:
1 file changed, 10 insertions(+), 0 deletions(-)
diff --git a/shell/commonprofile b/shell/commonprofile
@@ -279,6 +279,12 @@ if [ -f ~/.fzf.zsh ] || [ -f ~/.fzf.bash ]; then
IFS=$'\n' files=($(command find "$(readlink ~/.scripts)" -type f | fzf -m --inline-info --prompt="edit> " --height=40 --reverse))
[[ -n "$files" ]] && ${EDITOR:-vim} "${files[@]}"
}
+ # script create
+ sc() {
+ [ -z "$1" ] && echo "Filename must be passed as an argument." && exit 1
+ vim $DOTFILES/scripts/"$1"
+ }
+
# config edit
ce() {
local files
@@ -303,6 +309,10 @@ if [ -f ~/.fzf.zsh ] || [ -f ~/.fzf.bash ]; then
rb() {
fzf --print-query --preview-window=right:50% --preview 'bash -c {q}' <<<''
}
+ # run json
+ rj() {
+ fzf --preview "cat $1 | jq {q}"
+ }
fi
# }}}