7
7

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.

Macでクリップボードを直接編集する

Posted at

コピーした内容をちょっと弄りたいとき。

コマンド

pbpaste | vipe | pbcopy
# aliasを貼っておく。bashrcなど
alias viclip='pbpaste | vipe | pbcopy'

必要なもの

  • HomeBrew
  • moreutils

準備

HomeBrewのインストールをする。
そのあと、moreutilsをインストール。

# vipeが使えるようになる
brew install moreutils

解説

vipemoreutils 内のコマンド。
パイプで渡した出力を編集し、標準出力できる。
pbpaste でクリップボード内を出力し、 vipe で編集し、 pbcopy で編集した内容をクリップボードへ戻す。

7
7
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
7
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?