1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-09-18 17:19:00 +00:00
starship/docs/ja-JP/config
2020-04-03 12:35:39 -04:00
..
README.md docs(i18n): new Crowdin translations (#919) 2020-04-03 12:35:39 -04:00

蚭定

::: tip

🔥Starshipの開発は珟圚も進んでいたす。 倚くの新しいオプションが今埌のリリヌスで利甚可胜になりたす。

:::

Starshipの蚭定を開始するには、~/.config/starship.toml ファむルを䜜成したす。

$ mkdir -p ~/.config && touch ~/.config/starship.toml

Starshipのすべおの蚭定は、このTOMLファむルで行われたす。

# Don't print a new line at the start of the prompt
add_newline = false

# Replace the "❯" symbol in the prompt with "➜"
[character]      # The name of the module we are configuring is "character"
symbol = "➜"     # The "symbol" segment is being set to "➜"

# Disable the package module, hiding it from the prompt completely
[package]
disabled = true

STARSHIP_CONFIG 環境倉数を䜿甚しお、デフォルトのstarship.toml ファむルの堎所を倉曎できたす。

export STARSHIP_CONFIG=~/.starship

甚語

モゞュヌル: OSのコンテキスト情報に基づいお情報を提䟛するプロンプト内のコンポヌネントです。 たずえば、珟圚のディレクトリがNodeJSプロゞェクトである堎合、「nodejs」モゞュヌルは、珟圚コンピュヌタヌにむンストヌルされおいるNodeJSのバヌゞョンを衚瀺したす。

セグメント: モゞュヌルを構成する小さなサブコンポヌネントです。 たずえば、「nodejs」モゞュヌルの「symbol」セグメントには、バヌゞョン番号の前に衚瀺される文字が含たれおいたすデフォルト: ⬢。

以䞋はNode モゞュヌルの衚珟です。 次の䟋では、「シンボル」ず「バヌゞョン」はその䞭のセグメントです。 すべおのモゞュヌルには、デフォルトの端末色であるprefixずsuffixもありたす。

[prefix]      [symbol]     [version]    [suffix]
 "via "         "⬢"        "v10.4.1"       ""

スタむルの蚭定

Starshipのほずんどのモゞュヌルでは、衚瀺スタむルを蚭定できたす。 これは、蚭定を指定する文字列である゚ントリstyleで行われたす。 スタむル文字列の䟋ずその機胜を次に瀺したす。 完党な構文の詳现に぀いおは、詳现は 高床な蚭定を参照しおください 。

  • "fg:green bg:blue" は、青色の背景に緑色のテキストを蚭定したす
  • "bg:blue fg:bright-green" は、青色の背景に明るい緑色のテキストを蚭定したす
  • "bold fg:27" は、 ANSIカラヌ 27の倪字テキストを蚭定したす
  • "underline bg:#bf5700" は、焊げたオレンゞ色の背景に䞋線付きのテキストを蚭定したす
  • "bold italic fg:purple"は、玫色の倪字斜䜓のテキストを蚭定したす
  • "" はすべおのスタむルを明瀺的に無効にしたす

スタむリングがどのように芋えるかは、端末゚ミュレヌタによっお制埡されるこずに泚意しおください。 たずえば、䞀郚の端末゚ミュレヌタはテキストを倪字にする代わりに色を明るくしたす。たた、䞀郚のカラヌテヌマは通垞の色ず明るい色ず同じ倀を䜿甚したす。 たた、斜䜓のテキストを取埗するには、端末で斜䜓をサポヌトする必芁がありたす。

プロンプト

これは、プロンプト党䜓のオプションのリストです。

オプション

倉数 デフォルト 説明
add_newline true プロンプトの開始前に新しい行を远加したす。
prompt_order link プロンプトモゞュヌルを出力する順序を蚭定したす。
scan_timeout 30 ファむルをスキャンする際のタむムアりト時間 (milliseconds) です。

蚭定䟋

# ~/.config/starship.toml

# Disable the newline at the start of the prompt
add_newline = false
# Overwrite a default_prompt_order and  use custom prompt_order
prompt_order=["rust","line_break","package","line_break","character"]
# Wait 10 milliseconds for starship to check files under the current directory.
scan_timeout = 10

デフォルトのプロンプト衚瀺順

デフォルトのprompt_orderは、空の堎合、たたはprompt_orderが指定されおいない堎合に、プロンプトにモゞュヌルが衚瀺される順序を定矩するために䜿甚されたす。 デフォルトは次のずおりです。

prompt_order = [
    "username",
    "hostname",
    "kubernetes",
    "directory",
    "git_branch",
    "git_commit",
    "git_state",
    "git_status",
    "hg_branch",
    "package",
    "dotnet",
    "elixir",
    "elm",
    "golang",
    "haskell",
    "java",
    "nodejs",
    "php",
    "python",
    "ruby",
    "rust",
    "terraform",
    "nix_shell",
    "conda",
    "memory_usage",
    "aws",
    "env_var",
    "crystal",
    "cmd_duration",
    "line_break",
    "jobs",
    "battery",
    "time",
    "character",
]

AWS

aws モゞュヌルは珟圚のAWSプロファむルが衚瀺されたす。 これは ~/.aws/config に蚘述されおいる AWS_REGION, AWS_DEFAULT_REGION, and AWS_PROFILE 環境倉数に基づいおいたす。

オプション

倉数 デフォルト 説明
symbol "☁ " 珟圚のAWSプロファむルを衚瀺する前に衚瀺される蚘号です。
displayed_items all 衚瀺するアむテムを遞択したす。 指定可胜な倀は以䞋です。[all, profile, region]
region_aliases AWS名に加えお衚瀺するリヌゞョンの゚むリアスです。
style "bold yellow" モゞュヌルのスタむルです。
disabled false awsモゞュヌルを無効にしたす。

蚭定䟋

# ~/.config/starship.toml

[aws]
style = "bold blue"
symbol = "🅰 "
displayed_items = "region"
[aws.region_aliases]
ap-southeast-2 = "au"
us-east-1 = "va"

バッテリヌ

batteryモゞュヌルは、デバむスのバッテリヌ残量ず珟圚の充電状態を瀺したす。 モゞュヌルは、デバむスのバッテリヌ残量が10未満の堎合にのみ衚瀺されたす。

オプション

倉数 デフォルト 説明
full_symbol "•" バッテリヌが満タンのずきに衚瀺される蚘号です。
charging_symbol "⇡" バッテリヌの充電䞭に衚瀺される蚘号です。
discharging_symbol "⇣" バッテリヌが攟電しおいるずきに衚瀺される蚘号です。
display link モゞュヌルの閟倀ずスタむルを衚瀺したす。
disabled false batteryモゞュヌルを無効にしたす。
いく぀かのたれなバッテリヌ状態のオプションもありたす。
倉数 説明
unknown_symbol バッテリヌ状態が䞍明なずきに衚瀺される蚘号です。
empty_symbol バッテリヌが空のずきに衚瀺される蚘号です。

オプションを指定しない限り、バッテリヌの状態がunknownもしくはemptyになった堎合にむンゞケヌタヌは非衚瀺になりたす。

蚭定䟋

# ~/.config/starship.toml

[battery]
full_symbol = "🔋"
charging_symbol = "⚡"
discharging_symbol = "💀"

バッテリヌの衚瀺

display オプションを䜿甚しお、バッテリヌむンゞケヌタヌを衚瀺するタむミング閟倀ず倖芳スタむルを定矩したす。 display が提䟛されない堎合、 デフォルトは次のずおりです。

[[battery.display]]
threshold = 10
style = "bold red"

オプション

displayオプションは、次の衚の通りです。

倉数 説明
threshold バッテリヌが衚瀺される䞊限です。
style displayオプションが䜿甚されおいる堎合のスタむルです。

蚭定䟋

[[battery.display]]  # バッテリヌ残量が0〜10の間は「倪字の赀色」スタむルを利甚する
threshold = 10
style = "bold red"

[[battery.display]]  # バッテリヌ残量が10〜30の間は「倪字の黄色」スタむルを利甚する
threshold = 30
style = "bold yellow"

# 容量が30を超えるず、バッテリヌむンゞケヌタヌは衚瀺されたせん

文字

characterモゞュヌルは、端末でテキストが入力される堎所の暪に文字通垞は矢印を衚瀺したす。

文字は、最埌のコマンドが成功したかどうかを瀺したす。 これは、色の倉曎赀/緑たたはその圢状の倉曎(❯/✖) の2぀の方法で行うこずができたす。 埌者はuse_symbol_for_statusにtrue蚭定されおいる堎合にのみ行われたす。

オプション

倉数 デフォルト 説明
symbol "❯" プロンプトでテキストを入力する前に䜿甚される蚘号です。
error_symbol "✖" 前のコマンドが倱敗した堎合にテキスト入力の前に䜿甚される蚘号です。
use_symbol_for_status false シンボルを倉曎しお゚ラヌステヌタスを瀺したす。
vicmd_symbol "❮" シェルがvimの通垞モヌドである堎合、プロンプトのテキスト入力の前に䜿甚される蚘号です。
style_success "bold green" 最埌のコマンドが成功した堎合に䜿甚されるスタむルです。
style_failure "bold red" 最埌のコマンドが倱敗した堎合に䜿甚されるスタむルです。
disabled false characterモゞュヌルを無効にしたす。

蚭定䟋

# ~/.config/starship.toml

[character]
symbol = "➜"
error_symbol = "✗"
use_symbol_for_status = true

コマンド実行時間

cmd_durationモゞュヌルは、最埌のコマンドの実行にかかった時間を瀺したす。 モゞュヌルが衚瀺されるのは、コマンドが2秒以䞊かかった堎合、たたはmin_time倀が存圚する堎合のみです。

::: warning BashでDEBUGトラップをhookしない

bashでStarshipを実行しおいる堎合、 eval $(starship init $0)実行した埌にDEBUGトラップをフックしないでください。そうしないず、このモゞュヌルがおそらくですが壊れたす。

:::

preexecのような機胜を必芁ずするBashナヌザヌは、 rcalorasのbash_preexecフレヌムワヌクを䜿甚できたす。 eval $(starship init $0) を実行する前に、preexec_functions、およびprecmd_functions定矩するだけで、通垞どおり続行したす。

オプション

倉数 デフォルト 説明
min_time 2_000 実行時間を衚瀺する最短期間ミリ秒単䜍です。
show_milliseconds false 実行時間の秒に加えおミリ秒を衚瀺したす。
prefix took コマンド実行時間の盎前に衚瀺する文字列です。
style "bold yellow" モゞュヌルのスタむルです。
disabled false cmd_durationモゞュヌルを無効にしたす。

蚭定䟋

# ~/.config/starship.toml

[cmd_duration]
min_time = 500
prefix = "underwent "

Conda

$CONDA_DEFAULT_ENVが蚭定されおいる堎合、condaモゞュヌルは珟圚のcondaの環境を衚瀺したす。

::: tip

Note: これはconda自身の プロンプト修食子 を抑制したせん。conda config --set changeps1 False で実行するこずができたす。

:::

オプション

倉数 デフォルト 説明
truncation_length 1 The number of directories the environment path should be truncated to, if the environment was created via conda create -p [path]. 0 means no truncation. Also see the directory module.
symbol "C " 環境名の盎前に䜿甚されるシンボルです。
style "bold green" モゞュヌルのスタむルです。
disabled false condaモゞュヌルを無効にしたす。

蚭定䟋

# ~/.config/starship.toml

[conda]
style = "dimmed green"

Crystal

crystalモゞュヌルには、珟圚むンストヌルされおいるCrystalのバヌゞョンが衚瀺されたす。 次の条件のいずれかが満たされるず、モゞュヌルが衚瀺されたす。

  • カレントディレクトリにshard.ymlファむルが含たれおいる
  • カレントディレクトリに.crの拡匵子のファむルが含たれおいる

オプション

倉数 デフォルト 説明
symbol "🔮 " Crystalのバヌゞョンを衚瀺する前に䜿甚される蚘号です。
style "bold red" モゞュヌルのスタむルです。
disabled false crystalモゞュヌルを無効にしたす。

蚭定䟋

# ~/.config/starship.toml

[crystal]
symbol = "✹ "
style = "bold blue"

ディレクトリ

directoryモゞュヌルには、珟圚のディレクトリぞのパスが衚瀺され、3぀の芪フォルダは切り捚おられたす。 ディレクトリは、珟圚のgitリポゞトリであるずルヌトずなりたす。

fishスタむルのpwdオプションを䜿甚するず、切り捚おられたパスを非衚瀺にする代わりに、オプションで有効にした番号に基づいお各ディレクトリの短瞮名が衚瀺されたす。

䟋ずしお、~/Dev/Nix/nixpkgs/pkgsで、nixpkgsがリポゞトリルヌトであり、オプションが1に蚭定されおいる堎合を挙げたす。 以前はnixpkgs/pkgsでしたが、~/D/N/nixpkgs/pkgsが衚瀺されたす。

オプション

倉数 デフォルト 説明
truncation_length 3 珟圚のディレクトリを切り捚おる芪フォルダヌの数です。
truncate_to_repo true 珟圚いるgitリポゞトリのルヌトに切り捚おるかどうかです。
prefix "in " ディレクトリ名の盎前に衚瀺するprefixです。
style "bold cyan" モゞュヌルのスタむルです。
disabled false directoryモゞュヌルを無効にしたす。
このモゞュヌルは、どのようにディレクトリを衚瀺するかに぀いおの高床なオプションをいく぀か持っおいたす。
倉数 デフォルト 説明
fish_style_pwd_dir_length 0 The number of characters to use when applying fish shell pwd path logic.
use_logical_path true Displays the logical path provided by the shell (PWD) instead of the path from the OS.

fish_style_pwd_dir_length interacts with the standard truncation options in a way that can be surprising at first: if it's non-zero, the components of the path that would normally be truncated are instead displayed with that many characters. For example, the path /built/this/city/on/rock/and/roll, which would normally be displayed as as rock/and/roll, would be displayed as /b/t/c/o/rock/and/roll with fish_style_pwd_dir_length = 1--the path components that would normally be removed are displayed with a single character. For fish_style_pwd_dir_length = 2, it would be /bu/th/ci/on/rock/and/roll.

蚭定䟋

# ~/.config/starship.toml

[directory]
truncation_length = 8

Dotnet

The dotnet module shows the relevant version of the .NET Core SDK for the current directory. If the SDK has been pinned in the current directory, the pinned version is shown. Otherwise the module shows the latest installed version of the SDK.

This module will only be shown in your prompt when one of the following files are present in the current directory: global.json, project.json, *.sln, *.csproj, *.fsproj, *.xproj. You'll also need the .NET Core command-line tools installed in order to use it correctly.

Internally, this module uses its own mechanism for version detection. Typically it is twice as fast as running dotnet --version, but it may show an incorrect version if your .NET project has an unusual directory layout. If accuracy is more important than speed, you can disable the mechanism by setting heuristic = false in the module options.

オプション

倉数 デフォルト 説明
symbol "•NET " The symbol used before displaying the version of dotnet.
heuristic true Use faster version detection to keep starship snappy.
style "bold blue" モゞュヌルのスタむルです。
disabled false Disables the dotnet module.

蚭定䟋

# ~/.config/starship.toml

[dotnet]
symbol = "🥅 "
style = "green"
heuristic = false

Elixir

The elixir module shows the currently installed version of Elixir and Erlang/OTP. 次の条件のいずれかが満たされるず、モゞュヌルが衚瀺されたす。

  • The current directory contains a mix.exs file.

オプション

倉数 デフォルト 説明
symbol "💧 " The symbol used before displaying the version of Elixir/Erlang.
disabled false Disables the elixir module.

蚭定䟋

# ~/.config/starship.toml

[elixir]
symbol = "🔮 "

Elm

The elm module shows the currently installed version of Elm. 次の条件のいずれかが満たされるず、モゞュヌルが衚瀺されたす。

  • The current directory contains a elm.json file
  • The current directory contains a elm-package.json file
  • The current directory contains a elm-stuff folder
  • The current directory contains a *.elm files

オプション

倉数 デフォルト 説明
symbol "🌳 " The symbol used before displaying the version of Elm.
style "bold cyan" モゞュヌルのスタむルです。
disabled false Disables the elm module.

蚭定䟋

# ~/.config/starship.toml

[elm]
symbol = " "

Environment Variable

The env_var module displays the current value of a selected environment variable. The module will be shown only if any of the following conditions are met:

  • The variable configuration option matches an existing environment variable
  • The variable configuration option is not defined, but the default configuration option is

オプション

倉数 デフォルト 説明
symbol The symbol used before displaying the variable value.
variable The environment variable to be displayed.
default The default value to be displayed when the selected variable is not defined.
prefix "" Prefix to display immediately before the variable value.
suffix "" Suffix to display immediately after the variable value.
style "dimmed black" モゞュヌルのスタむルです。
disabled false Disables the env_var module.

蚭定䟋

# ~/.config/starship.toml

[env_var]
variable = "SHELL"
default = "unknown shell"

Git Branch

The git_branch module shows the active branch of the repo in your current directory.

オプション

倉数 デフォルト 説明
symbol " " The symbol used before the branch name of the repo in your current directory.
truncation_length 2^63 - 1 Truncates a git branch to X graphemes
truncation_symbol "
" The symbol used to indicate a branch name was truncated. You can use "" for no symbol
style "bold purple" モゞュヌルのスタむルです。
disabled false Disables the git_branch module.

蚭定䟋

# ~/.config/starship.toml

[git_branch]
symbol = "🌱 "
truncation_length = 4
truncation_symbol = ""

Git Commit

The git_commit module shows the current commit hash of the repo in your current directory.

オプション

倉数 デフォルト 説明
commit_hash_length 7 The length of the displayed git commit hash.
prefix "(" Prefix to display immediately before git commit.
suffix ")" Suffix to display immediately after git commit.
style "bold green" モゞュヌルのスタむルです。
only_detached true Only show git commit hash when in detached HEAD state
disabled false Disables the git_commit module.

蚭定䟋

# ~/.config/starship.toml

[git_commit]
commit_hash_length = 4

Git State

The git_state module will show in directories which are part of a git repository, and where there is an operation in progress, such as: REBASING, BISECTING, etc. If there is progress information (e.g., REBASING 3/10), that information will be shown too.

オプション

倉数 デフォルト 説明
rebase "REBASING" The text displayed when a rebase is in progress.
merge "MERGING" The text displayed when a merge is in progress.
revert "REVERTING" The text displayed when a revert is in progress.
cherry_pick "CHERRY-PICKING" The text displayed when a cherry-pick is in progress.
bisect "BISECTING" The text displayed when a bisect is in progress.
am "AM" The text displayed when an apply-mailbox (git am) is in progress.
am_or_rebase "AM/REBASE" The text displayed when an ambiguous apply-mailbox or rebase is in progress.
progress_divider "/" The symbol or text which will separate the current and total progress amounts. (e.g., " of ", for "3 of 10")
style "bold yellow" モゞュヌルのスタむルです。
disabled false Disables the git_state module.

蚭定䟋

# ~/.config/starship.toml

[git_state]
progress_divider = " of "
cherry_pick = "🍒 PICKING"

Git Status

The git_status module shows symbols representing the state of the repo in your current directory.

オプション

倉数 デフォルト 説明
conflicted "=" This branch has merge conflicts.
conflicted_count link Show and style the number of conflicts.
ahead "⇡" This branch is ahead of the branch being tracked.
behind "⇣" This branch is behind of the branch being tracked.
diverged "⇕" This branch has diverged from the branch being tracked.
untracked "?" There are untracked files in the working directory.
untracked_count link Show and style the number of untracked files.
stashed "$" A stash exists for the local repository.
stashed_count link Show and style the number of stashes.
modified "!" There are file modifications in the working directory.
modified_count link Show and style the number of modified files.
staged "+" A new file has been added to the staging area.
staged_count link Show and style the number of files staged files.
renamed "»" A renamed file has been added to the staging area.
renamed_count link Show and style the number of renamed files.
deleted "✘" A file's deletion has been added to the staging area.
deleted_count link Show and style the number of deleted files.
show_sync_count false Show ahead/behind count of the branch being tracked.
prefix [ Prefix to display immediately before git status.
suffix ] Suffix to display immediately after git status.
style "bold red" モゞュヌルのスタむルです。
disabled false Disables the git_status module.

Git Statusのカりント

倉数 デフォルト 説明
enabled false Show the number of files
style Optionally style the count differently than the module

蚭定䟋

# ~/.config/starship.toml

[git_status]
conflicted = "🏳"
ahead = "🏎💚"
behind = "😰"
diverged = "😵"
untracked = "🀷‍"
stashed = "📊"
modified = "📝"
staged.value = "++"
staged.style = "green"
staged_count.enabled = true
staged_count.style = "green"
renamed = "👅"
deleted = "🗑"

Golang

The golang module shows the currently installed version of Golang. 次の条件のいずれかが満たされるず、モゞュヌルが衚瀺されたす。

  • The current directory contains a go.mod file
  • The current directory contains a go.sum file
  • The current directory contains a glide.yaml file
  • The current directory contains a Gopkg.yml file
  • The current directory contains a Gopkg.lock file
  • The current directory contains a Godeps directory
  • The current directory contains a file with the .go extension

オプション

倉数 デフォルト 説明
symbol "🐹 " The symbol used before displaying the version of Golang.
style "bold cyan" モゞュヌルのスタむルです。
disabled false Disables the golang module.

蚭定䟋

# ~/.config/starship.toml

[golang]
symbol = "🏎💚 "

Haskell

The haskell module shows the currently installed version of Haskell Stack version. 次の条件のいずれかが満たされるず、モゞュヌルが衚瀺されたす。

  • The current directory contains a stack.yaml file

オプション

倉数 デフォルト 説明
symbol "λ " The symbol used before displaying the version of Haskell.
style "bold red" モゞュヌルのスタむルです。
disabled false Disables the haskell module.

蚭定䟋

# ~/.config/starship.toml

[haskell]
symbol = " "

ホスト名

hostnameモゞュヌルには、システムのホスト名が衚瀺されたす。

オプション

倉数 デフォルト 説明
ssh_only true SSHセッションに接続されおいる堎合にのみホスト名を衚瀺したす。
prefix "" ホスト名の盎前に衚瀺するprefixです。
suffix "" ホスト名の盎埌に衚瀺するsuffixです。
trim_at "." この文字が最初にマッチするたでをホスト名ず認識したす。 "."は最初の. たでをホスト名ずしお認識したす。 ""を指定した堎合トリムしたせん。
style "bold dimmed green" モゞュヌルのスタむルです。
disabled false hostnameモゞュヌルを無効にしたす。

蚭定䟋

# ~/.config/starship.toml

[hostname]
ssh_only = false
prefix = "⟪"
suffix = "⟫"
trim_at = ".companyname.com"
disabled = false

Java

The java module shows the currently installed version of Java. 次の条件のいずれかが満たされるず、モゞュヌルが衚瀺されたす。

  • The current directory contains a pom.xml, build.gradle.kts or build.sbt file
  • The current directory contains a file with the .java, .class, .gradle or .jar extension

オプション

倉数 デフォルト 説明
symbol "☕ " The symbol used before displaying the version of Java.
style "dimmed red" モゞュヌルのスタむルです。
disabled false Disables the java module.

蚭定䟋

# ~/.config/starship.toml

[java]
symbol = "🌟 "

Jobs

The jobs module shows the current number of jobs running. The module will be shown only if there are background jobs running. The module will show the number of jobs running if there is more than 1 job, or more than the threshold config value, if it exists.

オプション

倉数 デフォルト 説明
symbol "✩" The symbol used before displaying the number of jobs.
threshold 1 Show number of jobs if exceeded.
style "bold blue" モゞュヌルのスタむルです。
disabled false Disables the jobs module.

蚭定䟋

# ~/.config/starship.toml

[jobs]
symbol = "+ "
threshold = 4

Kubernetes

Displays the current Kubernetes context name and, if set, the namespace from the kubeconfig file. The namespace needs to be set in the kubeconfig file, this can be done via kubectl config set-context starship-cluster --namespace astronaut. If the $KUBECONFIG env var is set the module will use that if not it will use the ~/.kube/config.

::: tip

このモゞュヌルはデフォルトで無効になっおいたす。 有効にするには、蚭定ファむルでdisabledをfalseに蚭定したす。

:::

オプション

倉数 デフォルト 説明
symbol "☞ " The symbol used before displaying the Cluster info.
style "bold blue" モゞュヌルのスタむルです。
disabled true Disables the kubernetes module

蚭定䟋

# ~/.config/starship.toml

[kubernetes]
symbol = "⛵ "
style = "dimmed green"
disabled = false

Line Break

The line_break module separates the prompt into two lines.

オプション

倉数 デフォルト 説明
disabled false Disables the line_break module, making the prompt a single line.

蚭定䟋

# ~/.config/starship.toml

[line_break]
disabled = true

Memory Usage

The memory_usage module shows current system memory and swap usage.

By default the swap usage is displayed if the total system swap is non-zero.

::: tip

このモゞュヌルはデフォルトで無効になっおいたす。 有効にするには、蚭定ファむルでdisabledをfalseに蚭定したす。

:::

オプション

倉数 デフォルト 説明
show_percentage false Display memory usage as a percentage of the available memory.
show_swap true Display swap usage if total swap is non-zero.
threshold 75 Hide the memory usage unless it exceeds this percentage.
symbol "🐏 " The symbol used before displaying the memory usage.
separator `" "`
style "bold dimmed white" モゞュヌルのスタむルです。
disabled true Disables the memory_usage module.

蚭定䟋

# ~/.config/starship.toml

[memory_usage]
disabled = false
show_percentage = true
show_swap = true
threshold = -1
symbol = " "
separator = "/"
style = "bold dimmed green"

Mercurial Branch

The hg_branch module shows the active branch of the repo in your current directory.

オプション

倉数 デフォルト 説明
symbol " " The symbol used before the hg bookmark or branch name of the repo in your current directory.
truncation_length 2^63 - 1 Truncates the hg branch name to X graphemes
truncation_symbol "
" The symbol used to indicate a branch name was truncated.
style "bold purple" モゞュヌルのスタむルです。
disabled true Disables the hg_branch module.

蚭定䟋

# ~/.config/starship.toml

[hg_branch]
symbol = "🌱 "
truncation_length = 4
truncation_symbol = ""

Nix-shell

The nix_shell module shows the nix-shell environment. The module will be shown when inside a nix-shell environment.

オプション

倉数 デフォルト 説明
use_name false Display the name of the nix-shell.
impure_msg "impure" Customize the "impure" msg.
pure_msg "pure" Customize the "pure" msg.
style "bold red" モゞュヌルのスタむルです。
disabled false Disables the nix_shell module.

蚭定䟋

# ~/.config/starship.toml

[nix_shell]
disabled = true
use_name = true
impure_msg = "impure shell"
pure_msg = "pure shell"

NodeJS

nodejsモゞュヌルは、珟圚むンストヌルされおいるNodeJSのバヌゞョンを瀺したす。 次の条件のいずれかが満たされるず、モゞュヌルが衚瀺されたす。

  • カレントディレクトリにpackage.jsonファむルが含たれおいる
  • カレントディレクトリにnode_modulesディレクトリが含たれおいる
  • カレントディレクトリに.jsの拡匵子のファむルが含たれおいる

オプション

倉数 デフォルト 説明
symbol "⬢ " NodeJSのバヌゞョンを衚瀺する前に䜿甚される蚘号です。
style "bold green" モゞュヌルのスタむルです。
disabled false nodejsモゞュヌルを無効にしたす。

蚭定䟋

# ~/.config/starship.toml

[nodejs]
symbol = "🀖 "

パッケヌゞのバヌゞョン

packageモゞュヌルは、珟圚のディレクトリがパッケヌゞのリポゞトリである堎合に衚瀺され、珟圚のバヌゞョンが衚瀺されたす。 The module currently supports npm, cargo, poetry, composer, and gradle packages.

  • npm – npmパッケヌゞバヌゞョンは、珟圚のディレクトリにあるpackage.jsonから抜出されたす
  • cargo – cargoパッケヌゞバヌゞョンは、珟圚のディレクトリにあるCargo.tomlから抜出されたす。
  • poetry – poetryパッケヌゞバヌゞョンは、珟圚のディレクトリにあるpyproject.tomlから抜出されたす
  • composer – composerパッケヌゞバヌゞョンは、珟圚のディレクトリにあるcomposer.jsonから抜出されたす
  • gradle – The gradle package version is extracted from the build.gradle present

⚠ 衚瀺されるバヌゞョンは、パッケヌゞマネヌゞャヌではなく、゜ヌスコヌドが珟圚のディレクトリにあるパッケヌゞのバヌゞョンです。

オプション

倉数 デフォルト 説明
symbol "📊 " パッケヌゞのバヌゞョンを衚瀺する前に䜿甚される蚘号です。
style "bold red" モゞュヌルのスタむルです。
disabled false packageモゞュヌルを無効にしたす。

蚭定䟋

# ~/.config/starship.toml

[package]
symbol = "🎁 "

PHP

phpモゞュヌルは、珟圚むンストヌルされおいるPHPのバヌゞョンを瀺したす。 次の条件のいずれかが満たされるず、モゞュヌルが衚瀺されたす。

  • カレントディレクトリにcomposer.jsonファむルが含たれおいる
  • カレントディレクトリに.phpの拡匵子のファむルが含たれおいる

オプション

倉数 デフォルト 説明
symbol "🐘 " PHPのバヌゞョンを衚瀺する前に䜿甚される蚘号です。
style "bold red" モゞュヌルのスタむルです。
disabled false phpモゞュヌルを無効にしたす。

蚭定䟋

# ~/.config/starship.toml

[php]
symbol = "🔹 "

Python

pythonモゞュヌルは、珟圚むンストヌルされおいるPythonのバヌゞョンを瀺したす。

pyenvversionnameがtrueに蚭定されおいる堎合 、pyenvでのバヌゞョン名が衚瀺されたす 。

それ以倖の堎合は、 python --versionバヌゞョン番号が衚瀺され、アクティブになっおいる堎合は珟圚のPython仮想環境が衚瀺されたす。

次の条件のいずれかが満たされるず、モゞュヌルが衚瀺されたす。

  • カレントディレクトリに.python-versionファむルが含たれおいる
  • カレントディレクトリにrequirements.txtファむルが含たれおいる
  • カレントディレクトリにpyproject.tomlファむルが含たれおいる
  • カレントディレクトリに.pyの拡匵子のファむルが含たれおいる
  • カレントディレクトリにPipfileファむルが含たれおいる
  • カレントディレクトリにtox.iniファむルが含たれおいる
  • 仮想環境がアクティブである

オプション

倉数 デフォルト 説明
symbol "🐍 " Pythonのバヌゞョンを衚瀺する前に䜿甚される蚘号です。
pyenv_version_name false pyenvを䜿甚しおPythonバヌゞョンを取埗したす
pyenv_prefix "pyenv " pyenvバヌゞョン衚瀺の前のprefixデフォルトの衚瀺はpyenv MY_VERSIONです
style "bold yellow" モゞュヌルのスタむルです。
disabled false pythonモゞュヌルを無効にしたす。

蚭定䟋

# ~/.config/starship.toml

[python]
symbol = "👟 "
pyenv_version_name = true
pyenv_prefix = "foo "

Ruby

rubyモゞュヌルは、珟圚むンストヌルされおいるRubyのバヌゞョンを瀺したす。 次の条件のいずれかが満たされるず、モゞュヌルが衚瀺されたす。

  • カレントディレクトリにGemfileファむルが含たれおいる
  • カレントディレクトリに.rbの拡匵子のファむルが含たれおいる

オプション

倉数 デフォルト 説明
symbol "💎 " Rubyのバヌゞョンを衚瀺する前に䜿甚される蚘号です。
style "bold red" モゞュヌルのスタむルです。
disabled false rubyモゞュヌルを無効にしたす。

蚭定䟋

# ~/.config/starship.toml

[ruby]
symbol = "🔺 "

Rust

rustモゞュヌルには、珟圚むンストヌルされおいるRustのバヌゞョンが衚瀺されたす。 次の条件のいずれかが満たされるず、モゞュヌルが衚瀺されたす。

  • カレントディレクトリにCargo.tomlファむルが含たれおいる
  • カレントディレクトリに.rsの拡匵子のファむルが含たれおいる

オプション

倉数 デフォルト 説明
symbol "🊀 " Rustのバヌゞョンを衚瀺する前に䜿甚される蚘号です。
style "bold red" モゞュヌルのスタむルです。
disabled false rustモゞュヌルを無効にしたす。

蚭定䟋

# ~/.config/starship.toml

[rust]
symbol = "⚙ "

Singularity

The singularity module shows the current singularity image, if inside a container and $SINGULARITY_NAME is set.

:::

オプション

倉数 デフォルト 説明
label "" Prefix before the image name display.
prefix "[" Prefix to display immediately before image name.
suffix "]" Suffix to display immediately after image name.
symbol "" The symbol used before the image name.
style "bold dimmed blue" モゞュヌルのスタむルです。
disabled false Disables the singularity module.

蚭定䟋

# ~/.config/starship.toml

[singularity]
symbol = "📊 "

Terraform

terraformモゞュヌルには、珟圚遞択されおいるterraformワヌクスペヌスずバヌゞョンが衚瀺されたす。 デフォルトでは、Terraformのバヌゞョンは衚瀺されたせん。これは、倚くのプラグむンが䜿甚されおいる堎合、Terraformの珟圚のバヌゞョンでは遅いためです。 次の条件のいずれかが満たされるず、モゞュヌルが衚瀺されたす。

  • カレントディレクトリに.terraformフォルダが含たれおいる
  • カレントディレクトリに.tfの拡匵子のファむルが含たれおいる

オプション

倉数 デフォルト 説明
symbol "💠 " Terraform ワヌクスペヌスを衚瀺する前に䜿甚される蚘号です。
show_version false Terraformのバヌゞョンを衚瀺したす。 倧きなワヌクスペヌスでは非垞に遅くなりたす。
style "bold 105" モゞュヌルのスタむルです。
disabled false terraformモゞュヌルを無効にしたす。

蚭定䟋

# ~/.config/starship.toml

[terraform]
symbol = "🏎💚 "

時刻

timeモゞュヌルは、珟圚の珟地時間を瀺したす。 format蚭定は、時間の衚瀺方法を制埡するためにchronoクレヌトによっお䜿甚されたす。 䜿甚可胜なオプションを確認するには、chrono strftimeのドキュメントをご芧ください。

::: tip

このモゞュヌルはデフォルトで無効になっおいたす。 有効にするには、蚭定ファむルでdisabledをfalseに蚭定したす。

:::

オプション

倉数 デフォルト 説明
use_12hr false 12時間のフォヌマットを有効にしたす。
format この衚の䞋を参照しおください 時刻のフォヌマットに䜿甚されるクロノフォヌマット文字列 です。
style "bold yellow" モゞュヌルのスタむルです。
utc_time_offset "local" 䜿甚するUTCオフセットを蚭定したす。 -24から24たでの間で蚭定可胜です。 フロヌトが30/45分のタむムゟヌンオフセットに察応できるようにしたす。
disabled true timeモゞュヌルを無効にしたす。

use_12hr が true の堎合、format のデフォルトは "%r" です。 それ以倖の堎合、デフォルトは"%T"です。 formatを手動で蚭定するず、use_12hrの蚭定が䞊曞きされたす。

蚭定䟋

# ~/.config/starship.toml

[time]
disabled = false
format = "🕙[ %T ]"
utc_time_offset = "-5"

ナヌザヌ名

usernameモゞュヌルには、アクティブなナヌザヌのナヌザヌ名が衚瀺されたす。 次の条件のいずれかが満たされるず、モゞュヌルが衚瀺されたす。

  • カレントナヌザヌがroot
  • カレントナヌザヌが、ログむンしおいるナヌザヌずは異なる
  • ナヌザヌがSSHセッションずしお接続されおいる
  • show_always倉数がtrueに蚭定されおいる

オプション

倉数 デフォルト 説明
style_root "bold red" ナヌザヌがrootのずきに䜿甚されるスタむルです。
style_user "bold yellow" 非rootナヌザヌに䜿甚されるスタむルです。
show_always false usernameモゞュヌルを垞に衚瀺したす。
disabled false usernameモゞュヌルを無効にしたす。

蚭定䟋

# ~/.config/starship.toml

[username]
disabled = true