1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

dockerコンテナIDをpecoで選択してプロンプトにinsertする(anyframe)

Last updated at Posted at 2018-09-12

前提

  • zsh
  • anyframe

Source

.zshrc
# dockerコンテナIDをpecoで選択してプロンプトにinsertする
function anyframe-widget-insert-docker-ps() {
  docker ps | tail -n +2 \
  | anyframe-selector-auto \
  | cut -d" " -f1 \
  | anyframe-action-insert
}
zle -N anyframe-widget-insert-docker-ps
bindkey '^xd' anyframe-widget-insert-docker-ps

https://gist.github.com/amasok/a432e1ad0dd1032826a7bcaeafe89604
上記を.zshrcに書くだけで docker rmの後にctrl+x dと打つだけで、消したいコンテナIDをプロンプトにinsertできる。
同様にdocker logs,docker stopなどにも使える。

参考

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?