LoginSignup
15
22

More than 3 years have passed since last update.

Ubuntuのターミナルを Zsh + oh-my-zsh で使いやすく(備忘録)

Last updated at Posted at 2019-06-26

環境 ubuntu 18.04
完成状態
Screenshot from 2019-06-26 21-56-38.png

zshをインストールしてデフォルトシェルにする

sudo apt update
sudo apt install zsh powerline fonts-powerline
chsh -s /bin/zsh

ログアウト&再度ログインしたらデフォルトシェルがzshになってるはず
powerlineはoh-my-zsh:agnosterで必要

oh-my-zshをインストール

  • githubからソースコードをclone
  • zsh confファイルのコピー
  • テーマを変更(ZSH_THEME="robbyrussell"ZSH_THEME="agnoster"に変更)
  • PC名が長いので非表示(prompt_context () { }を.zshrcの末尾に追記)
git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
gedit .zshrc

[依存解決]VSCodeのターミナル文字化けを直す

Screenshot from 2019-06-26 20-36-05.png

Ctrl+,で設定を開き,機能>ターミナル>Integrated: Font Familyにubuntu mono,PowerlineSymbolsを記述
Screenshot from 2019-06-26 20-50-25.png
ターミナルを再起動して解決
Screenshot from 2019-06-26 21-40-27.png

参考サイト

https://dev.to/mskian/install-z-shell-oh-my-zsh-on-ubuntu-1804-lts-4cm4
https://stackoverflow.com/questions/28491458/zsh-agnoster-theme-showing-machine-name

15
22
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
15
22