LoginSignup
0
1

More than 3 years have passed since last update.

EC2にzsh及びoh-my-zshを入れた

Last updated at Posted at 2020-02-01

EC2にZshとoh-my-zsh入れたので、あったら便利な設定。

.zshrc

# 個人的にzsh-autosuggestionsあると便利なので入れる。
plugins=(
        git,
        zsh-autosuggestions
)

autoload -U compinit
compinit

# 補完で小文字も大文字にマッチ
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'

# 重複したディレクトリを追加しない
setopt pushd_ignore_dups

# ヒストリに保存するときに余分なスペースを削除する
setopt hist_reduce_blanks

# cdしたあとで、自動的に ls する
function chpwd() { ls }

# hostnameを表示させる
PROMPT="%{$fg[white]%}%n@%{$fg[green]%}%m%{$reset_color%} ${PROMPT}"

alias sz='source ~/.zshrc'

themeはこの場合なんでもよい。自分ちはmuseなので、EC2内はデフォルトにしたまま。ただ、それだとhostnameとかでなくて誰で動かしてるんや、どこのEC2や!?とかなると不便なのでPROMPT="%{$fg[white]%}%n@%{$fg[green]%}%m%{$reset_color%} ${PROMPT}"こいつを搭載すると捗る雰囲気があります。

echo $SHELLしたりsudo chsh ec2-userしたり、色々したり、EC2内使いやすくなってよかった。
でも、まじで、AWS難しすぎて病む。

0
1
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
0
1