2.3 KiB
Cheatsheet repositories
About
Navi lets you work with what we call cheatsheet repositories, they are git repositories
and mainly consists of .cheat files.
This page is dedicated to the information you might need to work with cheatsheet repositories.
Importing cheatsheet repositories
You can import cheatsheet repositories with the repo add subcommand.
See /docs/usage/commands/repo for more details.
Submitting cheatsheets
The featured repository for cheatsheets is denisidoro/cheats, feel free to open a PR1 there for me to include your contributions.
In order to add your own repository as a featured cheatsheet repo, please edit this file and open a PR1.
Auto-updating repositories
Right now, navi doesn't have support for auto-updating out of the box.
However, you can achieve this by using git and crontab.
-
First make sure you cloned your repo using
gitto the correct folder:user="<user>" repo="<repo>" git clone "https://github.com/${user}/${repo}" "$(navi info cheats-path)/${user}__${repo}" -
Then, add a cron job:
crontab -e */0 11 * * * bash -c 'cd "$(/usr/local/bin/navi info cheats-path)/<user>__<repo>" && /usr/local/bin/git pull -q origin master'
Note
Please note the cron job above is just an example AND you should edit it accordingly:
In this example, the cron job is triggered every day at 11am.
You might want to check out crontab guru regarding crontab.
The full paths to
naviandgitmay differ in your setup.Check their actual values using
whichaswhich <program>.Don't forget to replace
<user>__<repo>with the actual folder name
-
A PR is short for Pull Request ↩︎