docs: informative layout

This commit is contained in:
Jan De Dobbeleer 2021-11-12 19:14:16 +01:00 committed by Jan De Dobbeleer
parent 2733865edf
commit 19544bff9b
21 changed files with 434 additions and 378 deletions

View file

@ -1,190 +0,0 @@
---
id: beta
title: Beta Features
sidebar_label: 🍼 Beta Features
---
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
## Tooltips
:::info
Due to limitations (or not having found a way just yet), this feature only works in `zsh` and `powershell` for
the time being.
:::
![Tooltip Demo](/img/posh-tooltip.gif)
Tooltips are segments that are rendered as a right-aligned prompt while you're typing certain keywords.
They behave similarly to the other segments when it comes to how and when they are shown so you can tweak
them to act and look like you want. The key difference is that they can be invoked using `tips` which are the
commands you are typing. Due to the possibility of the use of an alias, you can define for which keyword
the segment should be rendered.
### Configuration
You need to extend or create a custom theme with your tooltips. For example:
```json
{
"blocks": [
...
],
"tooltips": [
{
"type": "git",
"tips": ["git", "g"],
"style": "diamond",
"foreground": "#193549",
"background": "#fffb38",
"leading_diamond": "",
"trailing_diamond": "",
"properties": {
"fetch_status": true,
"fetch_upstream_icon": true,
"template": "{{ .HEAD }}{{ if .Staging.Changed }} \uF046 {{ .Staging.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Working.Changed }} \uF044 {{ .Working.String }}{{ end }}"
}
}
]
}
```
This configuration will render a right-aligned git segment when you type `git` or `g` followed by a space. Keep in mind that
this is a blocking call, meaning that if the segment renders slow, you can't type until it's visible. Optimizations in this space
are being explored.
### Enable the feature
<Tabs
defaultValue="pwsh"
groupId="shell"
values={[
{ label: 'powershell', value: 'pwsh', },
{ label: 'zsh', value: 'zsh', },
]
}>
<TabItem value="pwsh">
Import/invoke Oh My Posh in your `$PROFILE` and add the following line below:
```pwsh
Enable-PoshTooltips
```
For example:
```pwsh
# $PROFILE
oh-my-posh --init --shell pwsh --config ~\wildertheme.json | Invoke-Expression
Enable-PoshTooltips
```
Restart your shell or reload your `$PROFILE` using `. $PROFILE` for the changes to take effect.
</TabItem>
<TabItem value="zsh">
Invoke Oh My Posh in `.zshrc` and add the following line below:
```bash
enable_poshtooltips
```
Restart your shell or reload `.zshrc` using `source ~/.zshrc` for the changes to take effect.
</TabItem>
</Tabs>
## Transient prompt
:::info
This feature only works in `zsh` and `powershell` for the time being.
:::
Transient prompt, when enabled, replaces the prompt with a simpler one to allow more screen real estate.
You can use go [text/template][go-text-template] templates extended with [sprig][sprig] to enrich the text.
Environment variables are available, just like the [`console_title_template`][console-title] functionality.
Typically, your prompt will simply leave the prompt on the screen when you execute a command (or press enter) like so:
![Before Transient](/img/transient-before.gif)
By enabling Transient Prompt, you can replace the prompt with some other content for a cleaner console as shown here:
![After Transient](/img/transient-after.gif)
### Configuration
You need to extend or create a custom theme with your transient prompt. For example:
```json
{
"blocks": {
...
}
"transient_prompt": {
"background": "transparent",
"foreground": "#ffffff",
"template": "{{ .Shell }}> "
}
}
```
The configuration has the following properties:
- background: `string` [color][colors]
- foreground: `string` [color][colors]
- template: `string` - A go [text/template][go-text-template] template extended with [sprig][sprig] utilizing the
properties below. Defaults to `{{ .Shell }}> `
#### Template Properties
- `.Root`: `boolean` - is the current user root/admin or not
- `.Path`: `string` - the current working directory
- `.Folder`: `string` - the current working folder
- `.Shell`: `string` - the current shell name
- `.User`: `string` - the current user name
- `.Host`: `string` - the host name
- `.Env.VarName`: `string` - Any environment variable where `VarName` is the environment variable name
### Enable the feature
<Tabs
defaultValue="pwsh"
groupId="shell"
values={[
{ label: 'powershell', value: 'pwsh', },
{ label: 'zsh', value: 'zsh', },
]
}>
<TabItem value="pwsh">
Import/invoke Oh My Posh in your `$PROFILE` and add the following line below:
```pwsh
Enable-PoshTransientPrompt
```
Restart your shell or reload your `$PROFILE` using `. $PROFILE` for the changes to take effect.
</TabItem>
<TabItem value="zsh">
Invoke Oh My Posh in `.zshrc` and add the following line below:
```bash
enable_poshtransientprompt
```
Restart your shell or reload `.zshrc` using `source ~/.zshrc` for the changes to take effect.
</TabItem>
</Tabs>
[go-text-template]: https://golang.org/pkg/text/template/
[sprig]: https://masterminds.github.io/sprig/
[console-title]: /docs/configure#console-title-template
[colors]: /docs/configure#colors

