m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-19 17:13:42 -05:00

Chrome integration

Junegunn Choi
2015-04-05 03:02:18 +09:00
parent 478f289f75
commit 7647b9eb9e

@@ -268,6 +268,27 @@ alias j=z
alias jj=zz
```
### Google Chrome (OS X)
```sh
# c - browse chrome history
c() {
local cols sep hist
cols=$(( COLUMNS / 3 ))
sep='{{::}}'
# Copy History DB to circumvent the lock
# - See http://stackoverflow.com/questions/8936878 for the file path
cp -f ~/Library/Application\ Support/Google/Chrome/Default/History /tmp/h
sqlite3 -separator $sep /tmp/h \
"select substr(title, 1, $cols), url
from urls order by last_visit_time desc" |
awk -F $sep '{printf "%-'$cols's \x1b[36m%s\n", $1, $2}' |
fzf --ansi --multi | sed 's#.*\(https*://\)#\1#' | xargs open
}
```
### Browsing
```sh