8
8

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.

zshをfish shellっぽくする

Last updated at Posted at 2017-07-27

fish shellは使いやすいけど,やっぱzsh

fish shellは宣言通りユーザーにfriendlyなシェルですが,シェルの文法,特に変数,が違うことろが多数あって結局zshに戻った.しかし,どうしてもfish shellのfriendlyなAutosuggestionsを忘れられず,zshで再現する方法を探したら zsh-autosuggestionsを見つけた.

Install

Macの場合は以下でインストールできる

brew install zsh-autosuggestions

最後は.zshrcにパスを追加する

source /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh

Usage

fish shellと同様に履歴を参照しながらsuggestionをしてくれる

Untitled.png

その状態で,右キーを押せばコマンドの補完ができる.もちろんキーを変更することもできる.自分の場合はCtrl + F と設定した.

設定の変更

/usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh を編集すればいい.例えば.suggestionsの色は ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE

fish shellでも bashスクリプトは実行できるけどね

bassを使えばいいが使いにくい時もある.
変数$も実行できる

> bass export X=3
> echo $X
3
8
8
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
8
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?