View file

@ -0,0 +1,55 @@
---
id: config-colors
title: Colors
sidebar_label: Colors
---
## Standard colors
Oh My Posh supports multiple different color references, being:
- Typical [hex colors][hexcolors] (for example `#CB4B16`).
- 16 [ANSI color names][ansicolors].
- The `transparent` keyword which can be used to create either a transparent foreground override
or transparent background color using the segment's foreground property.
- The `foreground` keyword which can be used to reference the current segment's foreground color.
- The `background` keyword which can be used to reference the current segment's background color.
- The `parentForeground` keyword which can be used to inherit the previous active segment's foreground color.
- The `parentBackground` keyword which can be used to inherit the previous active segment's background color.
These include 8 basic ANSI colors and `default`:
`black` `red` `green` `yellow` `blue` `magenta` `cyan` `white` `default`
as well as 8 extended ANSI colors:
`darkGray` `lightRed` `lightGreen` `lightYellow` `lightBlue` `lightMagenta` `lightCyan` `lightWhite`
## Color overrides
You have the ability to override the foreground and/or background color for text in any property that accepts it.
The syntax is custom but should be rather straight-forward: `<foreground,background>text</>`. For example,
`<#ffffff,#000000>this is white with black background</> <#FF479C>but this is pink</>`.
Anything between the color start `<#FF479C>` and end `</>` will be colored accordingly.
If you want `prefix` to print a colored bracket that isn't the same as the segment's `foreground`, you can
do so like this:
```json
"prefix": "<#CB4B16>┏[</>",
```
If you also wanted to change the background color in the previous command, you would do so like this:
```json
"prefix": "<#CB4B16,#FFFFFF>┏[</>",
```
To change *only* the background color, just omit the first color from the above string:
```json
"prefix": "<,#FFFFFF>┏[</>",
```
[hexcolors]: https://htmlcolorcodes.com/color-chart/material-design-color-chart/
[ansicolors]: https://htmlcolorcodes.com/color-chart/material-design-color-chart/

View file

@ -0,0 +1,35 @@
---
id: config-text-style
title: Text style
sidebar_label: Text style
---
## Text decorations
You can make use of the following syntax to decorate text:
- `<b>bold</b>`: renders `bold` as bold text
- `<u>underline</u>`: renders `underline` as underlined text
- `<i>italic</i>`: renders `italic` as italic text
- `<s>strikethrough</s>`: renders `strikethrough` as strikethrough text
This can be used in templates and icons/text inside your config.
## Hyperlinks
The engine has the ability to render hyperlinks. Your terminal has to support it and the option
has to be enabled at the segment level. Hyperlink generation is disabled by default.
### Supported segments
- [Path][path-segment]
- [Git][git-segment]
- Most languages (version hyperlink)
### Supported terminals
- [Terminal list][terminal-list-hyperlinks]
[terminal-list-hyperlinks]: https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda
[path-segment]: /docs/path
[git-segment]: /docs/git

View file

@ -1,7 +1,7 @@
---
id: fonts
id: config-fonts
title: Fonts
sidebar_label: 🆎 Fonts
sidebar_label: Fonts
---
### Nerd Fonts
@ -44,4 +44,4 @@ The `minimal` themes do not make use of Nerd Font icons.
[meslo]: https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/Meslo.zip
[themes]: https://github.com/JanDeDobbeleer/oh-my-posh/tree/main/themes
[font-thread]: https://github.com/JanDeDobbeleer/oh-my-posh/issues/145#issuecomment-730162622
[configuration]: /docs/configure
[configuration]: /docs/config-overview

View file

