Browse Source

fzgit: rewrite log function

pull/6/head
DanielFGray 3 years ago
parent
commit
dd99871f07
6 changed files with 15 additions and 14 deletions
  1. 1
    1
      fv
  2. 8
    7
      fzgit
  3. 1
    1
      fzmv
  4. 2
    2
      ix
  5. 2
    2
      pkgsearch
  6. 1
    1
      sshget

+ 1
- 1
fv View File

@@ -5,7 +5,7 @@ declare c_reset="${esc}[0m"
declare c_red="${esc}[31m"

err() {
echo -e "${c_red}$1${c_reset}" >&2
printf "${c_red}%s${c_reset}\n" "$*" >&2
}

die() {

+ 8
- 7
fzgit View File

@@ -16,7 +16,7 @@ ask() { # {{{
# }}}

err() { # {{{
echo -e "\e[31m$1\e[0m" >&2
printf "\e[31m%s\e[0m" "$*" >&2
}
# }}}

@@ -191,12 +191,13 @@ declare -A implemented_git_cmds=(
)

git_log() { # {{{
local out commit
git log --graph --color=always \
--format="%C(auto)%h%d %s %C(black)%C(bold)%cr" "$@" |
fzf -e --prompt='log' --no-sort --tiebreak=index \
--preview-window=up \
--preview="git show --color=always \"\$(grep -m1 -o \"[a-f0-9]\{7\}\" <<< {})\" | less -R"
local show="git show --color=always \"\$(grep -m1 -o \"[a-f0-9]\{7\}\" <<< {})\""
fzf --prompt='log' -e --no-sort --tiebreak=index \
--preview-window=up \
--bind="enter:execute:$show" \
--preview="$show" \
< <(git log --graph --color=always \
--format="%C(auto)%h%d %s %C(black)%C(bold)%cr" "$@")
}
# }}}


+ 1
- 1
fzmv View File

@@ -8,7 +8,7 @@ declare dryrun verbose
set -e

err() {
echo -e "${c_red}$1${c_reset}" >&2
printf "${c_red}%s${c_reset}\n" "$*" >&2
}

die() {

+ 2
- 2
ix View File

@@ -19,7 +19,7 @@ HELP
}

err() {
echo -e "${c_red}$1${c_reset}" >&2
printf "${c_red}%s${c_reset}\n" "$*" >&2
}

die() {
@@ -78,7 +78,7 @@ listPastes() {
getPastes "$(getUserName)" | nl -p -s' ' -w1 | fzf \
--inline-info --cycle \
--header='Ctrl-E = edit; Ctrl-V = view; Ctrl-D = delete' \
--preview='p=$(awk "{print \$2}" <<< {}); curl -s "$p"' \
--preview='p=$(awk "{print \$2}" <<< {}); curl -s "$p" | highlight -O ansi' \
--bind 'j:down' \
--bind 'k:up' \
--bind 'q:abort' \

+ 2
- 2
pkgsearch View File

@@ -21,7 +21,7 @@ HELP
}

err() {
echo -e "${c_red}$1${c_reset}" >&2
printf "${c_red}%s${c_reset}\n" "$*" >&2
}

die() {
@@ -105,7 +105,7 @@ arch() {
info = gensub(/[^ ]* /, "", 1);
print repo, name, info, descr;
}' blue="$c_blue" green="$c_green" reset="$c_reset"
) | cut -d' ' -f1)
) | cut -d' ' -f2)
[[ "$search" == "pacman" ]] && search="sudo pacman"
install "$search -S" <<< "$packages"
}

+ 1
- 1
sshget View File

@@ -16,7 +16,7 @@ HELP
}

err() {
echo -e "${c_red}$1${c_reset}" >&2
printf "${c_red}%s${c_reset}\n" "$*" >&2
}

die() {

Loading…
Cancel
Save