Last active
October 24, 2021 15:02
-
-
Save wickedev/8e00c00e5aa130dd5d24e41bef1fa4a7 to your computer and use it in GitHub Desktop.
fzf + tail + nl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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