@ -1,14 +1,21 @@
---
id: configure
title: Configuration
sidebar_label: ⚙️ Configuration
id: config-overview
title: Overview
sidebar_label: Overview
---
Oh My Posh renders your prompt based on the definition of _blocks_ (like Lego) which contain one or more _segments_.
A really simple configuration could look like this.
A really simple configuration could look like this. The default format is `json`, but we also support `toml` and `yaml`.
There's a [schema][schema] available which is kept up-to-date and helps with autocomplete and validation of the configuration.
:::info
There are a few [themes][themes] available which are basically predefined configs. You can use these as they are, or as a
starting point to create your own configuration.
:::
```json
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"final_space": true,
"blocks": [
{
@ -44,63 +51,19 @@ theme.
:::
```bash
oh-my-posh --config sample.json --shell universal
oh-my-posh --config sample.json --shell uni
```
If all goes according to plan, you should see the prompt being printed out on the line below. In case you see a lot of
boxes with question marks, set up your terminal to use a supported font before continuing.
boxes with question marks, set up your terminal to use a [supported font][font] before continuing.
## General Settings
- final_space: `boolean` - when true adds a space at the end of the prompt
- osc99: `boolean` - when true adds support for OSC9;9; (notify terminal of current working directory)
- console_title: `boolean` - when true sets the current location as the console title
- console_title_style: `string` - the title to set in the console - defaults to `folder`
- console_title_template: `string` - the template to use when `"console_title_style" = "template"`
- terminal_background: `string` [color][colors] - terminal background color, set to your terminal's background color when
you notice black elements in Windows Terminal or the Visual Studio Code integrated terminal
> "I Like The Way You Speak Words" - Gary Goodspeed
### Console Title Style
- `folder`: show the current folder name
- `path`: show the current path
- `template`: show a custom template
### Console Title Template
You can create a more custom console title with the use of `"console_title_style" = "template"`.
When this is set, a `console_title_template` is also expected, otherwise, the title will remain empty.
Under the hood, this uses go's [text/template][go-text-template] feature extended with [sprig][sprig] and
offers a few standard properties to work with.
- `.Root`: `boolean` - is the current user root/admin or not
- `.Path`: `string` - the current working directory
- `.Folder`: `string` - the current working folder
- `.Shell`: `string` - the current shell name
- `.User`: `string` - the current user name
- `.Host`: `string` - the host name
- `.Env.VarName`: `string` - Any environment variable where `VarName` is the environment variable name
A `boolean` can be used for conditional display purposes, a `string` can be displayed.
The following examples illustrate possible contents for `console_title_template`, provided
the current working directory is `/usr/home/omp` and the shell is `zsh`.
```json
{
"console_title_template": "{{.Folder}}{{if .Root}} :: root{{end}} :: {{.Shell}}",
// outputs:
// when root == false: omp :: zsh
// when root == true: omp :: root :: zsh
"console_title_template": "{{.Folder}}", // outputs: omp
"console_title_template": "{{.Shell}} in {{.Path}}", // outputs: zsh in /usr/home/omp
"console_title_template": "{{.User}}@{{.Host}} {{.Shell}} in {{.Path}}", // outputs: MyUser@MyMachine zsh in /usr/home/omp
"console_title_template": "{{.Env.USERDOMAIN}} {{.Shell}} in {{.Path}}", // outputs: MyCompany zsh in /usr/home/omp
}
```
## Block
Let's take a closer look at what defines a block.
@ -326,79 +289,6 @@ directory name, you need to specify it as `\\\\`.
This means that for user Bill, who has a user account `Bill` on Windows and `bill` on Linux, `~/Foo` might match
`C:\Users\Bill\Foo` or `C:\Users\Bill\foo` on Windows but only `/home/bill/Foo` on Linux.
### Colors
#### Standard colors
Oh My Posh supports multiple different color references, being:
- Typical [hex colors][hexcolors] (for example `#CB4B16`).
- 16 [ANSI color names][ansicolors].
- The `transparent` keyword which can be used to create either a transparent foreground override
or transparent background color using the segment's foreground property.
- The `foreground` keyword which can be used to reference the current segment's foreground color.
- The `background` keyword which can be used to reference the current segment's background color.
- The `parentForeground` keyword which can be used to inherit the previous active segment's foreground color.
- The `parentBackground` keyword which can be used to inherit the previous active segment's background color.
These include 8 basic ANSI colors and `default`:
`black` `red` `green` `yellow` `blue` `magenta` `cyan` `white` `default`
as well as 8 extended ANSI colors:
`darkGray` `lightRed` `lightGreen` `lightYellow` `lightBlue` `lightMagenta` `lightCyan` `lightWhite`
#### Color overrides
You have the ability to override the foreground and/or background color for text in any property that accepts it.
The syntax is custom but should be rather straight-forward: `<foreground,background>text</>`. For example,
`<#ffffff,#000000>this is white with black background</> <#FF479C>but this is pink</>`.
Anything between the color start `<#FF479C>` and end `</>` will be colored accordingly.
If you want `prefix` to print a colored bracket that isn't the same as the segment's `foreground`, you can
do so like this:
```json
"prefix": "<#CB4B16>┏[</>",
```
If you also wanted to change the background color in the previous command, you would do so like this:
```json
"prefix": "<#CB4B16,#FFFFFF>┏[</>",
```
To change *only* the background color, just omit the first color from the above string:
```json
"prefix": "<,#FFFFFF>┏[</>",
```
### Text decorations
You can make use of the following syntax to decorate text:
- `<b>bold</b>`: renders `bold` as bold text
- `<u>underline</u>`: renders `underline` as underlined text
- `<i>italic</i>`: renders `italic` as italic text
- `<s>strikethrough</s>`: renders `strikethrough` as strikethrough text
This can be used in templates and icons/text inside your config.
### Hyperlinks
The engine has the ability to render hyperlinks. Your terminal has to support it and the option
has to be enabled at the segment level. Hyperlink generation is disabled by default.
#### Supported segments
- [Path][path-segment]
#### Supported terminals
- [Terminal list][terminal-list-hyperlinks]
## Full Sample
```json
@ -480,17 +370,13 @@ has to be enabled at the segment level. Hyperlink generation is disabled by defa
```
[releases]: https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest
[nf]: https://www.nerdfonts.com/
[font]: /docs/config-fonts
[schema]: https://github.com/JanDeDobbeleer/oh-my-posh/blob/main/themes/schema.json
[themes]: https://github.com/JanDeDobbeleer/oh-my-posh/tree/main/themes
[segments]: /docs/battery
[colors]: #colors
[hexcolors]: https://htmlcolorcodes.com/color-chart/material-design-color-chart/
[ansicolors]: https://htmlcolorcodes.com/color-chart/material-design-color-chart/
[fg]: /docs/configure#foreground
[regex]: https://www.regular-expressions.info/tutorial.html
[rprompt]: https://scriptingosx.com/2019/07/moving-to-zsh-06-customizing-the-zsh-prompt/
[path-segment]: /docs/path
[terminal-list-hyperlinks]: https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda
[colors]: /docs/config-colors
[go-text-template]: https://golang.org/pkg/text/template/
[sprig]: https://masterminds.github.io/sprig/
[fg-templ]: /docs/config-overview#foreground-templates
[regex]: https://www.regular-expressions.info/tutorial.html
[aws]: /docs/aws
[fg-templ]: /docs/configure#foreground-templates

