Add delimiter template directives to avoid syntax errors
This commit is contained in:
parent
d65e18856b
commit
84a09058d0
@ -1,22 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
# chezmoi:template:left-delimiter=#{{
|
||||
#{{- /* vim: filetype=bash */}}
|
||||
|
||||
. "${HOME}/.profile"
|
||||
source "${HOME}/.profile"
|
||||
|
||||
# if not running interactively, don't do anything more
|
||||
[ -z "$PS1" ] && return
|
||||
|
||||
{{- if not (lookPath "starship") }}
|
||||
#{{- if not (lookPath "starship") }}
|
||||
if [[ -f "${XDG_CONFIG_HOME}/bash/prompt.sh" ]]; then
|
||||
# shellcheck disable=SC1090
|
||||
source "${XDG_CONFIG_HOME}/bash/prompt.sh"
|
||||
fi
|
||||
{{- end }}
|
||||
#{{- end }}
|
||||
|
||||
if [ -d "${XDG_CONFIG_HOME}"/bash/bashrc.d ]; then
|
||||
for file in "${XDG_CONFIG_HOME}"/bash/bashrc.d/*.sh; do
|
||||
if [ -r "$file" ]; then
|
||||
#shellcheck disable=1090
|
||||
. "$file"
|
||||
source "$file"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
@ -31,5 +33,3 @@ if [[ -d "${XDG_CONFIG_HOME}/bash/env.d" ]]; then
|
||||
)"
|
||||
done
|
||||
fi
|
||||
|
||||
# vim: ft=bash
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
#chezmoi:template:left-delimiter=#{{
|
||||
#{{- /*- vim: filetype=bash */ -}}
|
||||
if [[ ${BASH_VERSION} != "3.2*" ]]; then
|
||||
shopt -s autocd
|
||||
fi
|
||||
@ -14,27 +16,25 @@ if [[ ! $PROMPT_COMMAND =~ "history -a" ]]; then
|
||||
PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
|
||||
fi
|
||||
|
||||
{{ if and (lookPath "setxkbmap") (eq .chezmoi.os "linux") -}}
|
||||
#{{ if and (lookPath "setxkbmap") (eq .chezmoi.os "linux") -}}
|
||||
# Disable capslock
|
||||
setxkbmap -option ctrl:nocaps
|
||||
{{- end }}
|
||||
#{{- end }}
|
||||
|
||||
{{ if lookPath "lesspipe" -}}
|
||||
#{{ if lookPath "lesspipe" -}}
|
||||
# make less more friendly for non-text input files, see lesspipe(1)
|
||||
eval "$(SHELL=/bin/sh {{ lookPath "lesspipe" }})"
|
||||
{{- end }}
|
||||
eval "$(SHELL=/bin/sh #{{ lookPath "lesspipe" }})"
|
||||
#{{- end }}
|
||||
|
||||
{{ if lookPath "dircolors" -}}
|
||||
#{{ if lookPath "dircolors" -}}
|
||||
# enable color support of ls and also add handy aliases
|
||||
if test -r ~/.dircolors; then
|
||||
eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
|
||||
fi
|
||||
{{- end }}
|
||||
#{{- end }}
|
||||
|
||||
if [[ -d "${XDG_DATA_HOME}/JetBrains/Toolbox/scripts" ]]; then
|
||||
if [[ ":${PATH}:" != *":${XDG_DATA_HOME}/JetBrains/Toolbox/scripts:"* ]]; then
|
||||
export PATH="${PATH}:${XDG_DATA_HOME}/JetBrains/Toolbox/scripts"
|
||||
fi
|
||||
fi
|
||||
|
||||
# vim: filetype=bash
|
||||
|
||||
@ -1,14 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
# chezmoi:template:left-delimiter=#{{
|
||||
#{{- /* vim: filetype=bash */ -}}
|
||||
|
||||
{{ if stat "/etc/bash_completion" -}}
|
||||
#{{ if stat "/etc/bash_completion" -}}
|
||||
source /etc/bash_completion
|
||||
{{ end -}}
|
||||
#{{ end -}}
|
||||
|
||||
{{ if stat "/usr/local/etc/bash_completion" -}}
|
||||
#{{ if stat "/usr/local/etc/bash_completion" -}}
|
||||
source /usr/local/etc/bash_completion
|
||||
{{ end -}}
|
||||
#{{ end -}}
|
||||
|
||||
{{ if stat "/usr/local/etc/bash_completion.d/" -}}
|
||||
#{{ if stat "/usr/local/etc/bash_completion.d/" -}}
|
||||
for i in $(ls /usr/local/etc/bash_completion.d/); do
|
||||
if [ -r "/usr/local/etc/bash_completion.d/$i" ]; then
|
||||
# shellcheck disable=SC1090
|
||||
@ -16,49 +17,46 @@ for i in $(ls /usr/local/etc/bash_completion.d/); do
|
||||
fi
|
||||
done
|
||||
unset i
|
||||
{{ end -}}
|
||||
#{{ end -}}
|
||||
|
||||
{{ if lookPath "brew" -}}
|
||||
#{{ if lookPath "brew" -}}
|
||||
if [ -f "$(brew --prefix)/share/bash-completion/bash_completion" ]; then
|
||||
. "$(brew --prefix)/share/bash-completion/bash_completion"
|
||||
source "$(brew --prefix)/share/bash-completion/bash_completion"
|
||||
fi
|
||||
{{ end -}}
|
||||
#{{ end -}}
|
||||
|
||||
{{ if lookPath "direnv" -}}
|
||||
#{{ if lookPath "direnv" -}}
|
||||
eval "$(direnv hook bash)"
|
||||
{{ end -}}
|
||||
#{{ end -}}
|
||||
|
||||
{{ if lookPath "erd" -}}
|
||||
#{{ if lookPath "erd" -}}
|
||||
eval "$(erd --completions bash)"
|
||||
{{ end -}}
|
||||
#{{ end -}}
|
||||
|
||||
{{ if lookPath "helm" -}}
|
||||
#{{ if lookPath "helm" -}}
|
||||
source <(helm completion bash)
|
||||
{{ end -}}
|
||||
#{{ end -}}
|
||||
|
||||
{{ if lookPath "kubectl" -}}
|
||||
#{{ if lookPath "kubectl" -}}
|
||||
source <(kubectl completion bash)
|
||||
{{ end -}}
|
||||
#{{ end -}}
|
||||
|
||||
{{ if lookPath "starship" -}}
|
||||
#{{ if lookPath "starship" -}}
|
||||
source <(starship init bash)
|
||||
{{ end -}}
|
||||
#{{ end -}}
|
||||
|
||||
{{ if lookPath "trubka" -}}
|
||||
#{{ if lookPath "trubka" -}}
|
||||
eval "$(trubka --completion-script-bash)"
|
||||
{{ end -}}
|
||||
#{{ end -}}
|
||||
|
||||
|
||||
{{ if lookPath "rbenv" -}}
|
||||
#{{ if lookPath "rbenv" -}}
|
||||
if [ "${RBENV_SHELL}" = "" ]; then
|
||||
eval "$(rbenv init -)"
|
||||
fi
|
||||
{{ end -}}
|
||||
#{{ end -}}
|
||||
|
||||
{{ if and (lookPath "rvm") (stat (joinPath .chezmoi.homeDir ".rvm" "bin") ) -}}
|
||||
#{{ if and (lookPath "rvm") (stat (joinPath .chezmoi.homeDir ".rvm" "bin") ) -}}
|
||||
if [[ ! "${PATH}" =~ ${HOME}/.rvm/bin ]]; then
|
||||
export PATH="$PATH:$HOME/.rvm/bin"
|
||||
fi
|
||||
{{ end -}}
|
||||
|
||||
# vim: filetype=sh
|
||||
#{{ end -}}
|
||||
|
||||
9
dot_config/bash/env.d/base.env.tmpl
Normal file
9
dot_config/bash/env.d/base.env.tmpl
Normal file
@ -0,0 +1,9 @@
|
||||
# chezmoi:template:left-delimiter=#{{
|
||||
#{{- /* vim: filetype=sh */ -}}
|
||||
#shellcheck disable=SC2034
|
||||
HISTTIMEFORMAT='%y-%m-%d %T λ '
|
||||
QUOTING_STYLE=literal
|
||||
#{{- if eq .chezmoi.os "darwin" }}
|
||||
#shellcheck disable=SC2034
|
||||
BASH_SILENCE_DEPRECATION_WARNING=1
|
||||
#{{- end }}
|
||||
@ -1,3 +0,0 @@
|
||||
#shellcheck disable=SC2034
|
||||
HISTTIMEFORMAT='%y-%m-%d %T λ '
|
||||
QUOTING_STYLE=literal
|
||||
@ -1,4 +0,0 @@
|
||||
{{ if eq .chezmoi.os "darwin" -}}
|
||||
#shellcheck disable=SC2034
|
||||
BASH_SILENCE_DEPRECATION_WARNING=1
|
||||
{{- end }}
|
||||
@ -1,6 +1,8 @@
|
||||
{{ if not (lookPath "starship") -}}
|
||||
# chezmoi:template:left-delimiter=#{{
|
||||
#{{- /* vim: filetype=bash */ -}}
|
||||
#{{ if not (lookPath "starship") -}}
|
||||
|
||||
{{ if lookPath "git" -}}
|
||||
#{{ if lookPath "git" -}}
|
||||
_parse_git_status () (
|
||||
if [[ $(git status 2> /dev/null | wc -l) -eq 0 ]]; then
|
||||
return
|
||||
@ -14,7 +16,7 @@ _parse_git_status () (
|
||||
_parse_git_branch () (
|
||||
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'
|
||||
)
|
||||
{{- end }}
|
||||
#{{- end }}
|
||||
|
||||
_create_prompt() (
|
||||
color_off='\e[0m'
|
||||
@ -26,10 +28,10 @@ _create_prompt() (
|
||||
|
||||
|
||||
RET="\[$green\]"'\u '"\[$blue\]"'$(hostname -s | tr ':A-Z:' ':a-z:') '"\[$green\]\w "
|
||||
{{ if lookPath "git" -}}
|
||||
#{{ if lookPath "git" -}}
|
||||
RET="$RET\[$bblack\]"'$(_parse_git_branch)'
|
||||
RET="$RET\[$yellow\]"'$(_parse_git_status) '
|
||||
{{- end }}
|
||||
#{{- end }}
|
||||
|
||||
# display date
|
||||
RET="$RET\[$purple\]\D{%F %I:%M%P} "
|
||||
@ -37,8 +39,5 @@ _create_prompt() (
|
||||
echo "$RET"
|
||||
)
|
||||
|
||||
|
||||
PS1=$(_create_prompt)
|
||||
|
||||
# vim: ft=bash
|
||||
{{- end }}
|
||||
#{{- end }}
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
{{ if lookPath "helm" -}}
|
||||
# chezmoi:template:left-delimiter=#{{
|
||||
#{{- /* vim: filetype=sh */ -}}
|
||||
#{{ if lookPath "helm" -}}
|
||||
eval "$(helm completion fish)"
|
||||
{{- end }}
|
||||
{{ if lookPath "erd" -}}
|
||||
#{{- end }}
|
||||
#{{ if lookPath "erd" -}}
|
||||
eval "$(erd --completions fish)"
|
||||
{{- end }}
|
||||
#{{- end }}
|
||||
|
||||
@ -1,7 +1,10 @@
|
||||
{{ if lookPath "git" -}}
|
||||
# chezmoi:template:left-delimiter=#{{
|
||||
# chezmoi:template:right-delimiter=}}#
|
||||
#{{- /* vim: filetype=gitconfig */ -}}#
|
||||
#{{ if lookPath "git" -}}#
|
||||
[core]
|
||||
editor = vim
|
||||
excludesfile = {{ .chezmoi.homeDir }}/.config/git/ignore
|
||||
excludesfile = #{{ .chezmoi.homeDir }}#/.config/git/ignore
|
||||
quotepath = false
|
||||
commitGraph = true
|
||||
|
||||
@ -72,16 +75,14 @@
|
||||
[url "ssh://git@git.xbudex.com:2022"]
|
||||
insteadOf = https://git.xbudex.com
|
||||
|
||||
{{ if .hellotech -}}
|
||||
#{{ if .hellotech -}}#
|
||||
[url "git@github.com:HelloTech"]
|
||||
insteadOf = https://github.com/HelloTech
|
||||
email = buddy@hellotech.com
|
||||
|
||||
{{ if lookPath "node" -}}
|
||||
#{{ if lookPath "node" -}}#
|
||||
[init]
|
||||
templateDir = {{ .chezmoi.homeDir }}/.config/git/template
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
# vim: filetype=gitconfig
|
||||
{{- end }}
|
||||
templateDir = #{{ .chezmoi.homeDir }}#/.config/git/template
|
||||
#{{- end }}#
|
||||
#{{- end }}#
|
||||
#{{- end }}#
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
{{ if lookPath "git" -}}
|
||||
# chezmoi:template:left-delimiter=#{{
|
||||
#{{- /* vim: filetype=conf */ -}}
|
||||
#{{ if lookPath "git" -}}
|
||||
################################################################################
|
||||
## This global gitignore file is assembled based the github gitignore project:
|
||||
## https://github.com/github/gitignore
|
||||
@ -33,4 +35,4 @@ Desktop.ini
|
||||
|
||||
# Compass/sass ignores
|
||||
.sass-cache
|
||||
{{- end }}
|
||||
#{{- end }}
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
{{ if and .hellotech (lookPath "node") -}}
|
||||
// chezmoi:template:left-delimiter="/*{{"
|
||||
// chezmoi:template:right-delimiter="}}*/"
|
||||
/*{{- /* vim: filetype=javascript */ -}}*/
|
||||
/*{{ if and .hellotech (lookPath "node") -}}*/
|
||||
#!/usr/bin/env node
|
||||
// vim: ft=javascript
|
||||
|
||||
const fs = require("fs");
|
||||
const childProcess = require("child_process");
|
||||
@ -50,4 +52,4 @@ main().catch(err => {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
{{- end }}
|
||||
/*{{- end }}*/
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
{{ if lookPath "i3" -}}
|
||||
# chezmoi:template:left-delimiter=#{{
|
||||
#{{- /* vim: filetype=i3config */ -}}
|
||||
#{{ if lookPath "i3" -}}
|
||||
# This file has been auto-generated by i3-config-wizard(1).
|
||||
# It will not be overwritten, so edit it as you like.
|
||||
#
|
||||
@ -153,4 +155,4 @@ bindsym $mod+Control+l resize grow width 1 px or 1 ppt
|
||||
bar {
|
||||
status_command i3status
|
||||
}
|
||||
{{- end }}
|
||||
#{{- end }}
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
{{ if lookPath "i3status" -}}
|
||||
# chezmoi:template:left-delimiter=#{{
|
||||
#{{- /* vim: filetype=i3config */ -}}
|
||||
#{{ if lookPath "i3status" -}}
|
||||
# i3status configuration file.
|
||||
# see "man i3status" for documentation.
|
||||
|
||||
@ -53,4 +55,4 @@ volume master {
|
||||
mixer = "Master"
|
||||
mixer_idx = 0
|
||||
}
|
||||
{{- end }}
|
||||
#{{- end }}
|
||||
|
||||
@ -1,4 +1,7 @@
|
||||
{{ if lookPath "lf" -}}
|
||||
# chezmoi:template:left-delimiter=#{{
|
||||
# chezmoi:template:right-delimiter=}}#
|
||||
#{{- /* vim: filetype=conf */ -}}#
|
||||
#{{ if lookPath "lf" -}}#
|
||||
set drawbox true
|
||||
set hidden true
|
||||
set icons true
|
||||
@ -24,11 +27,11 @@ map , # find-prev (default ',')
|
||||
|
||||
map o open
|
||||
|
||||
cmd open ${{ "{{" }}
|
||||
cmd open ${{
|
||||
case $(file --mime-type "$f" --brief --dereference) in
|
||||
text/*|application/json) $EDITOR "$f";;
|
||||
video/*|image/*|application/pdf) xdg-open "$f";;
|
||||
*) xdg-open "$f";;
|
||||
esac
|
||||
{{ "}}" }}
|
||||
{{- end }}
|
||||
}}
|
||||
#{{- end }}#
|
||||
|
||||
@ -1,3 +1,6 @@
|
||||
# chezmoi:template:left-delimiter=#{{
|
||||
# chezmoi:template:right-delimiter=}}#
|
||||
#{{- /* vim: filetype=sh */ -}}#
|
||||
#shellcheck disable=SC2034
|
||||
BROWSER=firefox
|
||||
HISTCONTROL=ignoredups:erasedups:ignorespace
|
||||
@ -6,39 +9,37 @@ HISTSIZE=
|
||||
MAN_DIR=${XDG_DATA_HOME}/man/man1
|
||||
PATH=${XDG_BIN_HOME}:${PATH}
|
||||
|
||||
{{- if lookPath "nvim" }}
|
||||
#{{- if lookPath "nvim" }}#
|
||||
EDITOR=nvim
|
||||
{{- else }}
|
||||
#{{- else }}#
|
||||
EDITOR=vim
|
||||
{{- end }}
|
||||
#{{- end }}#
|
||||
|
||||
{{ if lookPath "bat" -}}
|
||||
#{{ if lookPath "bat" -}}#
|
||||
BAT_PAGER=never
|
||||
BAT_STYLE=plain
|
||||
BAT_THEME=zenburn
|
||||
MANPAGER="sh -c 'col -bx | bat -l man -p'"
|
||||
{{ end -}}
|
||||
#{{ end -}}#
|
||||
|
||||
{{ if eq .chezmoi.os "darwin" -}}
|
||||
#{{ if eq .chezmoi.os "darwin" -}}#
|
||||
CLICOLOR=1
|
||||
{{ end -}}
|
||||
#{{ end -}}#
|
||||
|
||||
{{ if .hellotech -}}
|
||||
#{{ if .hellotech -}}#
|
||||
GOPRIVATE=github.com/HelloTech
|
||||
PULUMI_SKIP_UPDATE_CHECK=true
|
||||
{{ end -}}
|
||||
#{{ end -}}#
|
||||
|
||||
{{ if and (lookPath "node") (stat (joinPath .chezmoi.homeDir ".config" "npm" "npmrc")) -}}
|
||||
#{{ if and (lookPath "node") (stat (joinPath .chezmoi.homeDir ".config" "npm" "npmrc")) -}}#
|
||||
NPM_CONFIG_USERCONFIG="${XDG_CONFIG_HOME}/npm/npmrc"
|
||||
{{ end -}}
|
||||
#{{ end -}}#
|
||||
|
||||
{{ if lookPath "rg" -}}
|
||||
#{{ if lookPath "rg" -}}#
|
||||
RIPGREP_CONFIG_PATH="${XDG_CONFIG_HOME}/ripgrep/config"
|
||||
{{ end -}}
|
||||
#{{ end -}}#
|
||||
|
||||
{{ if or (lookPath "vim") (lookPath "nvim") -}}
|
||||
#{{ if or (lookPath "vim") (lookPath "nvim") -}}#
|
||||
VIMINIT='source $XDG_CONFIG_HOME/vim/vimrc'
|
||||
MYVIMRC='$XDG_CONFIG_HOME/vim/vimrc'
|
||||
{{- end }}
|
||||
|
||||
# vim: filetype=sh
|
||||
#{{- end }}#
|
||||
|
||||
@ -1,11 +1,13 @@
|
||||
# chezmoi:template:left-delimiter=#{{
|
||||
#{{- /* vim: filetype=sh -*/ -}}
|
||||
alias ll='ls -alF'
|
||||
alias curl='curl --proto-default https --silent '
|
||||
alias to_lower="tr '[:upper:]' '[:lower:]'"
|
||||
alias to_upper="tr '[:lower:]' '[:upper:]'"
|
||||
|
||||
{{ if lookPath "nvim" -}}
|
||||
#{{ if lookPath "nvim" -}}
|
||||
alias vim=nvim
|
||||
{{- end }}
|
||||
#{{- end }}
|
||||
|
||||
alias node_lts="curl --silent https://nodejs.org/dist/index.tab | cut -f 1,10 | grep -v '-' | head -n 2 | tail -n 1 | cut -f 1"
|
||||
alias node_current="curl --silent https://nodejs.org/dist/index.tab | cut -f 1,10 | grep '-' | head -n 1 | cut -f 1"
|
||||
@ -19,20 +21,18 @@ alias wget-opendir='wget --recursive --level 0 --continue --no-clobber \
|
||||
alias numfiles='find . -maxdepth 1 -type f | wc -l'
|
||||
alias take='sudo chown $(whoami):$(whoami) '
|
||||
|
||||
{{ if and (lookPath "jq") (lookPath "prettier") (lookPath "bat") -}}
|
||||
#{{ if and (lookPath "jq") (lookPath "prettier") (lookPath "bat") -}}
|
||||
alias pretty_json='jq --compact-output | prettier --parser json | bat --language json'
|
||||
{{- end }}
|
||||
#{{- end }}
|
||||
|
||||
{{ if eq .chezmoi.os "linux" -}}
|
||||
#{{ if eq .chezmoi.os "linux" -}}
|
||||
alias ls='ls --color=auto'
|
||||
alias grep='grep --color=auto'
|
||||
alias fgrep='fgrep --color=auto'
|
||||
alias egrep='egrep --color=auto'
|
||||
{{- end }}
|
||||
#{{- end }}
|
||||
|
||||
{{ if lookPath "bat" -}}
|
||||
#{{ if lookPath "bat" -}}
|
||||
alias batdiff='batdiff --pager=""'
|
||||
alias cat=bat
|
||||
{{- end }}
|
||||
|
||||
# vim: filetype=sh
|
||||
#{{- end }}
|
||||
|
||||
@ -1,11 +1,13 @@
|
||||
{{ if lookPath "go" -}}
|
||||
{{ if stat "/usr/local/apps/golang/current/bin" -}}
|
||||
# chezmoi:template:left-delimiter=#{{
|
||||
#{{- /* vim: filetype=sh */ -}}
|
||||
#{{- if lookPath "go" -}}
|
||||
#{{ if stat "/usr/local/apps/golang/current/bin" -}}
|
||||
if [ -d /usr/local/apps/golang/current/bin ] && ! echo "${PATH}" | grep -q /usr/local/apps/golang/current/bin ; then
|
||||
PATH="/usr/local/apps/golang/current/bin:${PATH}"
|
||||
fi
|
||||
{{- end }}
|
||||
#{{- end }}
|
||||
|
||||
if [ -d "${HOME}/go/bin" ] && ! echo "$PATH" | grep -q "${HOME}/go/bin" ; then
|
||||
PATH="${PATH}:${HOME}/go/bin"
|
||||
fi
|
||||
{{- end }}
|
||||
#{{- end }}
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
{{ if .hellotech -}}
|
||||
# chezmoi:template:left-delimiter=#{{
|
||||
#{{- /* vim: filetype=sh */ -}}
|
||||
#{{- if .hellotech -}}
|
||||
|
||||
k8s_last_config () (
|
||||
dasel --read yaml --write json \
|
||||
@ -22,6 +24,4 @@ _add_path "/usr/local/opt/mysql-client/bin"
|
||||
_add_path "${HOME}/google-cloud-sdk/bin"
|
||||
|
||||
unset _add_path
|
||||
|
||||
# vim: filetype=sh
|
||||
{{- end }}
|
||||
#{{- end }}
|
||||
|
||||
@ -1,12 +1,14 @@
|
||||
{{ if lookPath "rbenv" -}}
|
||||
# chezmoi:template:left-delimiter=#{{
|
||||
#{{- /* vim: filetype=sh */ -}}
|
||||
#{{- if lookPath "rbenv" -}}
|
||||
# shellcheck shell=sh
|
||||
|
||||
if [ "${RBENV_SHELL}" = "" ]; then
|
||||
eval "$(rbenv init -)"
|
||||
fi
|
||||
{{- end }}
|
||||
#{{- end }}
|
||||
|
||||
{{ if lookPath "rvm" -}}
|
||||
#{{ if lookPath "rvm" -}}
|
||||
if [ -d "${HOME}/.rvm/bin" ]; then
|
||||
case "${PATH}" in
|
||||
*"$HOME/.rvm/bin"*) ;;
|
||||
@ -21,4 +23,4 @@ if [ "$(ps -p $$ -ocomm=)" = sh ]; then
|
||||
. "$HOME/.rvm/scripts/rvm"
|
||||
fi
|
||||
fi
|
||||
{{- end }}
|
||||
#{{- end }}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{{ if lookPath "cargo" -}}
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# chezmoi:template:left-delimiter=#{{
|
||||
#{{- /* vim: filetype=sh */ -}}
|
||||
#{{- if lookPath "cargo" -}}
|
||||
if [ -f "${HOME}/.cargo/env" ]; then
|
||||
. "${HOME}/.cargo/env"
|
||||
fi
|
||||
{{- end }}
|
||||
#{{- end }}
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
{{ if lookPath "starship" -}}
|
||||
# chezmoi:template:left-delimiter=#{{
|
||||
#{{- /* vim: filetype=toml */ -}}
|
||||
#{{- if lookPath "starship" -}}
|
||||
# Get editor completions based on the config schema
|
||||
"$schema" = 'https://starship.rs/config-schema.json'
|
||||
|
||||
@ -63,4 +65,4 @@ format = "[$duration]($style) "
|
||||
[character]
|
||||
success_symbol = "λ"
|
||||
error_symbol = "[☠](red)"
|
||||
{{- end }}
|
||||
#{{- end }}
|
||||
|
||||
@ -1,12 +1,15 @@
|
||||
{{ if lookPath "podman" -}}
|
||||
# chezmoi:template:left-delimiter=#{{
|
||||
# chezmoi:template:right-delimiter=}}#
|
||||
#{{- /* vim: filetype=systemd */ -}}#
|
||||
#{{- if lookPath "podman" -}}#
|
||||
[Unit]
|
||||
Description=Podman service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart={{ lookPath "podman" }} system service --time 0
|
||||
ExecStart=#{{ lookPath "podman" }}# system service --time 0
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
{{- end }}
|
||||
#{{- end }}#
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
{{ if and (lookPath "tmux") (eq .chezmoi.os "darwin") -}}
|
||||
# chezmoi:template:left-delimiter=#{{
|
||||
#{{- /* vim: filetype=bash */ -}}
|
||||
#{{- if and (lookPath "tmux") (eq .chezmoi.os "darwin") -}}
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [ "$(uname -s)" == "Darwin" ]; then
|
||||
@ -7,4 +9,4 @@ fi
|
||||
|
||||
tmux set default-terminal "tmux-256color"
|
||||
tmux set terminal-overrides ",xterm-256color:Tc"
|
||||
{{- end }}
|
||||
#{{- end }}
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
{{ if lookPath "tmux" -}}
|
||||
# chezmoi:template:left-delimiter="# {{"
|
||||
# {{- /* vim: filetype=tmux */ -}}
|
||||
# {{- if lookPath "tmux" -}}
|
||||
################################################################################
|
||||
# Base configuration
|
||||
################################################################################
|
||||
@ -33,9 +35,9 @@ set-option -g mouse on
|
||||
################################################################################
|
||||
# Colors
|
||||
################################################################################
|
||||
{{ if eq .chezmoi.os "darwin" -}}
|
||||
# {{ if eq .chezmoi.os "darwin" -}}
|
||||
run $XDG_CONFIG_HOME/tmux/plugins/macos-color-workaround
|
||||
{{ end }}
|
||||
# {{ end }}
|
||||
set -g status-fg white
|
||||
set -g status-bg black
|
||||
|
||||
@ -88,4 +90,4 @@ set -g @prefix_highlight_show_sync_mode 'on'
|
||||
set -g @prefix_highlight_sync_mode_attr 'fg=black,bg=green' # default is 'fg=default,bg=yellow'
|
||||
|
||||
run $XDG_CONFIG_HOME/tmux/plugins/tpm/tpm
|
||||
{{- end }}
|
||||
# {{- end }}
|
||||
|
||||
@ -1,11 +1,13 @@
|
||||
{{- if or (eq .chezmoi.os "linux") (eq .chezmoi.os "darwin") -}}
|
||||
# chezmoi:template:left-delimiter=#{{
|
||||
#{{- /* vim: ft=sh */ -}}
|
||||
#{{- if or (eq .chezmoi.os "linux") (eq .chezmoi.os "darwin") -}}
|
||||
# If you want to change or add directories, just edit the line you're
|
||||
# interested in. All local changes will be retained on the next run.
|
||||
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
|
||||
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
|
||||
# absolute path. No other format is supported.
|
||||
|
||||
{{ if eq .chezmoi.os "linux" -}}
|
||||
#{{ if eq .chezmoi.os "linux" -}}
|
||||
XDG_DESKTOP_DIR=$HOME/desktop
|
||||
XDG_DOCUMENTS_DIR=$HOME/documents
|
||||
XDG_DOWNLOAD_DIR=$HOME/downloads
|
||||
@ -15,7 +17,7 @@ XDG_PODCAST_DIR=$HOME/podcasts
|
||||
XDG_PUBLICSHARE_DIR=$HOME/public
|
||||
XDG_TEMPLATES_DIR=$HOME/templates
|
||||
XDG_VIDEOS_DIR=$HOME/videos
|
||||
{{- else if eq .chezmoi.os "darwin" -}}
|
||||
#{{- else if eq .chezmoi.os "darwin" -}}
|
||||
XDG_DESKTOP_DIR=$HOME/Desktop
|
||||
XDG_DOCUMENTS_DIR=$HOME/Documents
|
||||
XDG_DOWNLOAD_DIR=$HOME/Downloads
|
||||
@ -25,5 +27,5 @@ XDG_PODCAST_DIR=$HOME/Podcasts
|
||||
XDG_PUBLICSHARE_DIR=$HOME/Public
|
||||
XDG_TEMPLATES_DIR=$HOME/Templates
|
||||
XDG_VIDEOS_DIR=$HOME/Movies
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
#{{- end }}
|
||||
#{{- end }}
|
||||
|
||||
@ -1,10 +1,12 @@
|
||||
{{ if lookPath "go" -}}
|
||||
# chezmoi:template:left-delimiter="{{
|
||||
"{{- /* vim: filetype=vim */ -}}
|
||||
"{{- if lookPath "go" -}}
|
||||
set noexpandtab
|
||||
|
||||
{{ if lookPath "goimports" -}}
|
||||
"{{ if lookPath "goimports" -}}
|
||||
" use goimports for formatting
|
||||
let g:go_fmt_command = "goimports"
|
||||
{{- end }}
|
||||
"{{- end }}
|
||||
|
||||
" turn highlighting on
|
||||
let g:go_highlight_functions = 1
|
||||
@ -16,6 +18,4 @@ let g:go_highlight_build_constraints = 1
|
||||
" Open go doc in vertical window, horizontal, or tab
|
||||
nnoremap <leader>d :GoDef<CR>
|
||||
nnoremap <leader>t :GoDefType<CR>
|
||||
|
||||
" vim: filetype=vim
|
||||
{{- end }}
|
||||
"{{- end }}
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
{{ if lookPath "rustc" -}}
|
||||
" chezmoi:template:left-delimiter="{{
|
||||
"{{- /* vim: filetype=vim */ -}}
|
||||
"{{- if lookPath "rustc" -}}
|
||||
let g:rustfmt_autosave = 1
|
||||
{{- end }}
|
||||
"{{- end }}
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
{{ if lookPath "fzf" -}}
|
||||
" chezmoi:template:left-delimiter="{{
|
||||
"{{- /* vim: filetype=vim */ -}}
|
||||
"{{- if lookPath "fzf" -}}
|
||||
Plug 'junegunn/fzf', { 'tag': '0.40.0' }
|
||||
Plug 'junegunn/fzf.vim'
|
||||
|
||||
map <leader>fz :GFiles<CR>
|
||||
map <leader>rg :Rg<CR>
|
||||
{{- end }}
|
||||
"{{- end }}
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
{{ if lookPath "go" -}}
|
||||
" chezmoi:template:left-delimiter="{{
|
||||
"{{- /* vim: filetype=vim */ -}}
|
||||
"{{- if lookPath "go" -}}
|
||||
Plug 'fatih/vim-go'
|
||||
{{- end }}
|
||||
"{{- end }}
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
{{ if lookPath "rustc" -}}
|
||||
" chezmoi:template:left-delimiter="{{
|
||||
"{{- /* vim: filetype=vim */ -}}
|
||||
"{{- if lookPath "rustc" -}}
|
||||
Plug 'rust-lang/rust.vim', { 'for': 'rust' }
|
||||
{{- end }}
|
||||
"{{- end }}
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
{{ if lookPath "go" -}}
|
||||
# chezmoi:template:left-delimiter=#{{
|
||||
#{{- /* vim: filetype=snippets */ -}}
|
||||
#{{- if lookPath "go" -}}
|
||||
snippet ignore "ignore function" !
|
||||
func(...any) {}(${1})
|
||||
endsnippet
|
||||
@ -44,4 +46,4 @@ func Test${1}(t *testing.T) {
|
||||
}
|
||||
}
|
||||
endsnippet
|
||||
{{- end }}
|
||||
#{{- end }}
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
# chezmoi:template:left-delimiter=#{{
|
||||
#{{- /* vim: filetype=zsh */ -}}
|
||||
setopt autocd
|
||||
setopt autopushd
|
||||
setopt pushdignoredups
|
||||
@ -30,59 +32,57 @@ zstyle ':completion:*' verbose true
|
||||
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
|
||||
zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd'
|
||||
|
||||
{{ if and (lookPath "dircolors") (eq .chezmoi.os "linux") -}}
|
||||
#{{ if and (lookPath "dircolors") (eq .chezmoi.os "linux") -}}
|
||||
eval "$(dircolors -b)"
|
||||
{{ end -}}
|
||||
#{{ end -}}
|
||||
|
||||
{{- if lookPath "bat" -}}
|
||||
#{{- if lookPath "bat" -}}
|
||||
alias cat=bat
|
||||
{{ end -}}
|
||||
#{{ end -}}
|
||||
|
||||
{{- if lookPath "direnv" -}}
|
||||
#{{- if lookPath "direnv" -}}
|
||||
eval "$(direnv hook zsh)"
|
||||
{{ end -}}
|
||||
#{{ end -}}
|
||||
|
||||
{{- if lookPath "erd" -}}
|
||||
#{{- if lookPath "erd" -}}
|
||||
autoload -Uz compinit
|
||||
compinit
|
||||
eval "$(erd --completions zsh)"
|
||||
{{ end -}}
|
||||
#{{ end -}}
|
||||
|
||||
{{- if lookPath "helm" -}}
|
||||
#{{- if lookPath "helm" -}}
|
||||
# shellcheck disable=SC2148,SC1090
|
||||
autoload -U +X compinit && compinit
|
||||
source <(helm completion zsh)
|
||||
{{ end -}}
|
||||
#{{ end -}}
|
||||
|
||||
{{- if lookPath "kubectl" -}}
|
||||
#{{- if lookPath "kubectl" -}}
|
||||
# shellcheck disable=SC2148,SC1090
|
||||
autoload -U +X compinit && compinit
|
||||
source <(kubectl completion zsh)
|
||||
{{ end -}}
|
||||
#{{ end -}}
|
||||
|
||||
{{- if lookPath "rbenv" -}}
|
||||
#{{- if lookPath "rbenv" -}}
|
||||
if [ "${RBENV_SHELL}" = "" ]; then
|
||||
eval "$(rbenv init -)"
|
||||
fi
|
||||
{{ end -}}
|
||||
#{{ end -}}
|
||||
|
||||
{{- if lookPath "rvm" }}
|
||||
#{{- if lookPath "rvm" }}
|
||||
if [[ -d "${HOME}/.rvm/bin" ]]; then
|
||||
if [[ ! "${PATH}" =~ "${HOME}/.rvm/bin" ]]; then
|
||||
export PATH="$PATH:$HOME/.rvm/bin"
|
||||
fi
|
||||
fi
|
||||
{{ end -}}
|
||||
#{{ end -}}
|
||||
|
||||
{{- if lookPath "starship" -}}
|
||||
#{{- if lookPath "starship" -}}
|
||||
source <(starship init zsh)
|
||||
{{ end -}}
|
||||
#{{ end -}}
|
||||
|
||||
{{- if lookPath "tmux" }}
|
||||
#{{- if lookPath "tmux" }}
|
||||
if [ "$TMUX" ]; then
|
||||
# TERM=tmux-256color does not work as expected on osx
|
||||
export TERM=screen-256color
|
||||
fi
|
||||
{{- end }}
|
||||
|
||||
# vim: filetype=zsh
|
||||
#{{- end }}
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
{{ if lookPath "jq" -}}
|
||||
# chezmoi:template:left-delimiter=#{{
|
||||
#{{- /* vim: filetype=jq */ -}}
|
||||
#{{- if lookPath "jq" -}}
|
||||
def reset: "\u001b[0m";
|
||||
def black: "\u001b[30m";
|
||||
def white: "\u001b[97m";
|
||||
@ -8,4 +10,4 @@ def green: "\u001b[32m";
|
||||
def yellow: "\u001b[33m";
|
||||
def red: "\u001b[31m";
|
||||
def magenta: "\u001b[35m";
|
||||
{{- end }}
|
||||
#{{- end }}
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
{{ if lookPath "jq" -}}
|
||||
# chezmoi:template:left-delimiter=#{{
|
||||
#{{- /* vim: filetype=jq */ -}}
|
||||
#{{- if lookPath "jq" -}}
|
||||
def browser: env.BROWSER;
|
||||
def editor: env.EDITOR;
|
||||
def home: env.HOME;
|
||||
@ -13,4 +15,4 @@ def config: env.XDG_CONFIG_HOME;
|
||||
def data: env.XDG_DATA_HOME;
|
||||
def runtime: env.XDG_RUNTIME_DIR;
|
||||
def state: env.XDG_STATE_HOME;
|
||||
{{- end }}
|
||||
#{{- end }}
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
{{ if lookPath "jq" -}}
|
||||
# chezmoi:template:left-delimiter=#{{
|
||||
#{{- /* vim: filetype=jq */ -}}
|
||||
#{{- if lookPath "jq" -}}
|
||||
def by_time: sort_by(.created_at) | reverse;
|
||||
|
||||
def asset($os; $arch):
|
||||
@ -26,4 +28,4 @@ assets
|
||||
] | join("\n")
|
||||
)
|
||||
";
|
||||
{{- end }}
|
||||
#{{- end }}
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
{{ if and .hellotech (lookPath "jq") -}}
|
||||
# chezmoi:template:left-delimiter=#{{
|
||||
#{{- /* vim: filetype=jq */ -}}
|
||||
#{{- if and .hellotech (lookPath "jq") -}}
|
||||
import "colors" as colors;
|
||||
|
||||
def clean_multierror:
|
||||
@ -76,4 +78,4 @@ def show:
|
||||
"\n" + colors::red + "ERROR" + colors::reset + ": " + _show_error
|
||||
else "" end
|
||||
) + colors::reset;
|
||||
{{- end }}
|
||||
#{{- end }}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user