From 143458ae1a8bd6450aa4e054b8102c1e53048aa4 Mon Sep 17 00:00:00 2001 From: sxyazi Date: Mon, 9 Sep 2024 20:35:12 +0800 Subject: [PATCH] docs: add a tip to cd back to the root of the current Git repository --- docs/quick-start.md | 4 +++- docs/tips.md | 12 ++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/quick-start.md b/docs/quick-start.md index 84ab4853..d271800c 100644 --- a/docs/quick-start.md +++ b/docs/quick-start.md @@ -102,7 +102,9 @@ del "%tmpfile%" -To use it, copy the function into the configuration file of your respective shell. Then use `y` instead of `yazi` to start. +To use it, copy the function into the configuration file of your respective shell. + +Then use `y` instead of `yazi` to start, and press q to quit, you'll see the CWD changed. Sometimes, you don't want to change, press Q to quit. ## Keybindings diff --git a/docs/tips.md b/docs/tips.md index 6b8362d4..55e25ef4 100644 --- a/docs/tips.md +++ b/docs/tips.md @@ -152,6 +152,18 @@ run = [ ''' ''', "yank" ] ``` +## `cd` back to the root of the current Git repository {#cd-to-git-root} + +```toml +[[manager.prepend_keymap]] +on = [ "g", "r" ] +run = ''' + shell 'ya pub dds-cd --str "$(git rev-parse --show-toplevel)"' --confirm +''' +``` + +Credits to [@aidanzhai for sharing it](https://t.me/yazi_rs/3325/15373) in Yazi's telegram group. + ## Maximize preview pane {#max-preview} Moved to https://github.com/yazi-rs/plugins/tree/main/max-preview.yazi