Shellcheck compliance.
This commit is contained in:
parent
689a752a94
commit
58ed90e705
@ -1,3 +1,5 @@
|
|||||||
|
#shellcheck disable=SC2034
|
||||||
|
|
||||||
skip_global_compinit=1
|
skip_global_compinit=1
|
||||||
export XDG_CACHE_HOME=/tmp/${USER}-cache
|
export XDG_CACHE_HOME=/tmp/${USER}-cache
|
||||||
export XDG_CONFIG_HOME=$HOME/.config
|
export XDG_CONFIG_HOME=$HOME/.config
|
||||||
|
@ -1,12 +1,14 @@
|
|||||||
|
# shellcheck disable=SC1091,SC1094,SC2206,SC2148
|
||||||
|
|
||||||
# macOS specific
|
# macOS specific
|
||||||
if [[ $(uname -s) = "Darwin" ]]; then
|
if [[ $(uname -s) = "Darwin" ]]; then
|
||||||
eval "$(/opt/homebrew/bin/brew shellenv)"
|
eval "$(/opt/homebrew/bin/brew shellenv)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# prepare directories
|
# prepare directories
|
||||||
touch $HOME/.hushlogin
|
touch "${HOME}/.hushlogin"
|
||||||
mkdir -p $XDG_CACHE_HOME/zsh
|
mkdir -p "${XDG_CACHE_HOME}/zsh"
|
||||||
mkdir -p $XDG_DATA_HOME/zsh
|
mkdir -p "${XDG_DATA_HOME}/zsh"
|
||||||
|
|
||||||
# global exports and options
|
# global exports and options
|
||||||
setopt HIST_IGNORE_ALL_DUPS
|
setopt HIST_IGNORE_ALL_DUPS
|
||||||
@ -14,34 +16,35 @@ setopt HIST_SAVE_NO_DUPS
|
|||||||
setopt HIST_REDUCE_BLANKS
|
setopt HIST_REDUCE_BLANKS
|
||||||
setopt SHARE_HISTORY
|
setopt SHARE_HISTORY
|
||||||
setopt INC_APPEND_HISTORY
|
setopt INC_APPEND_HISTORY
|
||||||
rm $ZDOTDIR/.zsh_history && ln -sf $XDG_DATA_HOME/zsh/history $ZDOTDIR/.zsh_history
|
rm "${ZDOTDIR}/.zsh_history" && ln -sf "${XDG_DATA_HOME}/zsh/history" "${ZDOTDIR}/.zsh_history"
|
||||||
|
|
||||||
# set path
|
# set path
|
||||||
path=(~/.local/bin "${path[@]}")
|
path=(~/.local/bin "${path[@]}")
|
||||||
|
|
||||||
# source configuration
|
# source configuration
|
||||||
source $ZDOTDIR/aliases.zsh
|
source "${ZDOTDIR}/aliases.zsh"
|
||||||
source $ZDOTDIR/cleanhome.zsh
|
source "${ZDOTDIR}/cleanhome.zsh"
|
||||||
source $ZDOTDIR/keys.zsh
|
source "${ZDOTDIR}/keys.zsh"
|
||||||
## it has to be last
|
## it has to be last
|
||||||
source $ZDOTDIR/fzf.zsh
|
source "${ZDOTDIR}/fzf.zsh"
|
||||||
|
|
||||||
# source modules
|
# source modules
|
||||||
source $HOME/.local/git/zsh_modules/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh
|
source "${HOME}/.local/git/zsh_modules/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh"
|
||||||
source $HOME/.local/git/zsh_modules/wd/wd.plugin.zsh
|
source "${HOME}/.local/git/zsh_modules/wd/wd.plugin.zsh"
|
||||||
export WD_CONFIG=$XDG_CONFIG_HOME/wd_list
|
export WD_CONFIG="${XDG_CONFIG_HOME}/wd_list"
|
||||||
|
|
||||||
# set fpath
|
# set fpath
|
||||||
fpath=(~/.local/git/zsh_modules/wd $fpath)
|
fpath=(~/.local/git/zsh_modules/wd $fpath)
|
||||||
|
|
||||||
# theme and colors
|
# theme and colors
|
||||||
if [[ $(command -v vivid) ]]; then
|
if [[ $(command -v vivid) ]]; then
|
||||||
export LS_COLORS=$(vivid generate molokai)
|
LS_COLORS=$(vivid generate molokai)
|
||||||
|
export LS_COLORS
|
||||||
else
|
else
|
||||||
unset LS_COLORS
|
unset LS_COLORS
|
||||||
fi
|
fi
|
||||||
if [ "$TERM_PROGRAM" != "Apple_Terminal" ]; then
|
if [ "$TERM_PROGRAM" != "Apple_Terminal" ]; then
|
||||||
eval "$(oh-my-posh --config ${XDG_CONFIG_HOME}/omp/omp.toml init zsh)"
|
eval "$(oh-my-posh --config "${XDG_CONFIG_HOME}/omp/omp.toml" init zsh)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# completion
|
# completion
|
||||||
@ -49,23 +52,20 @@ zstyle ':completion:*' menu select
|
|||||||
zstyle ':completion:*' list-colors ''
|
zstyle ':completion:*' list-colors ''
|
||||||
|
|
||||||
autoload -Uz compinit
|
autoload -Uz compinit
|
||||||
if [ ! -e $XDG_DATA_HOME/zsh/zcompdump.zwc ]; then
|
if [ ! -e "${XDG_DATA_HOME}/zsh/zcompdump.zwc" ]; then
|
||||||
autoload -Uz zrecompile
|
autoload -Uz zrecompile
|
||||||
zrecompile -p -R $XDG_DATA_HOME/zsh/zcompdump
|
zrecompile -p -R "${XDG_DATA_HOME}/zsh/zcompdump"
|
||||||
fi
|
fi
|
||||||
compinit -C -d $XDG_DATA_HOME/zsh/zcompdump
|
compinit -C -d "${XDG_DATA_HOME}/zsh/zcompdump"
|
||||||
|
|
||||||
# quick note functionality
|
# quick note functionality
|
||||||
if [[ -f ~/.note ]]; then
|
if [[ -f "${HOME}/.note" ]]; then
|
||||||
echo
|
echo
|
||||||
cat ~/.note
|
cat "${HOME}/.note"
|
||||||
echo
|
echo
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# cleaning
|
|
||||||
rm -rf ~/.warprc
|
|
||||||
|
|
||||||
# local settings
|
# local settings
|
||||||
if [[ -f $HOME/.local/config/zsh ]]; then
|
if [[ -f "${HOME}/.local/config/zsh" ]]; then
|
||||||
source $HOME/.local/config/zsh
|
source "${HOME}/.local/config/zsh"
|
||||||
fi
|
fi
|
||||||
|
@ -61,7 +61,7 @@ fi
|
|||||||
|
|
||||||
function ud() {
|
function ud() {
|
||||||
for i in ${LOCAL_GIT_DIR}/dotfiles ${LOCAL_GIT_DIR}/zsh_modules/*; do git -C ${i} pull; done
|
for i in ${LOCAL_GIT_DIR}/dotfiles ${LOCAL_GIT_DIR}/zsh_modules/*; do git -C ${i} pull; done
|
||||||
. ${LOCAL_GIT_DIR}/dotfiles/scripts/post-update.sh
|
. "${LOCAL_GIT_DIR}/dotfiles/scripts/post-update.sh"
|
||||||
}
|
}
|
||||||
|
|
||||||
function upgrade() {
|
function upgrade() {
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
export GNUPGHOME="$XDG_DATA_HOME/gnupg"
|
export GNUPGHOME="${XDG_DATA_HOME}/gnupg"
|
||||||
export LESSHISTFILE='/dev/null'
|
export LESSHISTFILE='/dev/null'
|
||||||
|
@ -9,12 +9,12 @@ if [[ $(command -v fzf) ]]; then
|
|||||||
--border=none --preview=sharp --layout=reverse
|
--border=none --preview=sharp --layout=reverse
|
||||||
--prompt="> " --marker=">" --separator="" --scrollbar="│"
|
--prompt="> " --marker=">" --separator="" --scrollbar="│"
|
||||||
'
|
'
|
||||||
export FZF_DEFAULT_OPTS=$FZF_COLORS" --multi -e --ansi --preview='bat --color=always --tabs=2 --style=plain --theme=Monokai\ Extended\ Bright {}'"
|
export FZF_DEFAULT_OPTS=${FZF_COLORS}" --multi -e --ansi --preview='bat --color=always --tabs=2 --style=plain --theme=Monokai\ Extended\ Bright {}'"
|
||||||
export FZF_CTRL_R_OPTS=$FZF_COLORS" -e --ansi --preview=''"
|
export FZF_CTRL_R_OPTS=${FZF_COLORS}" -e --ansi --preview=''"
|
||||||
_fzf_compgen_path() {
|
_fzf_compgen_path() {
|
||||||
fd -H -L --ignore-file ~/.local/config/fd . "$1"
|
fd -H -L --ignore-file "${HOME}/.local/config/fd" . "$1"
|
||||||
}
|
}
|
||||||
_fzf_compgen_dir() {
|
_fzf_compgen_dir() {
|
||||||
fd -H -L --ignore-file ~/.local/config/fd --type d . "$1"
|
fd -H -L --ignore-file "${HOME}/.local/config/fd" --type d . "$1"
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# basic git configuration
|
# basic git configuration
|
||||||
if [[ ! -d ${XDG_CONFIG_HOME}/git ]]; then
|
if [ ! -d "${XDG_CONFIG_HOME}/git" ]; then
|
||||||
mkdir -p ${XDG_CONFIG_HOME}/git
|
mkdir -p "${XDG_CONFIG_HOME}/git"
|
||||||
cat << EOF > ${XDG_CONFIG_HOME}/git/config
|
cat << EOF > "${XDG_CONFIG_HOME}/git/config"
|
||||||
[pull]
|
[pull]
|
||||||
rebase = true
|
rebase = true
|
||||||
EOF
|
EOF
|
||||||
|
Loading…
Reference in New Issue
Block a user