feat(zsh): Finished reorganise zsh with a same entry point for all platforms

This commit is contained in:
js0ny 2024-11-30 01:29:47 +00:00
parent bd5ca49c3e
commit 2b21b63a13
22 changed files with 503 additions and 369 deletions

View file

@ -1,3 +1,10 @@
# $DOTFILES/platforms/wsl/winterop.zsh
# Sourced by $DOTFILES/platforms/wsl/zshrc 在 $DOTFILES/platforms/wsl/zshrc 中被引用
# Defines the interop commands between WSL and Windows
export FILE_EXPLORER="dopus.exe" # Directory Opus
alias clip="clip.exe"
alias xclip="clip.exe"
alias paste='pwsh.exe -NoProfile -Command "Get-Clipboard"'
@ -13,3 +20,14 @@ alias diskpart="diskpart.exe"
alias winget="winget.exe"
alias pastew='pwsh.exe -NoProfile -Command "Get-Clipboard"'
alias ollama="ollama.exe"
# WSL open
open() {
local target=$1
if command -v "$FILE_EXPLORER" > /dev/null; then
"$FILE_EXPLORER" "$target"
else
command open "$target"
fi
}