#!/usr/bin/env bash # # search tags with fzf # set -euo pipefail tags=${CODEROOT:?}/tags tag_search=$( awk 'BEGIN { FS="\t" } !/^!/ {print toupper($4)"\t"$1"\t"$2"\t"$3}' "$tags" \ | cut -c1-80 \ | fzf-tmux \ --nth=1,2 \ --preview-window=down,border-none \ --bind="pgdn:preview-page-down" \ --bind="pgup:preview-page-up" \ --preview "rg --pretty --context 2 --fixed-strings --regexp {+2}" ) ${EDITOR:-vim} \ "$(cut -f3 <<< "$tag_search")" \ -c "set nocst" \ -c "silent tag $(cut -f2 <<< "$tag_search")" ##