Skip to content

Instantly share code, notes, and snippets.

@wickedev
Last active October 24, 2021 15:02
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wickedev/8e00c00e5aa130dd5d24e41bef1fa4a7 to your computer and use it in GitHub Desktop.
Save wickedev/8e00c00e5aa130dd5d24e41bef1fa4a7 to your computer and use it in GitHub Desktop.
fzf + tail + nl
#!/bin/bash
tail -n +0 $1 \
| nl -ba \
| fzf --multi \
--ansi \
--no-sort \
--reverse \
--tac \
--preview 'sed -n "$(({n}-4)),$(({n}+6))p" '$1' | nl -v $(({n}-4)) -ba' \
--preview-window down:wrap:70%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment