Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: rename shell wrapper ya to yy #49

Merged
merged 1 commit into from
Mar 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ Press `q` to quit and `~` to open the help menu.

## Shell wrapper

We suggest using this `ya` shell wrapper that provides the ability to change the current working directory when exiting Yazi.
We suggest using this `yy` shell wrapper that provides the ability to change the current working directory when exiting Yazi.

<Tabs>
<TabItem value="bash-zsh" label="Bash / Zsh" default>

```bash
function ya() {
function yy() {
local tmp="$(mktemp -t "yazi-cwd.XXXXX")"
yazi "$@" --cwd-file="$tmp"
if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
Expand All @@ -38,7 +38,7 @@ function ya() {
<TabItem value="fish" label="Fish">

```sh
function ya
function yy
set tmp (mktemp -t "yazi-cwd.XXXXX")
yazi $argv --cwd-file="$tmp"
if set cwd (cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ]
Expand All @@ -52,7 +52,7 @@ end
<TabItem value="nushell" label="Nushell">

```sh
def --env ya [...args] {
def --env yy [...args] {
let tmp = (mktemp -t "yazi-cwd.XXXXX")
yazi ...$args --cwd-file $tmp
let cwd = (open $tmp)
Expand All @@ -67,7 +67,7 @@ def --env ya [...args] {
<TabItem value="powershell" label="PowerShell">

```powershell
function ya {
function yy {
$tmp = [System.IO.Path]::GetTempFileName()
yazi $args --cwd-file="$tmp"
$cwd = Get-Content -Path $tmp
Expand All @@ -81,7 +81,7 @@ function ya {
</TabItem>
</Tabs>

To use it, copy the function into the configuration file of your respective shell. Then use `ya` instead of `yazi` to start.
To use it, copy the function into the configuration file of your respective shell. Then use `yy` instead of `yazi` to start.

## Keybindings

Expand Down