Compare commits

...

1 Commits

Author SHA1 Message Date
svxf
c643f0b719 fix: use zsh idioms and quote variables in shell config
- Use [[ ]] instead of [ ] for conditionals (zsh idiom)
- Quote variable expansions in ZINIT_HOME checks and dirname call
- Quote dollar-1 in mkcd function
- Remove extra blank line in .vimrc

Nightshift-Task: lint-fix
Nightshift-Ref: https://github.com/marcus/nightshift
2026-03-03 22:05:32 +00:00
2 changed files with 4 additions and 5 deletions

1
.vimrc
View File

@@ -24,7 +24,6 @@ set backupdir=~/.vim/backup//
set nobackup set nobackup
set mouse=a " mouse support set mouse=a " mouse support
noremap <Up> <NOP> noremap <Up> <NOP>
noremap <Down> <NOP> noremap <Down> <NOP>
noremap <Left> <NOP> noremap <Left> <NOP>

8
.zshrc
View File

@@ -36,8 +36,8 @@ zmodload zsh/stat
# plugin manager # plugin manager
ZINIT_HOME="${XDG_DATA_HOME:-${HOME}}/.zinit.git" ZINIT_HOME="${XDG_DATA_HOME:-${HOME}}/.zinit.git"
[ ! -d $ZINIT_HOME ] && mkdir -p "$(dirname $ZINIT_HOME)" [[ ! -d "$ZINIT_HOME" ]] && mkdir -p "$(dirname "$ZINIT_HOME")"
[ ! -d $ZINIT_HOME/.git ] && git clone https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME" [[ ! -d "$ZINIT_HOME/.git" ]] && git clone https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME"
source "${ZINIT_HOME}/zinit.zsh" source "${ZINIT_HOME}/zinit.zsh"
zinit light zsh-users/zsh-autosuggestions zinit light zsh-users/zsh-autosuggestions
@@ -158,7 +158,7 @@ function y() {
local tmp="$(mktemp -t "yazi-cwd.XXXXXX")" cwd local tmp="$(mktemp -t "yazi-cwd.XXXXXX")" cwd
command yazi "$@" --cwd-file="$tmp" command yazi "$@" --cwd-file="$tmp"
IFS= read -r -d '' cwd < "$tmp" IFS= read -r -d '' cwd < "$tmp"
[ "$cwd" != "$PWD" ] && [ -d "$cwd" ] && builtin cd -- "$cwd" [[ "$cwd" != "$PWD" ]] && [[ -d "$cwd" ]] && builtin cd -- "$cwd"
rm -f -- "$tmp" rm -f -- "$tmp"
} }
@@ -179,7 +179,7 @@ function clip {
function mkcd { function mkcd {
: "${1:?where?}" : "${1:?where?}"
[[ -e $1 ]] && { echo "file exists"; return 1 } [[ -e $1 ]] && { echo "file exists"; return 1 }
mkdir -p $1 && cd $1 mkdir -p "$1" && cd "$1"
} }
function cdtmp { function cdtmp {