diff --git a/.config/glow/glow.yaml b/.config/glow/glow.yaml index ce719f3..30de003 100644 --- a/.config/glow/glow.yaml +++ b/.config/glow/glow.yaml @@ -1,3 +1,5 @@ +# ~/.config/glow/glow.yaml +# ln -sf $DOTFILES/glow/glow.yaml ~/.config/glow/glow.yaml # style name or JSON path (default "auto") style: "auto" # mouse support (TUI-mode only) diff --git a/wsl/.zshrc b/wsl/.zshrc index ac09f6f..53874e4 100644 --- a/wsl/.zshrc +++ b/wsl/.zshrc @@ -2,10 +2,12 @@ # ln -s $DOTFILES/wsl/.zshrc $XDG_CONFIG_HOME/zsh/.zshrc ### Variables ### +export IS_WSL=true export DOTFILES="$HOME/.dotfiles" for file in $DOTFILES/zsh/*.zsh; do source $file done +source $DOTFILES/wsl/winterop.zsh export ARCHFLAGS="-arch x86_64" # Absolute navigation @@ -77,4 +79,4 @@ export VCPKG_ROOT=~/vcpkg alias pac="sudo pacman" alias paci="sudo pacman -S" alias pacr="sudo pacman -R" -alias pacu="sudo pacman -Ss" +alias pacu="sudo pacman -Syu" diff --git a/wsl/winterop.zsh b/wsl/winterop.zsh new file mode 100644 index 0000000..50e780a --- /dev/null +++ b/wsl/winterop.zsh @@ -0,0 +1,15 @@ +alias clip="clip.exe" +alias xclip="clip.exe" +alias paste='pwsh.exe -NoProfile -Command "Get-Clipboard"' +alias dark-mode='pwsh.exe -Command "dark-mode" 2>&1 /dev/null' +alias winfetch='pwsh.exe -NoProfile -Command "winfetch"' +alias psw="tasklist.exe" +alias killw="taskkill.exe" +alias shutdownw="shutdown.exe /s /t 0" +alias rebootw="shutdown.exe /r /t 0" +alias ipconfig="ipconfig.exe" +alias netstatw="netstat.exe" +alias diskpart="diskpart.exe" +alias winget="winget.exe" +alias pastew='pwsh.exe -NoProfile -Command "Get-Clipboard"' +alias ollama="ollama.exe" diff --git a/zsh/config.zsh b/zsh/config.zsh index 3beb84a..4c1e78b 100644 --- a/zsh/config.zsh +++ b/zsh/config.zsh @@ -6,8 +6,12 @@ HIST_STAMPS="yyyy-mm-dd" # Plugins (Manually Managed) # # $ZDOTDIR/plugins -source $ZDOTDIR/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +# echo "[DEBUG] Loading plugins..." +# echo $ZDOTDIR +# Load zsh-syntax-highlighting before zsh-history-substring-search +# Reference: https://github.com/zsh-users/zsh-history-substring-search?tab=readme-ov-file#usage source $ZDOTDIR/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh +source $ZDOTDIR/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh source $ZDOTDIR/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh # Tools Related Environment Variables # @@ -65,6 +69,10 @@ alias wget='wget --hsts-file="$XDG_CACHE_HOME/wget-hsts"' # ~/.z -> $XDG_DATA_HOME/z export _Z_DATA="$XDG_DATA_HOME/z" # ~/.zcompdump* -> $XDG_CACHE_HOME/zsh/zcompdump* -compinit -d "$XDG_CACHE_HOME"/zsh/zcompdump-"$ZSH_VERSION" +# compinit -d "$XDG_CACHE_HOME"/zsh/zcompdump-"$ZSH_VERSION" # ~/.zsh_history -> $XDG_STATE_HOME/zsh/history export HISTFILE="$XDG_STATE_HOME"/zsh/history + +# https://unix.stackexchange.com/questions/33994/ +# Use `set -k` to mark leading `#` as a comment character +set -k diff --git a/zsh/keymap.zsh b/zsh/keymap.zsh index 32cceb0..9b2e537 100644 --- a/zsh/keymap.zsh +++ b/zsh/keymap.zsh @@ -3,9 +3,9 @@ bindkey -v # Vi Keybindings # Colemak hnei # bindkey -M vicmd 'h' vi-backward-char # No change -bindkey -M vicmd 'n' down-line-or-history -bindkey -M vicmd 'e' up-line-or-history -bindkey -M vicmd 'i' vi-forward-char +bindkey -M vicmd 'n' down-line-or-history +bindkey -M vicmd 'e' up-line-or-history +bindkey -M vicmd 'i' vi-forward-char # Similar position to [i] in QWERTY bindkey -M vicmd 'l' vi-insert @@ -17,4 +17,7 @@ bindkey -M vicmd 'K' vi-rev-repeat-search bindkey -M vicmd 'j' vi-forward-word-end bindkey -M vicmd 'J' vi-forward-blank-word-end # Use N to Join -bindkey -M vicmd 'N' vi-join \ No newline at end of file +bindkey -M vicmd 'N' vi-join + +# Search History with [r]everse (default emacs keybinding) +bindkey '^R' history-incremental-search-backward diff --git a/zsh/navi.zsh b/zsh/navi.zsh index 27e008f..e74d95c 100644 --- a/zsh/navi.zsh +++ b/zsh/navi.zsh @@ -6,4 +6,6 @@ alias ....="cd ../../.." alias .....="cd ../../../.." alias ......="cd ../../../../.." -eval "$(zoxide init zsh)" \ No newline at end of file +function - { cd - } + +eval "$(zoxide init zsh)"