mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-20 09:33:42 -05:00
Add some more examples: docker, pacman, man
39
Examples.md
39
Examples.md
@@ -56,6 +56,7 @@ Table of Contents
|
|||||||
* [fzf as dmenu replacement](#fzf-as-dmenu-replacement)
|
* [fzf as dmenu replacement](#fzf-as-dmenu-replacement)
|
||||||
* [dotfiles management](#dotfiles-management)
|
* [dotfiles management](#dotfiles-management)
|
||||||
* [Transmission](#transmission)
|
* [Transmission](#transmission)
|
||||||
|
* [Pacman](#pacman)
|
||||||
|
|
||||||
|
|
||||||
### General
|
### 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
|
### buku
|
||||||
Search and open website bookmarks stored in a [buku](https://github.com/jarun/Buku) database.
|
Search and open website bookmarks stored in a [buku](https://github.com/jarun/Buku) database.
|
||||||
```sh
|
```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
|
### Python Behave BDD
|
||||||
|
|
||||||
<kbd>Tab</kbd> copy the step name.
|
<kbd>Tab</kbd> copy the step name.
|
||||||
@@ -1617,3 +1640,19 @@ pick_torrent() LBUFFER="transmission-remote -t ${$({
|
|||||||
zle -N pick_torrent
|
zle -N pick_torrent
|
||||||
bindkey '^o' 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
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user