docs: adjust layout

This commit is contained in:
Jan De Dobbeleer 2022-03-09 11:39:31 +01:00 committed by Jan De Dobbeleer
parent f2a8cbe990
commit f630fe89d6
9 changed files with 83 additions and 90 deletions

View file

@ -189,6 +189,20 @@ Refer [this page on ArchWiki][arch-terminfo].
If you are on Windows, use Windows Terminal. It closely copies the `xterm-256color` capabilities. If you are on Windows, use Windows Terminal. It closely copies the `xterm-256color` capabilities.
See the [PowerShell docs on terminal support][ps-ansi-docs] and [this GitHub comment][xterm-gh-comment]. See the [PowerShell docs on terminal support][ps-ansi-docs] and [this GitHub comment][xterm-gh-comment].
## The term xx/oh-my-posh.exe is not recognized as a name of a cmdlet
```
&: The term 'C:/Users/TommiGr├╢nlund/.oh-my-posh/oh-my-posh.exe' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
```
The issue is that PowerShell on Windows doesn't yet default to UTF8. Resolve the issue by adding the following line
to the top of your `$PROFILE`:
```powershell
$OutputEncoding = [console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding
```
[arch-terminfo]: https://wiki.archlinux.org/title/Bash/Prompt_customization#Terminfo_escape_sequences [arch-terminfo]: https://wiki.archlinux.org/title/Bash/Prompt_customization#Terminfo_escape_sequences
[ps-ansi-docs]: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_ansi_terminals?view=powershell-7.2 [ps-ansi-docs]: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_ansi_terminals?view=powershell-7.2
[xterm-gh-comment]: https://github.com/microsoft/terminal/issues/6045#issuecomment-631743728 [xterm-gh-comment]: https://github.com/microsoft/terminal/issues/6045#issuecomment-631743728

View file

@ -1,21 +0,0 @@
<!-- markdownlint-disable-next-line MD041 -->
At this point, you're good to go. The `jandedobbeleer.omp.json` theme displays the most common use-cases
in your prompt, so 9/10 you'll be more than happy with it. However, if you want to explore additional
functionality, going through the additional steps below will help you get started.
### Change the theme
We downloaded all the themes and set `jandedobbeleer.omp.json` as the one to use.
However, there are [a lot more][themes] to be discovered and maybe there are some you like better.
### Override the theme settings
Maybe there's a theme you like, but you don't fancy the colors. Or, maybe there's a segment you
want to tweak/add, or replace some of the icons with a different one. Whatever the case, read through all
available options first, by starting with the [configuration guide][configuration].
You can output the current theme to the format you like (`json`, `yaml` or `toml`) which can be used to tweak
and store as your custom theme.
[themes]: themes.md
[configuration]: config-overview.md

View file

@ -1,6 +1,33 @@
---
id: customize
title: Customize
sidebar_label: 💅🏼 Customize
---
import Tabs from "@theme/Tabs"; import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem"; import TabItem from "@theme/TabItem";
:::tip
When using oh-my-posh in Windows and the WSL, know that you can share your theme with the WSL by pointing to a theme in your
Windows user's home folder.
Inside the WSL, you can find your Windows user's home folder here: `/mnt/c/Users/<WINDOWSUSERNAME>`.
:::
### Change the theme
We downloaded all the themes and set `jandedobbeleer.omp.json` as the one to use.
However, there are [a lot more][themes] to be discovered and maybe there are some you like better.
### Override the theme settings
Maybe there's a theme you like, but you don't fancy the colors. Or, maybe there's a segment you
want to tweak/add, or replace some of the icons with a different one. Whatever the case, read through all
available options first, by starting with the [configuration guide][configuration].
You can output the current theme to the format you like (`json`, `yaml` or `toml`) which can be used to tweak
and store as your custom theme.
<Tabs <Tabs
defaultValue="powershell" defaultValue="powershell"
groupId="shell" groupId="shell"
@ -82,3 +109,7 @@ Once adjusted, reload your config for the changes to take effect.
</TabItem> </TabItem>
</Tabs> </Tabs>
[themes]: themes.md
[configuration]: config-overview.md

View file

@ -28,8 +28,6 @@ brew update && brew upgrade && exec zsh
``` ```
::: :::
## Replace your existing prompt
[brew]: https://brew.sh [brew]: https://brew.sh
[nextsteps]: https://docs.brew.sh/Homebrew-on-Linux#install [nextsteps]: https://docs.brew.sh/Homebrew-on-Linux#install
[themes]: https://ohmyposh.dev/docs/themes [themes]: https://ohmyposh.dev/docs/themes

View file

