mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-19 09:03:43 -05:00
Adding a couple shortcuts for working with Docker
22
Examples.md
22
Examples.md
@@ -45,6 +45,7 @@ Table of Contents
|
|||||||
* [fzf-marker](#fzf-marker)
|
* [fzf-marker](#fzf-marker)
|
||||||
* [Search for academic pdfs by author, title, keywords, abstract](#search-for-academic-pdfs-by-author-title-journal-institution)
|
* [Search for academic pdfs by author, title, keywords, abstract](#search-for-academic-pdfs-by-author-title-journal-institution)
|
||||||
* [BibTeX](#bibtex)
|
* [BibTeX](#bibtex)
|
||||||
|
* [Docker](#docker)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1159,3 +1160,24 @@ Search records in BibTeX files using FZF, select records to cite, or pretty prin
|
|||||||

|

|
||||||
|
|
||||||
This plugin is at https://github.com/msprev/fzf-bibtex
|
This plugin is at https://github.com/msprev/fzf-bibtex
|
||||||
|
|
||||||
|
### Docker
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# Select a docker container to start and attach to
|
||||||
|
function da() {
|
||||||
|
local cid
|
||||||
|
cid=$(docker ps -a | sed 1d | fzf -1 -q "$1" | awk '{print $1}')
|
||||||
|
|
||||||
|
[ -n "$cid" ] && docker start "$cid" && docker attach "$cid"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# Select a running docker container to stop
|
||||||
|
function ds() {
|
||||||
|
local cid
|
||||||
|
cid=$(docker ps | sed 1d | fzf -q "$1" | awk '{print $1}')
|
||||||
|
|
||||||
|
[ -n "$cid" ] && docker stop "$cid"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user