Skip to content

Commit 3ba29c9

Browse files
authored
(maint) update pro-tips.md
Last week, @psprint deleted all `zinit` related source code. More info can be [found here](https://github.com/zdharma-continuum/I_WANT_TO_HELP) - update `zdharma` URLs to `zdharma-continuum` URLS. - apply consistent markdown formatting - add language hints to code fences
1 parent c3205c8 commit 3ba29c9

File tree

1 file changed

+23
-17
lines changed

1 file changed

+23
-17
lines changed

pro-tips.md

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,74 @@
1-
## Pro-tips
1+
# Pro-tips
22

3-
#### One-off fanciness or a specific diff-so-fancy alias
3+
## One-off fanciness or a specific diff-so-fancy alias
44

55
You can do also do a one-off:
6+
67
```shell
78
git diff --color | diff-so-fancy
89
```
10+
911
or configure an alias and a corresponding pager to use `diff-so-fancy`:
12+
1013
```shell
1114
git config --global alias.dsf "diff --color"
1215
git config --global pager.dsf "diff-so-fancy | less --tabs=4 -RFXS"
1316
```
1417

15-
#### Opting-out
18+
## Opting-out
1619

1720
Sometimes you will want to bypass diff-so-fancy. Use `--no-pager` for that:
1821

1922
```shell
2023
git --no-pager diff
2124
```
2225

23-
#### Raw patches
26+
## Raw patches
2427

2528
As a shortcut for a 'normal' diff to save as a patch for emailing or later
2629
application, it may be helpful to configure an alias:
30+
2731
```ini
2832
[alias]
2933
patch = !git --no-pager diff --no-color
3034
```
35+
3136
which can then be used as `git patch > changes.patch`.
3237

3338
#### Moving around in the diff
3439

35-
You can pre-seed your `less` pager with a search pattern, so you can move
40+
You can pre-seed your `less` pager with a search pattern so that you can move
3641
between files with `n`/`N` keys:
42+
3743
```ini
3844
[pager]
3945
diff = diff-so-fancy | less --tabs=4 -RFXS --pattern '^(Date|added|deleted|modified): '
4046
```
4147

42-
#### Zsh plugin providing diff-so-fancy
48+
## Zsh plugin providing diff-so-fancy
4349

44-
Zsh plugin [zdharma/zsh-diff-so-fancy](https://github.com/zdharma/zsh-diff-so-fancy) has this
45-
project as a submodule so installing the plugin installs `diff-so-fancy`. The plugin provides
46-
subcommand `git dsf` out of the box. Installation with Zinit, Zplug and Zgen:
50+
Zsh plugin [zdharma-continuum/zsh-diff-so-fancy](https://github.com/zdharma-continuum/zsh-diff-so-fancy) has this
51+
project as a submodule, so installing the plugin installs `diff-so-fancy`. The plugin provides
52+
the subcommand `git dsf` out of the box. Installation with Zinit, Zplug, and Zgen:
4753

4854
```zsh
4955
# zinit
5056
zinit ice lucid as"program" pick"bin/git-dsf"
51-
zinit load zdharma/zsh-diff-so-fancy
57+
zinit load zdharma-continuum/zsh-diff-so-fancy
5258

53-
# Or zplug
54-
zplug "zdharma/zsh-diff-so-fancy", as:command, use:bin/git-dsf
59+
# zplug
60+
zplug "zdharma-continuum/zsh-diff-so-fancy", as:command, use:bin/git-dsf
5561

56-
# Or zgen and others
57-
zgen zdharma/zsh-diff-so-fancy
62+
# zgen and others
63+
zgen zdharma-continuum/zsh-diff-so-fancy
5864
```
5965

60-
#### `hg` configuration
66+
## `hg` configuration
6167

6268
You can configure `hg diff` output to use `diff-so-fancy` by adding this alias
6369
to your `hgrc` file:
6470

65-
```
71+
```ini
6672
[alias]
67-
diff = !HGPLAIN=1 $HG diff --pager=on --config pager.pager=diff-so-fancy $@
73+
diff = !HGPLAIN=1 $HG diff --pager=on --config pager.pager=diff-so-fancy $@
6874
```

0 commit comments

Comments
 (0)