Skip to content

Instantly share code, notes, and snippets.

@higumachan
Last active July 5, 2022 07:47
Show Gist options
  • Save higumachan/bffca4265a6849cb6c2b2927d94f9186 to your computer and use it in GitHub Desktop.
Save higumachan/bffca4265a6849cb6c2b2927d94f9186 to your computer and use it in GitHub Desktop.
いい感じに検索しながらpreview
sk --ansi -i -c 'ag --color "{}"' --preview "python preview.py {}"
brew ag
cargo install skim
import os
import sys
a = sys.argv[1].split(":")[0]
os.system("cat {} | jq .".format(a))
@td72
Copy link

td72 commented Jul 5, 2022

sk --ansi -i -c 'ag --color "{}"' --preview 'cat $(echo {} | cut -d':' -f1) | jq .'

@td72
Copy link

td72 commented Jul 5, 2022

たぶんこれで検索したワードと前後5行を表示できる気がする

sk --ansi -i -c 'ag --color "{}"' --preview 'cat $(echo {} | cut -d':' -f1) | jq . | grep -5 {}'

@td72
Copy link

td72 commented Jul 5, 2022

だめでした

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment