LoginSignup
2
0

More than 5 years have passed since last update.

[fish]コマンドラインのコマンドをクリップボードにコピーする

Posted at

ターミナルを使っていてコマンドをコピペしたいという場面は非常に多いと思います。
特にfishは補完が優秀で、historyからコピーするよりもコマンドラインからコピーする
ということが非常に多いです。

そこでショートカットキーですぐにコピーできるように fish function を書いてみました

commnadline_copy.fish
function commandline_copy
  if type -q pbcopy
    echo (commandline) | pbcopy
  end
end

あとは上記functionをキーバインドに指定するだけです

# Key bindings
function fish_user_key_bindings
  bind \cxc commandline_copy
end

fishermanでインスールできるようにgithubにもあげていますので
よければ使ってみてください

$ fisher tamanugi/fish_commandline_copy
2
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
2
0