0
0

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 1 year has passed since last update.

Powerlevel10kで仮想環境にいるかどうか分かりやすくする

Posted at

仮想環境内にいるということを明示する

Pythonで開発を行う際,仮想環境を用いることが多々あると思います.時々,仮想環境内にいるのかいないのかわからなくなることがあったので,Powerlevel10k上に仮想環境にいるのかいないのかを表示する方法を書き残したいと思います.

表示例

設定前

Screenshot 2023-06-28 at 0.17.01.png

設定後

Screenshot 2023-06-28 at 0.17.25.png

違い

右側に表示されているPythonのバージョンの左側に仮想環境名が表示されるようになります.

設定方法

ホームディレクトリ(~/)にある.p10k.zshを以下のように編集します.

これを...

.p10k.zsh
# If set to "false", won't show virtualenv if pyenv is already shown.
# If set to "if-different", won't show virtualenv if it's the same as pyenv.
typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV=false

こう.

.p10k.zsh
# If set to "false", won't show virtualenv if pyenv is already shown.
# If set to "if-different", won't show virtualenv if it's the same as pyenv.
typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV=if-different

問題点

ディレクトリ名 + ランダムな9文字が表示されるため,幅が足りなくなると非表示になってしまいます.

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?