2020-10-05 02:33:12 -07:00
|
|
|
---
|
|
|
|
id: introduction
|
|
|
|
title: Introduction
|
2020-12-23 06:24:26 -08:00
|
|
|
sidebar_label: 👋 Introduction
|
2020-10-05 02:33:12 -07:00
|
|
|
slug: /
|
|
|
|
---
|
|
|
|
|
2021-06-05 10:27:33 -07:00
|
|
|
Oh My Posh is a custom prompt engine for any shell that has the ability to adjust
|
2020-10-05 02:33:12 -07:00
|
|
|
the prompt string with a function or variable.
|
|
|
|
|
|
|
|
## Concept
|
|
|
|
|
2021-10-28 06:33:14 -07:00
|
|
|
Traditionally, prompt tools work with custom scripts per theme (just like [Oh My Posh 2][omp] did) or a lot
|
2021-06-05 10:27:33 -07:00
|
|
|
of CLI configuration switches to define what it looks like. With Oh My Posh, I wanted to start from a single
|
2020-10-05 02:33:12 -07:00
|
|
|
configuration file that could easily be shared anywhere, removing the need to really grasp what goes on underneath.
|
|
|
|
|
|
|
|
When you look at prompts like Agnoster or Paradox, you notice they usually consist of a few building
|
|
|
|
**blocks** which contain one or more **segments** that display some sort of information. The configuration of
|
2021-06-05 10:27:33 -07:00
|
|
|
Oh My Posh works exactly like that. Blocks are a combination of one or more segments.
|
2020-10-05 02:33:12 -07:00
|
|
|
|
|
|
|
The basic layout of the config file is as follows.
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"blocks": []
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
A [block][block] has properties that indicate its position and the [segments][segment] it will render.
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"blocks": [
|
|
|
|
{
|
|
|
|
// positioning metadata (not shown)
|
|
|
|
"segments": []
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
A [segment][segment] renders a single context like showing the current folder, user information or git status
|
|
|
|
when relevant. It can be styled any way you want, resulting in visualizing the prompt you are looking for.
|
|
|
|
|
2021-06-05 10:27:33 -07:00
|
|
|
For your convenience, the existing [themes][themes] from [Oh My Posh][omp-themes] have been added to version 3, so you
|
2020-10-05 02:33:12 -07:00
|
|
|
can get started even without having to understand the theming. So, let's no longer waste time on theory, have a look at the
|
2021-06-03 11:01:46 -07:00
|
|
|
installation guide to get started right away!
|
2020-10-05 02:33:12 -07:00
|
|
|
|
2021-02-15 23:36:37 -08:00
|
|
|
[omp]: https://github.com/JanDeDobbeleer/oh-my-posh2
|
2022-05-04 16:46:06 -07:00
|
|
|
[block]: /docs/configuration/block
|
|
|
|
[segment]: /docs/configuration/segment
|
2021-02-15 23:36:37 -08:00
|
|
|
[themes]: https://github.com/JanDeDobbeleer/oh-my-posh/tree/main/themes
|
2020-10-05 02:33:12 -07:00
|
|
|
[omp-themes]: https://github.com/JanDeDobbeleer/oh-my-posh/tree/master/Themes
|