63
docs/docs/config-title.md Normal file
View file

@ -0,0 +1,63 @@
---
id: config-title
title: Console title
sidebar_label: Console title
---
```json
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"console_title_template": "{{.Folder}}{{if .Root}} :: root{{end}} :: {{.Shell}}",
"blocks": [
...
]
}
```
To manipulate the console title, you can make use of the following properties:
- console_title: `boolean` - when true sets the current location as the console title
- console_title_style: `string` - the title to set in the console - defaults to `folder`
- console_title_template: `string` - the template to use when `"console_title_style" = "template"`
### Console Title Style
- `folder`: show the current folder name
- `path`: show the current path
- `template`: show a custom template
### Console Title Template
You can create a more custom console title with the use of `"console_title_style" = "template"`.
When this is set, a `console_title_template` is also expected, otherwise, the title will remain empty.
Under the hood, this uses go's [text/template][go-text-template] feature extended with [sprig][sprig] and
offers a few standard properties to work with.
- `.Root`: `boolean` - is the current user root/admin or not
- `.Path`: `string` - the current working directory
- `.Folder`: `string` - the current working folder
- `.Shell`: `string` - the current shell name
- `.User`: `string` - the current user name
- `.Host`: `string` - the host name
- `.Env.VarName`: `string` - Any environment variable where `VarName` is the environment variable name
A `boolean` can be used for conditional display purposes, a `string` can be displayed.
The following examples illustrate possible contents for `console_title_template`, provided
the current working directory is `/usr/home/omp` and the shell is `zsh`.
```json
{
"console_title_template": "{{.Folder}}{{if .Root}} :: root{{end}} :: {{.Shell}}",
// outputs:
// when root == false: omp :: zsh
// when root == true: omp :: root :: zsh
"console_title_template": "{{.Folder}}", // outputs: omp
"console_title_template": "{{.Shell}} in {{.Path}}", // outputs: zsh in /usr/home/omp
"console_title_template": "{{.User}}@{{.Host}} {{.Shell}} in {{.Path}}", // outputs: MyUser@MyMachine zsh in /usr/home/omp
"console_title_template": "{{.Env.USERDOMAIN}} {{.Shell}} in {{.Path}}", // outputs: MyCompany zsh in /usr/home/omp
}
```
[go-text-template]: https://golang.org/pkg/text/template/
[sprig]: https://masterminds.github.io/sprig/

View file

