From 209599e6ee218ad336f48cf5a4a400af6ce0003e Mon Sep 17 00:00:00 2001 From: Ryan Date: Wed, 6 Mar 2024 19:10:18 +0800 Subject: [PATCH 1/3] feat(shell): try nu --- .bashrc | 4 ++-- .config/nvim | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.bashrc b/.bashrc index 71b7799..1114f0c 100644 --- a/.bashrc +++ b/.bashrc @@ -18,6 +18,6 @@ fi # Put your fun stuff here. # https://wiki.gentoo.org/wiki/Fish#fish_as_a_default_shell_with_bash_as_the_login_shell -# Use fish in place of bash +# Use nu in place of bash # keep this line at the bottom of ~/.bashrc -[ -x /bin/fish ] && SHELL=/bin/fish exec fish +[ -x /bin/nu ] && SHELL=/bin/nu exec nu diff --git a/.config/nvim b/.config/nvim index 2c98923..fd3bdba 160000 --- a/.config/nvim +++ b/.config/nvim @@ -1 +1 @@ -Subproject commit 2c98923861d2954c646f764bf68a56c408c32d2e +Subproject commit fd3bdba06fa3bffe1f3465ef6963606e71ba5ff4 From 135b1e7f88dc1836d402ae8f65b03eb1b960aa79 Mon Sep 17 00:00:00 2001 From: Ryan Date: Wed, 6 Mar 2024 19:58:57 +0800 Subject: [PATCH 2/3] feat(shell): change back to zsh --- .bashrc | 2 +- .config/kitty/kitty.conf | 1 + .config/sway/conf.d/keybinds | 2 +- .zshrc | 10 +--------- 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/.bashrc b/.bashrc index 1114f0c..ff5cfd0 100644 --- a/.bashrc +++ b/.bashrc @@ -20,4 +20,4 @@ fi # https://wiki.gentoo.org/wiki/Fish#fish_as_a_default_shell_with_bash_as_the_login_shell # Use nu in place of bash # keep this line at the bottom of ~/.bashrc -[ -x /bin/nu ] && SHELL=/bin/nu exec nu +# [ -x /bin/nu ] && SHELL=/bin/nu exec nu diff --git a/.config/kitty/kitty.conf b/.config/kitty/kitty.conf index 4abed9f..7cbbef7 100644 --- a/.config/kitty/kitty.conf +++ b/.config/kitty/kitty.conf @@ -7,6 +7,7 @@ bold_italic_font Iosevka Term SS15 Bold Italic font_size 14 # shell stuff + shell_integration enabled enable_audio_bell no diff --git a/.config/sway/conf.d/keybinds b/.config/sway/conf.d/keybinds index 103aeef..0440279 100644 --- a/.config/sway/conf.d/keybinds +++ b/.config/sway/conf.d/keybinds @@ -5,7 +5,7 @@ set $left h set $down j set $up k set $right l -set $term kitty -1 /bin/fish +set $term kitty -1 set $menu fuzzel # my keybinds diff --git a/.zshrc b/.zshrc index 055b022..0fa09fe 100644 --- a/.zshrc +++ b/.zshrc @@ -24,8 +24,7 @@ zinit wait lucid for \ agkozak/zsh-z \ zpm-zsh/colors \ zpm-zsh/colorize \ - rywng/shortify.zsh \ - rywng/kitty-zsh + rywng/shortify.zsh zinit ice wait lucid atinit"bindkey '' autosuggest-execute" atload'_zsh_autosuggest_start' zinit light zsh-users/zsh-autosuggestions @@ -34,7 +33,6 @@ zinit ice wait lucid zinit load hlissner/zsh-autopair zinit light zsh-users/zsh-completions -zinit light zsh-users/zsh-history-substring-search # Software if ! command -v bat &> /dev/null ; then @@ -105,11 +103,6 @@ bindkey -M menuselect 'k' vi-up-line-or-history bindkey -M menuselect 'l' vi-forward-char bindkey -M menuselect 'j' vi-down-line-or-history -bindkey '^[[A' history-substring-search-up -bindkey '^[[B' history-substring-search-down -bindkey '' history-substring-search-up -bindkey '' history-substring-search-down - bindkey ' ' magic-space # config & cache location @@ -125,7 +118,6 @@ export ZSHZ_DATA=$HOME/.cache/z export BAT_THEME="base16" export FZF_DEFAULT_OPTS="--reverse --cycle --height=40% --border sharp --prompt=🔎" export GPG_TTY=$(tty) # fixes gpg -export HISTORY_SUBSTRING_SEARCH_FUZZY=1 export MANROFFOPT="-c" export MANWIDTH=${MANWIDTH:-78} export SSH_AUTH_SOCK=$XDG_RUNTIME_DIR/ssh-agent.socket From 5a86871551ae82ec32644f5a6d309a4df1d3474f Mon Sep 17 00:00:00 2001 From: Ryan Date: Wed, 6 Mar 2024 21:30:43 +0800 Subject: [PATCH 3/3] feat(shell): change bindings, and zsh settings --- .config/sway/scripts/logout.sh | 2 +- .zshrc | 41 +++++++++++++++++++--------------- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/.config/sway/scripts/logout.sh b/.config/sway/scripts/logout.sh index 742231c..9fdc9a0 100755 --- a/.config/sway/scripts/logout.sh +++ b/.config/sway/scripts/logout.sh @@ -9,7 +9,7 @@ if [[ ! $(which swayidle 2> /dev/null) ]]; then fi choices=("suspend" "poweroff" "reboot" "lock") -choice=$(printf "%s\n" "${choices[@]}" | fuzzel -d --prompt "󰚥: ") +choice=$(printf "%s\n" "${choices[@]}" | fuzzel -d --prompt "🔌: ") if test "$choice" = lock ; then diff --git a/.zshrc b/.zshrc index 0fa09fe..849dc6e 100644 --- a/.zshrc +++ b/.zshrc @@ -26,13 +26,11 @@ zinit wait lucid for \ zpm-zsh/colorize \ rywng/shortify.zsh -zinit ice wait lucid atinit"bindkey '' autosuggest-execute" atload'_zsh_autosuggest_start' +zinit ice wait lucid atinit"bindkey '^ ' autosuggest-execute" atload'_zsh_autosuggest_start' zinit light zsh-users/zsh-autosuggestions -zinit ice wait lucid -zinit load hlissner/zsh-autopair - zinit light zsh-users/zsh-completions +zinit light zsh-users/zsh-history-substring-search # Software if ! command -v bat &> /dev/null ; then @@ -40,13 +38,16 @@ if ! command -v bat &> /dev/null ; then zinit light sharkdp/bat fi -zinit ice from"gh-r" as"program" mv"direnv* -> direnv" -zinit light direnv/direnv +if ! command -v direnv &> /dev/null; then + zinit ice from"gh-r" as"program" mv"direnv* -> direnv" + zinit light direnv/direnv +fi autoload -Uz _zinit (( ${+_comps} )) && _comps[zinit]=_zinit test -n "$LS_COLORS" || eval $(dircolors) || echo 'Warning: Unable to set LS_COLORS' + # The following lines were added by compinstall zstyle ':completion:*' auto-description '%F{green}Specify%f: %F{cyan}%d%f' @@ -57,20 +58,19 @@ zstyle ':completion:*' file-sort name zstyle ':completion:*' format '%F{green}Completing%f %F{yellow}%d%f' zstyle ':completion:*' glob 1 zstyle ':completion:*' group-name '' -zstyle ':completion:*' ignore-parents parent pwd .. +zstyle ':completion:*' ignore-parents parent pwd .. directory zstyle ':completion:*' insert-unambiguous true zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} -zstyle ':completion:*' list-prompt %S%F{green}At %p%f: Hit TAB for more, or the character to insert%s -zstyle ':completion:*' matcher-list '' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'r:|[._-]=** r:|=**' 'l:|=* r:|=*' -zstyle ':completion:*' max-errors 16 numeric +zstyle ':completion:*' matcher-list '' 'm:{[:lower:]}={[:upper:]}' 'r:|[._-]=** r:|=**' 'l:|=* r:|=*' +zstyle ':completion:*' max-errors 2 zstyle ':completion:*' menu select=1 zstyle ':completion:*' original false zstyle ':completion:*' preserve-prefix '//[^/]##/' zstyle ':completion:*' prompt '%F{green}Completing%f, with %F{red}%e%f errors' -zstyle ':completion:*' select-prompt %S%F{green}Scrolling%f active: current selection at %F{blue}%p%f%s -zstyle ':completion:*' substitute 1 -zstyle ':completion:*' use-compctl true -zstyle :compinstall filename ~/.zshrc +zstyle ':completion:*' select-prompt '%S%F{green}Scrolling%f active: current selection at %F{blue}%p%f%s' +zstyle ':completion:*' substitute 0 +zstyle ':completion:*' verbose true +zstyle :compinstall filename '/home/ryan/.zshrc' autoload -Uz compinit compinit @@ -79,8 +79,8 @@ compinit HISTFILE=~/.cache/zhistory HISTSIZE=8192 SAVEHIST=8192 -setopt autocd extendedglob nomatch notify auto_pushd -unsetopt beep +setopt autocd autopushd extendedglob nomatch +unsetopt beep notify bindkey -e # End of lines configured by zsh-newuser-install @@ -103,6 +103,11 @@ bindkey -M menuselect 'k' vi-up-line-or-history bindkey -M menuselect 'l' vi-forward-char bindkey -M menuselect 'j' vi-down-line-or-history +bindkey '^[[A' history-substring-search-up +bindkey '^[[B' history-substring-search-down +bindkey '^P' history-substring-search-up +bindkey '^N' history-substring-search-down + bindkey ' ' magic-space # config & cache location @@ -118,14 +123,14 @@ export ZSHZ_DATA=$HOME/.cache/z export BAT_THEME="base16" export FZF_DEFAULT_OPTS="--reverse --cycle --height=40% --border sharp --prompt=🔎" export GPG_TTY=$(tty) # fixes gpg +export LESS="-i $LESS" export MANROFFOPT="-c" export MANWIDTH=${MANWIDTH:-78} export SSH_AUTH_SOCK=$XDG_RUNTIME_DIR/ssh-agent.socket # local path export MANPATH="${MANPATH}:${HOME}/.local/share/man" -export PATH="${PATH}:${HOME}/.local/bin:${HOME}/.scripts:${HOME}/cargo/bin:${HOME}/.cache/go/bin:${HOME}/.local/share/nvim/mason/bin" +export PATH="${PATH}:${HOME}/.local/bin:${HOME}/.scripts:${HOME}/.cache/go/bin:${HOME}/.local/share/nvim/mason/bin" # ccache support export PATH="/usr/lib/ccache/bin${PATH:+:}$PATH" -export USE_CCACHE=1