configs  Check-in [b119513a53]

Overview
Comment:Don't rely on tput
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: b119513a53d8ec93ab9ca5cd74b8911601f32d21a7d0bcd1e1354d897e9f13a0
User & Date: js 2020-09-18 13:47:57
Context
2020-10-04
10:53
tmux: Set escape-time to 0 check-in: 731caa6883 user: js tags: trunk
2020-09-18
13:47
Don't rely on tput check-in: b119513a53 user: js tags: trunk
2020-09-12
13:17
Rename gpg-s* to gs* check-in: ce84ad04e7 user: js tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to fish/functions/cvsd.fish.

1
2
3
4
5
6
7
8
9
10
11
function cvsd --wraps 'cvs diff'
    if type -q colordiff
        command cvs diff -uN $argv | colordiff | less -FRX
    else
        set -l red (tput setaf 1)
        set -l green (tput setaf 2)
        set -l reset (tput sgr0)
        cvs diff -uN $argv | sed "s/^+.*\$/$green&$reset/" |
            sed "s/^-.*\$/$red&$reset/" | less -FRX
    end
end




|
|
|




1
2
3
4
5
6
7
8
9
10
11
function cvsd --wraps 'cvs diff'
    if type -q colordiff
        command cvs diff -uN $argv | colordiff | less -FRX
    else
        set -l red (printf "\033[31m")
        set -l green (printf "\033[32m")
        set -l reset (printf "\033[0m")
        cvs diff -uN $argv | sed "s/^+.*\$/$green&$reset/" |
            sed "s/^-.*\$/$red&$reset/" | less -FRX
    end
end

Changes to fish/functions/fld.fish.

1
2
3
4
5
6
7
8
9
10
11
function fld --wraps 'fossil diff'
    if type -q colordiff
        command fossil diff -N $argv | colordiff | less -FRX
    else
        set -l red (tput setaf 1)
        set -l green (tput setaf 2)
        set -l reset (tput sgr0)
        fossil diff -N $argv | sed "s/^+.*\$/$green&$reset/" |
            sed "s/^-.*\$/$red&$reset/" | less -FRX
    end
end




|
|
|




1
2
3
4
5
6
7
8
9
10
11
function fld --wraps 'fossil diff'
    if type -q colordiff
        command fossil diff -N $argv | colordiff | less -FRX
    else
        set -l red (printf "\033[31m")
        set -l green (printf "\033[32m")
        set -l reset (printf "\033[0m")
        fossil diff -N $argv | sed "s/^+.*\$/$green&$reset/" |
            sed "s/^-.*\$/$red&$reset/" | less -FRX
    end
end

Changes to zshrc.

226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
	esac
}

__has_command tmux && alias tmux="tmux -f $XDG_CONFIG_HOME/tmux/tmux.conf"

if ! __has_command colordiff; then
	colordiff() {
		red="$(tput setaf 1)"
		green="$(tput setaf 2)"
		reset="$(tput sgr0)"
		sed "s/^+.*$/$green&$reset/" | sed "s/^-.*$/$red&$reset/"
	}
fi

if __has_command fossil; then
	alias fl="fossil"
	alias flc="fossil changes --differ"







|
|
|







226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
	esac
}

__has_command tmux && alias tmux="tmux -f $XDG_CONFIG_HOME/tmux/tmux.conf"

if ! __has_command colordiff; then
	colordiff() {
		local red=$(printf "\033[31m")
		local green=$(printf "\033[32m")
		local reset=$(printf "\033[0m")
		sed "s/^+.*$/$green&$reset/" | sed "s/^-.*$/$red&$reset/"
	}
fi

if __has_command fossil; then
	alias fl="fossil"
	alias flc="fossil changes --differ"