diff options
author | Dan Davison <dandavison7@gmail.com> | 2021-05-26 12:32:34 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-26 12:32:34 -0400 |
commit | 9de714a8a93f9c353abf5979f74b676fe6397b04 (patch) | |
tree | 4ff0307a35e44bb8e466e7b3963793a3b5892205 | |
parent | 974204f897f06e8b87566cf25f6866096573c959 (diff) |
Improve documentation of hyperlinks (#616)
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | src/cli.rs | 20 |
2 files changed, 13 insertions, 9 deletions
@@ -49,6 +49,8 @@ Code evolves, and we all spend time studying diffs. Delta aims to make this both - Support for Git's `--color-moved` feature. - Code can be copied directly from the diff (`-/+` markers are removed by default). - `n` and `N` keybindings to move between files in large diffs, and between diffs in `log -p` views (`--navigate`) +- Commit hashes can be formatted as terminal [hyperlinks](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda) to the Github/GitLab/Bitbucket page (`--hyperlinks`). + File paths can also be formatted as hyperlinks for opening in your OS. The most convenient way to configure delta is with a `[delta]` section in `~/.gitconfig`. Here's a quick example: @@ -237,15 +237,17 @@ pub struct Opt { pub relative_paths: bool, #[structopt(long = "hyperlinks")] - /// Render commit hashes, file names, and line numbers as hyperlinks, according to the - /// hyperlink spec for terminal emulators: - /// https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda. By default, file names - /// and line numbers link to the local file using a file URL, whereas commit hashes link to the - /// commit in GitHub, if the remote repository is hosted by GitHub. See - /// --hyperlinks-file-link-format for full control over the file URLs emitted. Hyperlinks are - /// supported by several common terminal emulators. To make them work, you must pass the -r (as - /// opposed to -R) flag to less, e.g. via `export DELTA_PAGER=less -rX`. If you use tmux, then - /// you will also need a patched fork of tmux (see https://github.com/dandavison/tmux). + /// Render commit hashes, file names, and line numbers as hyperlinks, + /// according to the hyperlink spec for terminal emulators: + /// https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda. By + /// default, file names and line numbers link to the local file using a file + /// URL, whereas commit hashes link to the commit in GitHub, if the remote + /// repository is hosted by GitHub. See --hyperlinks-file-link-format for + /// full control over the file URLs emitted. Hyperlinks are supported by + /// several common terminal emulators. To make them work, you must use less + /// version >= 581 with the -R flag (or use -r with older less versions, but + /// this will break e.g. --navigate). If you use tmux, then you will also + /// need a patched fork of tmux (see https://github.com/dandavison/tmux). pub hyperlinks: bool, #[structopt(long = "keep-plus-minus-markers")] |