LoginSignup
10
3

More than 3 years have passed since last update.

oh-my-zshで入力履歴を表示して、補完する

Last updated at Posted at 2019-05-18

tl;dr

oh-my-zshで直近のコマンドをサジェストしたい

  
  
オワコンと言われている? zshoh-my-zshではありますが

使用しているので、書いてみます。

まずは移動

cd ./.oh-my-zsh

  

各自、移動。

スクリーンショット 2019-05-18 11.25.31.png

いた。

pluginsへ移動

cd plugins

zsh-autosuggestionsをクローン

zsh-autosuggestionsをクローン。

git clone https://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions

.zshrcに記載

.zshrcpluginsをgrepして

zsh-autosuggestionsを追加。

plugins=(
    git
    zsh-autosuggestions
)

  

誤って、カンマ入れるとこうなるよ。

[oh-my-zsh] plugin 'git,' not found

  

設定更新。

source ~/.zshrc

やったー

スクリーンショット 2019-05-18 11.44.34.png

補完を確定するには ctrl + f か ctrl + e

なんか薄くてみにくい

補完の文字がデフォだとみにくい。。

と思ったら、設定変更できるみたい。

ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=your_color_code'

fg=your_color_code ってなんすか?

って思って調べたら、ここにあった。

image01.png

13 を選択!

.zshrc に追加!

ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=13'

設定更新!

source ~/.zshrc

やったー!

スクリーンショット 2019-05-18 12.32.28.png

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