@ -0,0 +1,96 @@
---
id: config-tooltips
title: Tooltips
sidebar_label: Tooltips
---
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
:::info
Due to limitations (or not having found a way just yet), this feature only works in `zsh` and `powershell` for
the time being.
:::
![Tooltip Demo](/img/posh-tooltip.gif)
Tooltips are segments that are rendered as a right-aligned prompt while you're typing certain keywords.
They behave similarly to the other segments when it comes to how and when they are shown so you can tweak
them to act and look like you want. The key difference is that they can be invoked using `tips` which are the
commands you are typing. Due to the possibility of the use of an alias, you can define for which keyword
the segment should be rendered.
### Configuration
You need to extend or create a custom theme with your tooltips. For example:
```json
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
...
],
"tooltips": [
{
"type": "git",
"tips": ["git", "g"],
"style": "diamond",
"foreground": "#193549",
"background": "#fffb38",
"leading_diamond": "",
"trailing_diamond": "",
"properties": {
"fetch_status": true,
"fetch_upstream_icon": true,
"template": "{{ .HEAD }}{{ if .Staging.Changed }} \uF046 {{ .Staging.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Working.Changed }} \uF044 {{ .Working.String }}{{ end }}"
}
}
]
}
```
This configuration will render a right-aligned git segment when you type `git` or `g` followed by a space. Keep in mind that
this is a blocking call, meaning that if the segment renders slow, you can't type until it's visible. Optimizations in this space
are being explored.
## Enable the feature
<Tabs
defaultValue="pwsh"
groupId="shell"
values={[
{ label: 'powershell', value: 'pwsh', },
{ label: 'zsh', value: 'zsh', },
]
}>
<TabItem value="pwsh">
Import/invoke Oh My Posh in your `$PROFILE` and add the following line below:
```pwsh
Enable-PoshTooltips
```
For example:
```pwsh
# $PROFILE
oh-my-posh --init --shell pwsh --config ~\wildertheme.json | Invoke-Expression
Enable-PoshTooltips
```
Restart your shell or reload your `$PROFILE` using `. $PROFILE` for the changes to take effect.
</TabItem>
<TabItem value="zsh">
Invoke Oh My Posh in `.zshrc` and add the following line below:
```bash
enable_poshtooltips
```
Restart your shell or reload `.zshrc` using `source ~/.zshrc` for the changes to take effect.
</TabItem>
</Tabs>

View file

@ -0,0 +1,100 @@
---
id: config-transient
title: Transient prompt
sidebar_label: Transient prompt
---
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
:::info
This feature only works in `zsh` and `powershell` for the time being.
:::
Transient prompt, when enabled, replaces the prompt with a simpler one to allow more screen real estate.
You can use go [text/template][go-text-template] templates extended with [sprig][sprig] to enrich the text.
Environment variables are available, just like the [`console_title_template`][console-title] functionality.
Typically, your prompt will simply leave the prompt on the screen when you execute a command (or press enter) like so:
![Before Transient](/img/transient-before.gif)
By enabling Transient Prompt, you can replace the prompt with some other content for a cleaner console as shown here:
![After Transient](/img/transient-after.gif)
## Configuration
You need to extend or create a custom theme with your transient prompt. For example:
```json
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": {
...
}
"transient_prompt": {
"background": "transparent",
"foreground": "#ffffff",
"template": "{{ .Shell }}> "
}
}
```
The configuration has the following properties:
- background: `string` [color][colors]
- foreground: `string` [color][colors]
- template: `string` - A go [text/template][go-text-template] template extended with [sprig][sprig] utilizing the
properties below. Defaults to `{{ .Shell }}> `
### Template Properties
- `.Root`: `boolean` - is the current user root/admin or not
- `.Path`: `string` - the current working directory
- `.Folder`: `string` - the current working folder
- `.Shell`: `string` - the current shell name
- `.User`: `string` - the current user name
- `.Host`: `string` - the host name
- `.Env.VarName`: `string` - Any environment variable where `VarName` is the environment variable name
## Enable the feature
<Tabs
defaultValue="pwsh"
groupId="shell"
values={[
{ label: 'powershell', value: 'pwsh', },
{ label: 'zsh', value: 'zsh', },
]
}>
<TabItem value="pwsh">
Import/invoke Oh My Posh in your `$PROFILE` and add the following line below:
```pwsh
Enable-PoshTransientPrompt
```
Restart your shell or reload your `$PROFILE` using `. $PROFILE` for the changes to take effect.
</TabItem>
<TabItem value="zsh">
Invoke Oh My Posh in `.zshrc` and add the following line below:
```bash
enable_poshtransientprompt
```
Restart your shell or reload `.zshrc` using `source ~/.zshrc` for the changes to take effect.
</TabItem>
</Tabs>
[colors]: /docs/config-colors
[go-text-template]: https://golang.org/pkg/text/template/
[console-title]: /docs/config-title#console-title-template
[sprig]: https://masterminds.github.io/sprig/

View file

