m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-18 08:13:40 -05:00

Add some more examples: docker, pacman, man

Isaac Wismer
2020-11-07 02:08:10 +01:00
parent 9accffc0b8
commit 3c466e7c60

@@ -56,6 +56,7 @@ Table of Contents
* [fzf as dmenu replacement](#fzf-as-dmenu-replacement)
* [dotfiles management](#dotfiles-management)
* [Transmission](#transmission)
* [Pacman](#pacman)
### General
@@ -1464,6 +1465,21 @@ function drm() {
}
```
```sh
# Same as above, but allows multi selection:
function drm() {
docker ps -a | sed 1d | fzf -q "$1" --no-sort -m --tac | awk '{ print $1 }' | xargs -r docker rm
}
```
```sh
# Select a docker image or images to remove
function drmi() {
docker images | sed 1d | fzf -q "$1" --no-sort -m --tac | awk '{ print $3 }' | xargs -r docker rmi
}
```
### buku
Search and open website bookmarks stored in a [buku](https://github.com/jarun/Buku) database.
```sh
@@ -1535,6 +1551,13 @@ fman() {
}
```
```sh
# Same as above, but with previews and works correctly with man pages in different sections.
function fman() {
man -k . | fzf -q "$1" --prompt='man> ' --preview $'echo {} | tr -d \'()\' | awk \'{printf "%s ", $2} {print $1}\' | xargs -r man' | tr -d '()' | awk '{printf "%s ", $2} {print $1}' | xargs -r man
}
```
### Python Behave BDD
<kbd>Tab</kbd> copy the step name.
@@ -1616,4 +1639,20 @@ pick_torrent() LBUFFER="transmission-remote -t ${$({
} | fzf)%% *} -"
zle -N pick_torrent
bindkey '^o' pick_torrent
```
```
### Pacman
```sh
# Install packages using yay (change to pacman/AUR helper of your choice)
function in() {
yay -Slq | fzf -q "$1" -m --preview 'yay -Si {1}'| xargs -ro yay -S
}
```
```sh
# Remove installed packages (change to pacman/AUR helper of your choice)
function re() {
yay -Qq | fzf -q "$1" -m --preview 'yay -Qi {1}' | xargs -ro yay -Rns
}
```