12,982
回編集
68行目: | 68行目: | ||
<br><br> | <br><br> | ||
== グローバルエイリアス == | |||
Fishでは、Zshにあるグローバルエイリアスは実装しない方針となっている。<br> | |||
もし、Zshにあるようなグローバルエイリアスを定義するには、<code>bind</code>コマンドと<code>commandline</code>コマンドを使用する。<br> | |||
<br> | |||
以下の例では、[L]キーを押下後に[Ctrl] + [X]キーを同時押下することにより、"| less"が展開されるように設定している。<br> | |||
なお、<code>headコマンド</code>、<code>tail</code>コマンド、<code>grep</code>コマンドも同様である。<br> | |||
<syntaxhighlight lang="fish"> | |||
# bind_global_alias.fishファイル | |||
function bind_global_alias | |||
switch (commandline -t) | |||
case "l" | |||
commandline -rt '| less' | |||
case "h" | |||
commandline -rt '| head' | |||
case "t" | |||
commandline -rt '| tail' | |||
case "g" | |||
commandline -rt '| grep' | |||
end | |||
end | |||
bind \cx bind_global_alias | |||
# by @GReagle@github | |||
# https://github.com/fish-shell/fish-shell/issues/1963#issuecomment-93775067 | |||
</syntaxhighlight> | |||
<br> | |||
== FisherManのインストール == | == FisherManのインストール == | ||
==== FisherManのインストール ==== | ==== FisherManのインストール ==== |