diff --git a/Examples.md b/Examples.md index a98ffe3..e9e8d40 100644 --- a/Examples.md +++ b/Examples.md @@ -1114,6 +1114,26 @@ c() { #### Bookmarks +Chrome Bookmarks browser with [jq](https://stedolan.github.io/jq/) for OS X +``` +# b - browse chrome bookmarks +b() { + bookmarks_path=~/Library/Application\ Support/Google/Chrome/Default/Bookmarks + + jq_script=' + def ancestors: while(. | length >= 2; del(.[-1,-2])); + . as $in | paths(.url?) as $key | $in | getpath($key) | {name,url, path: [$key[0:-2] | ancestors as $a | $in | getpath($a) | .name?] | reverse | join("/") } | .path + "/" + .name + "\t" + .url' + + jq -r $jq_script < "$bookmarks_path" \ + | sed -E $'s/(.*)\t(.*)/\\1\t\x1b[36m\\2\x1b[m/g' \ + | fzf --ansi \ + | cut -d$'\t' -f2 \ + | xargs open +} +``` + +Chrome Bookmarks browser with ruby + https://gist.github.com/junegunn/15859538658e449b886f (for OS X) ### Browsing