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
18
Examples.md
18
Examples.md
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user