mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-11-12 08:10:07 +00:00
Added a segment that shows the current GO version number.
This commit is contained in:
parent
6cec4ce400
commit
1a5edebae7
2 changed files with 11 additions and 0 deletions
|
@ -235,6 +235,7 @@ currently available are:
|
||||||
* **context** - Your username and host (more info below)
|
* **context** - Your username and host (more info below)
|
||||||
* **vi_mode** - Vi editing mode (NORMAL|INSERT).
|
* **vi_mode** - Vi editing mode (NORMAL|INSERT).
|
||||||
* **dir** - Your current working directory.
|
* **dir** - Your current working directory.
|
||||||
|
* **go_version** - Show the current GO version.
|
||||||
* **history** - The command number for the current line.
|
* **history** - The command number for the current line.
|
||||||
* **ip** - Shows the current IP address.
|
* **ip** - Shows the current IP address.
|
||||||
* **load** - Your machines 5 minute load average and free RAM.
|
* **load** - Your machines 5 minute load average and free RAM.
|
||||||
|
|
|
@ -608,6 +608,16 @@ prompt_dir() {
|
||||||
"$1_prompt_segment" "$0" "blue" "$DEFAULT_COLOR" "$(print_icon 'HOME_ICON')$current_path"
|
"$1_prompt_segment" "$0" "blue" "$DEFAULT_COLOR" "$(print_icon 'HOME_ICON')$current_path"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# GO-prompt
|
||||||
|
prompt_go_version() {
|
||||||
|
local go_version
|
||||||
|
go_version=$(go version 2>&1 | grep -oe "^go[0-9.]*")
|
||||||
|
|
||||||
|
if [[ -n "$go_version" ]]; then
|
||||||
|
"$1_prompt_segment" "$0" "green" "255" "$go_version"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Command number (in local history)
|
# Command number (in local history)
|
||||||
prompt_history() {
|
prompt_history() {
|
||||||
"$1_prompt_segment" "$0" "244" "$DEFAULT_COLOR" '%h'
|
"$1_prompt_segment" "$0" "244" "$DEFAULT_COLOR" '%h'
|
||||||
|
|
Loading…
Reference in a new issue