Add gitcd (and czgcd) functions
This commit is contained in:
parent
66ffbc9098
commit
a546290cf6
|
@ -24,6 +24,9 @@ if is_cmd 'chezmoi'; then
|
|||
${SET_X:-:} +x
|
||||
}
|
||||
czcd() { chezmoi cd "${@}"; }
|
||||
czgcd() {
|
||||
cd "$(chezmoi git -- rev-parse --show-toplevel)${1:+/${1}}"
|
||||
}
|
||||
czedext() {
|
||||
local CZ_EXT="$(find $(command chezmoi source-path) -mindepth 1 -maxdepth 1 -name '.chezmoiexternal.*')"
|
||||
CZ_EXT="${CZ_EXT:-$(chezmoi source-path "${@}")/.chezmoiexternal.yaml.tmpl}"
|
||||
|
|
|
@ -35,5 +35,11 @@ alias vim='nvim '
|
|||
alias nvimdiff='nvim -d '
|
||||
alias vimdiff='nvimdiff '
|
||||
|
||||
if is_cmd git; then
|
||||
gitcd() {
|
||||
cd "$(git rev-parse --show-toplevel)${1:+/${1}}"
|
||||
}
|
||||
fi
|
||||
|
||||
# vim: set ft=sh expandtab tabstop=4 shiftwidth=4:
|
||||
|
||||
|
|
Loading…
Reference in New Issue