Skip to content

Commit

Permalink
docs: rename shell wrapper ya to yy (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
sxyazi authored Mar 15, 2024
1 parent 52495e1 commit 6201d7d
Showing 1 changed file with 6 additions and 6 deletions.
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

0 comments on commit 6201d7d

Please sign in to comment.