@ -6,9 +6,6 @@ sidebar_label: 🐧 Linux
import Tabs from "@theme/Tabs"; import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem"; import TabItem from "@theme/TabItem";
import Shells from "./install-shells.mdx";
import Customize from "./install-customize.md";
import CustomizeCmd from "./install-customize-cmd.mdx";
import InstallHomebrew from "./install-homebrew.mdx"; import InstallHomebrew from "./install-homebrew.mdx";
## Setup your terminal ## Setup your terminal
@ -58,21 +55,9 @@ chmod u+rw ~/.poshthemes/*.json
rm ~/.poshthemes/themes.zip rm ~/.poshthemes/themes.zip
``` ```
## Replace your existing prompt
</TabItem> </TabItem>
</Tabs> </Tabs>
<Shells />
## Customize
<Customize />
<CustomizeCmd />
🎉🎉🎉
[fonts]: /docs/config-fonts [fonts]: /docs/config-fonts
[scoop]: https://scoop.sh/ [scoop]: https://scoop.sh/
[wt]: https://github.com/microsoft/terminal [wt]: https://github.com/microsoft/terminal

View file

@ -6,9 +6,6 @@ sidebar_label: 🍏 macOS
import Tabs from "@theme/Tabs"; import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem"; import TabItem from "@theme/TabItem";
import Shells from "./install-shells.mdx";
import Customize from "./install-customize.md";
import CustomizeCmd from "./install-customize-cmd.mdx";
import InstallHomebrew from "./install-homebrew.mdx"; import InstallHomebrew from "./install-homebrew.mdx";
## Setup your terminal ## Setup your terminal
@ -24,16 +21,6 @@ To display all icons, we recommend the use of a [Nerd Font][fonts].
<InstallHomebrew /> <InstallHomebrew />
<Shells />
## Customize
<Customize />
<CustomizeCmd />
🎉🎉🎉
[fonts]: /docs/config-fonts [fonts]: /docs/config-fonts
[scoop]: https://scoop.sh/ [scoop]: https://scoop.sh/
[wt]: https://github.com/microsoft/terminal [wt]: https://github.com/microsoft/terminal

View file

@ -1,3 +1,9 @@
---
id: prompt
title: Change your prompt
sidebar_label: ✨ Prompt
---
import Tabs from "@theme/Tabs"; import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem"; import TabItem from "@theme/TabItem";
@ -31,15 +37,6 @@ notepad $PROFILE
Then add the following line. Then add the following line.
:::caution
If you installed Oh My Posh using `Install-Module oh-my-posh`, you need to first import
Oh My Posh in your `$PROFILE` before adding the line below:
```powershell
Import-Module oh-my-posh
```
:::
```powershell ```powershell
oh-my-posh --init --shell pwsh --config https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/v$(oh-my-posh --version)/themes/jandedobbeleer.omp.json | Invoke-Expression oh-my-posh --init --shell pwsh --config https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/v$(oh-my-posh --version)/themes/jandedobbeleer.omp.json | Invoke-Expression
``` ```
@ -50,6 +47,15 @@ Once added, reload your profile for the changes to take effect.
. $PROFILE . $PROFILE
``` ```
:::caution
If you installed Oh My Posh using `Install-Module oh-my-posh`, you need to first import
Oh My Posh in your `$PROFILE` before adding the line above:
```powershell
Import-Module oh-my-posh
```
:::
</TabItem> </TabItem>
<TabItem value="cmd"> <TabItem value="cmd">
@ -130,13 +136,13 @@ Once added, reload your config for the changes to take effect.
Set the prompt and restart nu shell: Set the prompt and restart nu shell:
### Nu < 0.32.0 **Nu < 0.32.0**
```bash ```bash
config set prompt "= `{{$(oh-my-posh --config https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/jandedobbeleer.omp.json | str collect)}}`" config set prompt "= `{{$(oh-my-posh --config https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/jandedobbeleer.omp.json | str collect)}}`"
``` ```
### Nu >= 0.32.0 **Nu >= 0.32.0**
```bash ```bash
config set prompt "(oh-my-posh --config https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/jandedobbeleer.omp.json | str collect)" config set prompt "(oh-my-posh --config https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/jandedobbeleer.omp.json | str collect)"

View file

@ -6,9 +6,6 @@ sidebar_label: ⊞ Windows
import Tabs from "@theme/Tabs"; import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem"; import TabItem from "@theme/TabItem";
import Shells from "./install-shells.mdx";
import Customize from "./install-customize.md";
import CustomizeCmd from "./install-customize-cmd.mdx";
## Setup your terminal ## Setup your terminal
@ -18,6 +15,10 @@ While Oh My Posh works on the standard terminal, we advise using the [Windows Te
To display all icons, we recommend the use of a [Nerd Font][fonts]. To display all icons, we recommend the use of a [Nerd Font][fonts].
::: :::
:::caution
When using oh-my-posh inside the WSL, make sure to follow the [linux][linux] installation guide.
:::
## Install ## Install
<Tabs <Tabs
@ -122,7 +123,7 @@ choco upgrade oh-my-posh
</TabItem> </TabItem>
</Tabs> </Tabs>
## Replace your existing prompt ## Default themes
<Tabs <Tabs
defaultValue="winget" defaultValue="winget"
@ -164,27 +165,6 @@ when setting the prompt using the `--config` flag.
</TabItem> </TabItem>
</Tabs> </Tabs>
:::caution
When using oh-my-posh inside the WSL, make sure to follow the [linux][linux] installation guide.
:::
<Shells />
## Customize
<Customize />
:::tip
When using oh-my-posh in Windows and the WSL, know that you can share your theme with the WSL by pointing to a theme in your
Windows user's home folder.
Inside the WSL, replace `~` with the following path: `/mnt/c/Users/<WINDOWSUSERNAME>`.
:::
<CustomizeCmd />
🎉🎉🎉
[fonts]: /docs/config-fonts [fonts]: /docs/config-fonts
[scoop]: https://scoop.sh/ [scoop]: https://scoop.sh/
[wt]: https://github.com/microsoft/terminal [wt]: https://github.com/microsoft/terminal

View file

@ -9,9 +9,22 @@ module.exports = {
"upgrading", "upgrading",
{ {
type: "category", type: "category",
label: "🚀 Installation", label: "🚀 Get started",
collapsed: false, collapsed: false,
items: ["windows", "macos", "linux"], items: [
{
type: "category",
label: "📦 Installation",
collapsed: false,
items: [
"windows",
"macos",
"linux",
],
},
"prompt",
"customize"
],
}, },
], ],
}, },