m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-18 08:13:40 -05:00

added ftags with preview since I want to spread the love

Denis Cornehl
2020-01-01 12:10:16 +01:00
parent 2964b68fbe
commit 95e1b1aa29

@@ -678,6 +678,24 @@ ftags() {
}
```
```sh
# ftags - search ctags with preview
# only works if tags-file was generated with --excmd=number
ftags() {
local line
[ -e tags ] &&
line=$(
awk 'BEGIN { FS="\t" } !/^!/ {print toupper($4)"\t"$1"\t"$2"\t"$3}' tags |
fzf \
--nth=1,2 \
--with-nth=2 \
--preview-window="50%" \
--preview="bat {3} --color=always | tail -n +\$(echo {4} | tr -d \";\\\"\")"
) && ${EDITOR:-vim} $(cut -f3 <<< "$line") -c "set nocst" \
-c "silent tag $(cut -f2 <<< "$line")"
}
```
### tmux
```zsh