@ -138,12 +138,12 @@ To solely rely on Oh My Posh to set the prompt, you can configure the follwing s
conda config --set changeps1 False
```
[new-issue]: https://github.com/JanDeDobbeleer/oh-my-posh/issues/new
[new-issue]: https://github.com/JanDeDobbeleer/oh-my-posh/issues/new/choose
[latest]: https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest
[wt-glyph]: https://github.com/microsoft/terminal/issues/3546
[wt-glyphs]: https://github.com/microsoft/terminal/issues?q=is%3Aissue+is%3Aopen+unicode+width
[nf]: https://www.nerdfonts.com/
[font]: fonts.md
[font]: /docs/config-fonts
[jb-icons]: https://youtrack.jetbrains.com/issue/IDEA-248010
[upgrading]: upgrading.md
[wt-vim]: https://github.com/microsoft/terminal/issues/3794

View file

@ -58,4 +58,4 @@ When you've downloaded the themes, you can find this one at `~/.poshthemes/jande
[iterm2]: https://www.iterm2.com/
[powershell]: https://www.powershellgallery.com/packages/oh-my-posh
[brew]: https://brew.sh
[configuration]: /docs/configure
[configuration]: /docs/config-overview

View file

@ -64,4 +64,4 @@ When using brew, you can find this one at `$(brew --prefix oh-my-posh)/themes/ja
[iterm2]: https://www.iterm2.com/
[powershell]: https://www.powershellgallery.com/packages/oh-my-posh
[brew]: https://brew.sh
[configuration]: /docs/configure
[configuration]: /docs/config-overview

View file

@ -83,4 +83,4 @@ Update-Module oh-my-posh
[scoop]: https://scoop.sh/
[wt]: https://github.com/microsoft/terminal
[powershell]: https://www.powershellgallery.com/packages/oh-my-posh
[configuration]: /docs/configure
[configuration]: /docs/config-overview

View file

@ -48,7 +48,7 @@ installation guide to get started right away!
[omp]: https://github.com/JanDeDobbeleer/oh-my-posh2
[omz]: https://github.com/ohmyzsh/ohmyzsh
[block]: /docs/configure#block
[segment]: /docs/configure#segment
[block]: /docs/config-overview#block
[segment]: /docs/config-overview#segment
[themes]: https://github.com/JanDeDobbeleer/oh-my-posh/tree/main/themes
[omp-themes]: https://github.com/JanDeDobbeleer/oh-my-posh/tree/master/Themes

View file

@ -55,7 +55,7 @@ properties below. Defaults to `{{.Icon}}{{ if not .Error }}{{.Percentage}}{{ end
- `.Error`: `string` - the error in case fetching the battery information failed
- `.Icon`: `string` - the icon based on the battery state
[colors]: /docs/configure#colors
[colors]: /docs/config-colors
[battery]: https://github.com/distatus/battery/blob/master/battery.go#L78
[go-text-template]: https://golang.org/pkg/text/template/
[sprig]: https://masterminds.github.io/sprig/

View file

@ -38,4 +38,4 @@ Displays the last exit code or that the last command failed based on the configu
- success_icon: `string` - displays when there's no error and `"always_enabled": true` - defaults to `""`
- error_icon: `string` - displays when there's an error - defaults to `""`
[colors]: /docs/configure#colors
[colors]: /docs/config-colors

View file

@ -48,6 +48,6 @@ properties below. Only used when a value is set, making the above properties obs
- `POSH_SESSION_DEFAULT_USER` - used to override the hardcoded `default_user_name` property
[colors]: /docs/configure#colors
[colors]: /docs/config-colors
[go-text-template]: https://golang.org/pkg/text/template/
[sprig]: https://masterminds.github.io/sprig/

View file

@ -38,6 +38,6 @@ properties below.
- `.Host`: `string` - the host name
- `.Env.VarName`: `string` - Any environment variable where `VarName` is the environment variable name
[coloring]: /docs/configure#colors
[coloring]: /docs/config-colors
[go-text-template]: https://golang.org/pkg/text/template/
[sprig]: https://masterminds.github.io/sprig/

View file

@ -17,7 +17,7 @@ Once you're ready to swap to a theme, follow the steps described in [🚀Install
Themes with `minimal` in their names do not require a Nerd Font. Read about [🆎Fonts][fonts] for more information.
[themes]: https://github.com/JanDeDobbeleer/oh-my-posh/tree/main/themes
[fonts]: /docs/fonts
[fonts]: /docs/config-fonts
[replace-you-existing-prompt]: /docs/windows#override-the-theme-settings
<!-- Do not change the content below, themes are rendered automatically -->

View file

@ -107,5 +107,5 @@ Do not hesitate to [ask for assistance][issues] when you notice an issue or unex
[introduction]: /docs/#concept
[v3]: https://github.com/JanDeDobbeleer/oh-my-posh/
[themesv3]: https://github.com/JanDeDobbeleer/oh-my-posh/tree/main/themes
[configuration]: /docs/configure
[configuration]: /docs/config-overview
[issues]: https://github.com/JanDeDobbeleer/oh-my-posh/issues/new

View file

@ -2,7 +2,7 @@ module.exports = {
docs: [
{
type: "category",
label: "Getting Started",
label: "💡 Getting Started",
collapsed: false,
items: [
"introduction",
@ -10,20 +10,27 @@ module.exports = {
{
type: "category",
label: "🚀 Installation",
collapsed: false,
items: ["pwsh", "windows", "macos", "linux"],
},
"configure",
"beta",
"themes",
"share",
"fonts",
"faq",
"contributors",
],
},
{
type: "category",
label: "Segments",
label: "⚙️ Configuration",
items: [
"config-overview",
"config-title",
"config-colors",
"config-text-style",
"config-transient",
"config-tooltips",
"config-fonts"
],
},
{
type: "category",
label: "🌟 Segments",
collapsed: true,
items: [
"angular",
@ -66,7 +73,7 @@ module.exports = {
},
{
type: "category",
label: "Contributing",
label: "🙋🏾‍♀️ Contributing",
collapsed: true,
items: [
"contributing_started",
@ -74,5 +81,9 @@ module.exports = {
"contributing_git",
],
},
"themes",
"share",
"faq",
"contributors",
],
};

View file

@ -3,19 +3,19 @@
"$id": "http://example.com/example.json",
"type": "object",
"title": "The Oh My Posh theme definition",
"description": "https://ohmyposh.dev/docs/configure",
"description": "https://ohmyposh.dev/docs/config-overview",
"definitions": {
"color": {
"type": "string",
"pattern": "^(#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})|black|red|green|yellow|blue|magenta|cyan|white|default|darkGray|lightRed|lightGreen|lightYellow|lightBlue|lightMagenta|lightCyan|lightWhite|transparent|parentBackground|parentForeground|background|foreground)$",
"title": "Color string",
"description": "https://ohmyposh.dev/docs/configure#colors",
"description": "https://ohmyposh.dev/docs/config-colors",
"format": "color"
},
"color_templates": {
"type": "array",
"title": "Templates to define a color",
"description": "https://ohmyposh.dev/docs/configure#foreground-templates",
"description": "https://ohmyposh.dev/docs/config-overview#foreground-templates",
"default": [],
"items": {
"type": "string"
@ -60,7 +60,7 @@
},
"block": {
"type": "object",
"description": "https://ohmyposh.dev/docs/configure#block",
"description": "https://ohmyposh.dev/docs/config-overview#block",
"allOf": [
{
"if": {
@ -89,37 +89,37 @@
"type": {
"type": "string",
"title": "Block type",
"description": "https://ohmyposh.dev/docs/configure#type",
"description": "https://ohmyposh.dev/docs/config-overview#type",
"enum": ["prompt", "rprompt"],
"default": "prompt"
},
"alignment": {
"type": "string",
"title": "Block alignment",
"description": "https://ohmyposh.dev/docs/configure#alignment",
"description": "https://ohmyposh.dev/docs/config-overview#alignment",
"enum": ["left", "right"],
"default": "left"
},
"newline": {
"type": "boolean",
"title": "Newline",
"description": "https://ohmyposh.dev/docs/configure#newline",
"description": "https://ohmyposh.dev/docs/config-overview#newline",
"default": false
},
"vertical_offset": {
"type": "integer",
"title": "Block vertical offset",
"description": "https://ohmyposh.dev/docs/configure#vertical-offset"
"description": "https://ohmyposh.dev/docs/config-overview#vertical-offset"
},
"horizontal-offset": {
"type": "integer",
"title": "Block vertical offset",
"description": "https://ohmyposh.dev/docs/configure#horizontal-offset"
"description": "https://ohmyposh.dev/docs/config-overview#horizontal-offset"
},
"segments": {
"type": "array",
"title": "Segments list, prompt elements to display based on context",
"description": "https://ohmyposh.dev/docs/configure#segment",
"description": "https://ohmyposh.dev/docs/config-overview#segment",
"default": [],
"items": { "$ref": "#/definitions/segment" }
}
@ -128,14 +128,14 @@
"segment": {
"type": "object",
"title": "A segment",
"description": "https://ohmyposh.dev/docs/configure#segment",
"description": "https://ohmyposh.dev/docs/config-overview#segment",
"default": {},
"required": ["type", "style"],
"properties": {
"type": {
"type": "string",
"title": "Segment Type",
"description": "https://ohmyposh.dev/docs/configure#type-1",
"description": "https://ohmyposh.dev/docs/config-overview#type-1",
"enum": [
"session",
"path",
@ -177,7 +177,7 @@
"style": {
"type": "string",
"title": "Segment Style",
"description": "https://ohmyposh.dev/docs/configure#style",
"description": "https://ohmyposh.dev/docs/config-overview#style",
"enum": ["powerline", "plain", "diamond"]
},
"foreground": { "$ref": "#/definitions/color" },
@ -187,25 +187,25 @@
"properties": {
"type": "object",
"title": "Segment Properties, used to change behavior/displaying",
"description": "https://ohmyposh.dev/docs/configure#properties",
"description": "https://ohmyposh.dev/docs/config-overview#properties",
"default": {},
"properties": {
"prefix": {
"type": "string",
"title": "Text prefix",
"description": "https://ohmyposh.dev/docs/configure#prefix",
"description": "https://ohmyposh.dev/docs/config-overview#prefix",
"default": " "
},
"postfix": {
"type": "string",
"title": "Text postfix",
"description": "https://ohmyposh.dev/docs/configure#postfix",
"description": "https://ohmyposh.dev/docs/config-overview#postfix",
"default": " "
},
"include_folders": {
"type": "array",
"title": "If specified, segment will only render in these folders",
"description": "https://ohmyposh.dev/docs/configure#include--exclude-folders",
"description": "https://ohmyposh.dev/docs/config-overview#include--exclude-folders",
"default": [],
"items": {
"type": "string"
@ -214,7 +214,7 @@
"exclude_folders": {
"type": "array",
"title": "Exclude rendering in these folders",
"description": "https://ohmyposh.dev/docs/configure#include--exclude-folders",
"description": "https://ohmyposh.dev/docs/config-overview#include--exclude-folders",
"default": [],
"items": {
"type": "string"
@ -223,7 +223,7 @@
"ignore_folders": {
"type": "array",
"title": "Deprecated - please use `exclude_folders` instead",
"description": "https://ohmyposh.dev/docs/configure#include--exclude-folders",
"description": "https://ohmyposh.dev/docs/config-overview#include--exclude-folders",
"default": [],
"items": {
"type": "string"
@ -245,13 +245,13 @@
"powerline_symbol": {
"type": "string",
"title": "Powerline Symbol",
"description": "https://ohmyposh.dev/docs/configure#powerline-symbol",
"description": "https://ohmyposh.dev/docs/config-overview#powerline-symbol",
"default": "\uE0B0"
},
"invert_powerline": {
"type": "boolean",
"title": "Flip the Powerline symbol vertically",
"description": "https://ohmyposh.dev/docs/configure#invert-powerline",
"description": "https://ohmyposh.dev/docs/config-overview#invert-powerline",
"default": false
}
}
@ -268,13 +268,13 @@
"leading_diamond": {
"type": "string",
"title": "Leading diamond",
"description": "https://ohmyposh.dev/docs/configure#leading-diamond",
"description": "https://ohmyposh.dev/docs/config-overview#leading-diamond",
"default": ""
},
"trailing_diamond": {
"type": "string",
"title": "Trailing diamond",
"description": "https://ohmyposh.dev/docs/configure#trailing-diamond",
"description": "https://ohmyposh.dev/docs/config-overview#trailing-diamond",
"default": ""
}
}
@ -1717,32 +1717,32 @@
"final_space": {
"type": "boolean",
"title": "Final Space",
"description": "https://ohmyposh.dev/docs/configure#general-settings",
"description": "https://ohmyposh.dev/docs/config-overview#general-settings",
"default": true
},
"osc99": {
"type": "boolean",
"title": "Enable OSC99",
"description": "https://ohmyposh.dev/docs/configure#general-settings",
"description": "https://ohmyposh.dev/docs/config-overview#general-settings",
"default": false
},
"console_title": {
"type": "boolean",
"title": "Console Title",
"description": "https://ohmyposh.dev/docs/configure#general-settings",
"description": "https://ohmyposh.dev/docs/config-overview#general-settings",
"default": true
},
"console_title_style": {
"type": "string",
"title": "Console Title Style",
"description": "https://ohmyposh.dev/docs/configure#console-title-style",
"description": "https://ohmyposh.dev/docs/config-title#console-title-style",
"enum": ["folder", "path", "template"],
"default": "folder"
},
"console_title_template": {
"type": "string",
"title": "Console Title Template",
"description": "https://ohmyposh.dev/docs/configure#console-title-template",
"description": "https://ohmyposh.dev/docs/config-title#console-title-template",
"default": "{{ .Shell }} in {{ .Folder }}"
},
"terminal_background": { "$ref": "#/definitions/color" },
@ -1750,7 +1750,7 @@
"type": "array",
"title": "Block array",
"default": [],
"description": "https://ohmyposh.dev/docs/configure",
"description": "https://ohmyposh.dev/docs/config-overview",
"items": { "$ref": "#/definitions/block" }
},
"tooltips": {