From a3f58ecc371c6d208627fe1836d8cb5aee995bff Mon Sep 17 00:00:00 2001 From: Raman Gupta Date: Thu, 5 Sep 2024 08:15:18 -0400 Subject: [PATCH] docs: faq for Fish PWD history navigation As per https://github.com/JanDeDobbeleer/oh-my-posh/issues/5567 a function is needed to integrate Fish directory history navigation with oh-my-posh. Add an FAQ entry about this. --- website/docs/faq.mdx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/website/docs/faq.mdx b/website/docs/faq.mdx index 7747814d..a8dd88d6 100644 --- a/website/docs/faq.mdx +++ b/website/docs/faq.mdx @@ -306,6 +306,18 @@ After that, you can use the value in a template. The following replicates the [e } ``` +### Fish: Integrate with `Alt+←` and `Alt+→` Bindings to `prevd` and `nextd` + +Fish supports using `Alt+←` (Alt+Left) and `Alt+→` (Alt+Right) bindings to [navigate the directory history](https://fishshell.com/docs/current/interactive.html#id13). + +To have oh-my-posh update the directory context as the directory history is navigated, use a function that calls `omp_repaint_prompt` when the `$PWD` variable changes: + +```fish +function rerender_on_dir_change --on-variable PWD + omp_repaint_prompt +end +``` + ### After updating my Nerd Font to a newer version, the prompt displays unknown characters Nerd Fonts moved the icons to a different location in the font for v3.