diff --git a/docs/docs/beta.mdx b/docs/docs/beta.mdx new file mode 100644 index 00000000..2d2eb1bd --- /dev/null +++ b/docs/docs/beta.mdx @@ -0,0 +1,89 @@ +--- +id: beta +title: Beta Features +sidebar_label: 🍼 Beta Features +--- + +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + +## Tooltips + +Tooltips are segments that are rendered as a right aligned prompt while you're typing certain keywords. +They behave similar 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. + +Due to limitations (or not having found a way just yet) this feature only work for `zsh` and `powershell` at +the time of writing. + +### 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": { + "display_status": true, + "display_upstream_icon": true, + "status_colors_enabled": true, + "local_changes_color": "#ff9248", + "ahead_and_behind_color": "#f26d50", + "behind_color": "#f17c37", + "ahead_color": "#89d1dc" + } + } + ] +} +``` + +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 + + + + +Import/invoke Oh My Posh in your `$PROFILE` and add the following setting: + +```pwsh +$Global:PoshSettings.EnableToolTips = $true +``` + +Restart your shell or reload your `$PROFILE` using `. $PROFILE` for the changes to take effect. + + + + +Invoke Oh My Posh in `.zshrc` and add the following setting: + +```bash +enable_poshtooltips +``` + +Restart your shell or reload `.zshrc` using `source ~/.zshrc` for the changes to take effect. + + + diff --git a/docs/sidebars.js b/docs/sidebars.js index 9e402f5a..3f9d6acb 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -17,6 +17,7 @@ module.exports = { ], }, "configure", + "beta", "themes", "share", "fonts",