Skip to content

Commit

Permalink
docs: add file navigation wraparound tip
Browse files Browse the repository at this point in the history
  • Loading branch information
sxyazi committed Feb 22, 2024
1 parent 8ff0f22 commit 126aa9a
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions docs/tips.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,32 @@ exec = [ "yank", '''
''' ]
```

## File navigation wraparound

Save these lines as `~/.config/yazi/plugins/arrow.yazi/init.lua`:

```lua
return {
entry = function(_, args)
local step, current = tonumber(args[1]), cx.active.current
local new = (current.cursor + step) % #current.files
ya.manager_emit("arrow", { new - current.cursor })
end,
}
```

Then bind it for `k` and `j` key, in your `keymap.toml`:

```toml
[[manager.prepend_keymap]]
on = [ "k" ]
exec = "plugin --sync arrow --args=-1"

[[manager.prepend_keymap]]
on = [ "j" ]
exec = "plugin --sync arrow --args=1"
```

## No status bar

<img src={useBaseUrl("/img/no-status-bar.jpg")} width="600" />
Expand Down

0 comments on commit 126aa9a

Please sign in to comment.