configs  Check-in [57c7dd0298]

Overview
Comment:zshrc: Make colordiff fallback work on MSYS2
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 57c7dd0298ade391b7593853e9897be6599f23588225e6a8c670fde0ab7902ec
User & Date: js on 2020-05-24 13:30:32
Other Links: manifest | tags
Context
2020-05-24
13:50
Rename fsl alias to fl (and fsld to fld) check-in: feaffda420 user: js tags: trunk
13:30
zshrc: Make colordiff fallback work on MSYS2 check-in: 57c7dd0298 user: js tags: trunk
13:19
zshrc: Provide fallback when colordiff is missing check-in: ea72aa4093 user: js tags: trunk
Changes

Modified zshrc from [3b08de2410] to [8026454ccc].

206
207
208
209
210
211
212
213
214
215
216





217
218
219
220
221
222
223
206
207
208
209
210
211
212




213
214
215
216
217
218
219
220
221
222
223
224







-
-
-
-
+
+
+
+
+







if which fossil &>/dev/null; then
	alias fsl="fossil"

	fsld() {
		if which colordiff &>/dev/null; then
			fossil diff -N "$@" | colordiff | less -FRX
		else
			fossil diff -N "$@" |
				sed "s/^+.*$/$(tput setaf 2)&$(tput sgr0)/" |
				sed "s/^-.*$/$(tput setaf 1)&$(tput sgr0)/" |
				less -FRX
			red="$(tput setaf 1)"
			green="$(tput setaf 2)"
			reset="$(tput sgr0)"
			fossil diff -N "$@" | sed "s/^+.*$/$green&$reset/" |
				sed "s/^-.*$/$red&$reset/" | less -FRX
		fi
	}
fi

# pkgsrc does not like MAKEFLAGS including -j
which pkg_chk &>/dev/null && alias pkg_chk="MAKEFLAGS= pkg_chk"
which pkg_rolling-replace &>/dev/null &&