4
4

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.

コマンドの実行結果とかをvimで閲覧する

Last updated at Posted at 2012-05-20

diffコマンドで差分を色付きで見たい場合とかに使います。
bashとかzshなら動作するはず

$ diff -uw a.txt b.txt

<(command)プロセス置換を使ってコマンドの処理結果をvimに渡します

$ vim <(diff -uw a.txt b.txt)

リモートのファイル内容をcatコマンドで出力して、ローカルのvimで開く

$ vim <(ssh user@remote cat a.txt)

ローカルのファイルとリモートサーバのファイルの差分をvimで閲覧する

$ vim <(diff -uw a.txt <(ssh user@remote cat a.txt))
4
4
1

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?