diff options
| author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-02-03 18:29:31 +0100 | 
|---|---|---|
| committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-02-03 18:29:31 +0100 | 
| commit | 07ad983aebf388065be7d650b7e08204100d1ed4 (patch) | |
| tree | 5a3ae361ea5e84c36a577f385bce308bab0dfee1 | |
| parent | 541d9fa7014c5c197f7c8a09fa159ac84bd9a6a8 (diff) | |
Update shell
*Added alias
*changed mutt to not use symlink
*changed starship looks
*use comp.zsh instead of plugin
*remove git-alias plugin
*added auto rehash
*removed rehash hook
| -rw-r--r-- | config/essentials/shell/aliases.sh | 1 | ||||
| -rw-r--r-- | config/essentials/shell/functions.sh | 6 | ||||
| -rw-r--r-- | config/essentials/starship.toml | 18 | ||||
| -rw-r--r-- | config/essentials/zsh/.zshrc | 19 | ||||
| -rw-r--r-- | config/essentials/zsh/comp.zsh | 103 | 
5 files changed, 71 insertions, 76 deletions
diff --git a/config/essentials/shell/aliases.sh b/config/essentials/shell/aliases.sh index 950cea7..ca9f0dd 100644 --- a/config/essentials/shell/aliases.sh +++ b/config/essentials/shell/aliases.sh @@ -45,6 +45,7 @@ fi  # Programs  alias nb='newsboat' +alias nr='newsraft'  alias sr='surfraw'  alias ccu='calcurse'  alias pf='profanity' diff --git a/config/essentials/shell/functions.sh b/config/essentials/shell/functions.sh index d303fb8..38fae34 100644 --- a/config/essentials/shell/functions.sh +++ b/config/essentials/shell/functions.sh @@ -283,7 +283,7 @@ muttmail()  	config="$HOME/.config/mutt"  	mail="$(find "$config"/configs -type f -printf '%f\n' | fzf)"  	[ "$mail" ] || return 1 -	ln -sf "$config/configs/$mail" "$config"/muttrc +    printf 'source %s\n' "$config"/configs/"$mail" > "$config"/muttrc  	mutt  } @@ -305,3 +305,7 @@ to_webm()  {      ffmpeg -y -i "$1" -vcodec libvpx -cpu-used -12 -deadline realtime "${1%.*}".webm  } +remove_audio() { ffmpeg -i "$1" -cpu-used -$(nproc) -deadline realtime -c copy -an "${2:-out.mp4}"; } +nasg() { smbclient //192.168.178.24/Public/ -D ENFANTS/Luca/tmp -N -c "get $1"; } +trll() { printf "%s +" "$1" | trl 2>/dev/null; } diff --git a/config/essentials/starship.toml b/config/essentials/starship.toml index 5934cca..0a9faaf 100644 --- a/config/essentials/starship.toml +++ b/config/essentials/starship.toml @@ -2,24 +2,22 @@  # Inserts a blank line between shell prompts  add_newline = false -format = '\[$username[@](bold blue)$hostname\] $all' - +format = ' [\[$username@$hostname\]](bg:#000000) $all' +right_format = """$status"""  [character] -success_symbol = "[❯](green)" -error_symbol = "[❮](red)" -vimcmd_symbol = "[❮](green)" +format = ' [❯](bold bright-yellow) '  [username]  style_root = "bold red" -style_user = "bold blue" -format = "[$user]($style)" +style_user = "bold purple" +format = "[$user]($style bg:#000000)"  show_always = true  disabled = false  [hostname]  ssh_only = false -style = "bold teal" +style = "bold cyan bg:#000000"  format = "[$hostname]($style)"  [directory] @@ -28,3 +26,7 @@ style = "bold lavender"  [cmd_duration]  min_time = 500 + +[status] +format = '($status)' +disabled = false diff --git a/config/essentials/zsh/.zshrc b/config/essentials/zsh/.zshrc index f9ca5c3..9b105e6 100644 --- a/config/essentials/zsh/.zshrc +++ b/config/essentials/zsh/.zshrc @@ -22,8 +22,8 @@ zle -N change-surround surround  ### Source files  . $XDG_CONFIG_HOME/shell/functions.sh  . $XDG_CONFIG_HOME/shell/aliases.sh +. $XDG_CONFIG_HOME/zsh/comp.zsh  # . $XDG_CONFIG_HOME/zsh/prompt.zsh -# . $XDG_CONFIG_HOME/zsh/comp.zsh  # . $XDG_CONFIG_HOME/zsh/plugins.zsh  ### Programs @@ -34,11 +34,9 @@ eval "$(zoxide init zsh)"  [ -f "$HOME/.local/share/zap/zap.zsh" ] && source "$HOME/.local/share/zap/zap.zsh"  plug "kutsan/zsh-system-clipboard"  plug "xPMo/zsh-toggle-command-prefix" -plug "zap-zsh/completions"  plug "zap-zsh/vim"  plug "zsh-users/zsh-autosuggestions"  plug "zsh-users/zsh-completions" -plug "chivalryq/git-alias"  plug "zap-zsh/fzf"  plug "zdharma-continuum/fast-syntax-highlighting"  plug "zsh-users/zsh-history-substring-search" @@ -107,21 +105,6 @@ bindkey -M menuselect '^xh' accept-and-hold                # Hold  bindkey -M menuselect '^xn' accept-and-infer-next-history  # Next  bindkey -M menuselect '^xu' undo                           # Undo -### Hooks -## rehash hook -zshcache_time="$(date +%s%N)" -autoload -Uz add-zsh-hook -rehash_precmd() { -  if [[ -a /var/cache/zsh/pacman ]]; then -    local paccache_time="$(date -r /var/cache/zsh/pacman +%s%N)" -    if (( zshcache_time < paccache_time )); then -      rehash -      zshcache_time="$paccache_time" -    fi -  fi -} -## window title hooks -add-zsh-hook -Uz precmd rehash_precmd  set_wt_action () {  	print -n "\e]0;$1\a\033[0m"  } diff --git a/config/essentials/zsh/comp.zsh b/config/essentials/zsh/comp.zsh index 94d76b1..4836111 100644 --- a/config/essentials/zsh/comp.zsh +++ b/config/essentials/zsh/comp.zsh @@ -1,49 +1,54 @@ -# ### Completion - -# autoload -Uz compinit; compinit -# zstyle ':compinstall' filename '/home/aluc/.zshrc' -# # cache -# zstyle ':completion:*' use-cache on -# zstyle ':completion:*' cache-path "$ZDOTDIR/zcompcache" - -# # completers -# zstyle ':completion:*' completer _extensions _complete - -# # format -# zstyle ':completion:*:*:*:*:descriptions' format '%F{blue}-- %D%d --%f' -# zstyle ':completion:*:*:*:*:messages' format '%F{purple}-- %d --%f' -# zstyle ':completion:*:*:*:*:warnings' format '%F{red}-- no matches found --%f' -# zstyle ':completion:*:default' list-prompt '%S%M matches%s' -# # show a 'ls -a' like outptut when listing files -# zstyle ':completion:*:*:*:*:default' list-colors ${(s.:.)LS_COLORS} - -# # Group completions by categories -# zstyle ':completion:*' group-name '' -# zstyle ':completion:*:*:-command-:*:*' group-order aliases builtins functions commands - -# zstyle ':completion:*' squeeze-slashes true - -# # Prefer completing for an option (think cd -) -# zstyle ':completion:*' complete-options true - -# # keep prefix when completing -# zstyle ':completion:*' keep-prefix true - -# # ui -# zstyle ':completion:*' menu select - -# _dotnet_zsh_complete() -# { -#   local completions=("$(dotnet complete "$words")") - -#   # If the completion list is empty, just continue with filename selection -#   if [ -z "$completions" ] -#   then -#     _arguments '*::arguments: _normal' -#     return -#   fi - -#   # This is not a variable assignment, don't remove spaces! -#   _values = "${(ps:\n:)completions}" -# } -# compdef _dotnet_zsh_complete dotnet
\ No newline at end of file +### Completion +# Find most of the stuff at https://github.com/zap-zsh/completions + +zmodload zsh/complist +autoload -Uz compinit; compinit +zstyle ':compinstall' filename '/home/aluc/.zshrc' +# cache +zstyle ':completion:*' use-cache on +zstyle ':completion:*' cache-path "$ZDOTDIR/zcompcache" + +# completers +zstyle ':completion:*' completer _extensions _complete + +# format +zstyle ':completion:*:*:*:*:descriptions' format '%F{blue}-- %D%d --%f' +zstyle ':completion:*:*:*:*:messages' format '%F{purple}-- %d --%f' +zstyle ':completion:*:*:*:*:warnings' format '%F{red}-- no matches found --%f' +zstyle ':completion:*:default' list-prompt '%S%M matches%s' +# show a 'ls -a' like outptut when listing files +zstyle ':completion:*:*:*:*:default' list-colors ${(s.:.)LS_COLORS} + +# automatically find new executables in PATH +zstyle ':completion:*' rehash true + +# Group completions by categories +zstyle ':completion:*' group-name '' +zstyle ':completion:*:*:-command-:*:*' group-order aliases builtins functions commands + +zstyle ':completion:*' squeeze-slashes true + +# Prefer completing for an option (think cd -) +zstyle ':completion:*' complete-options true + +# keep prefix when completing +zstyle ':completion:*' keep-prefix true + +# ui +zstyle ':completion:*' menu select + +_dotnet_zsh_complete() +{ +  local completions=("$(dotnet complete "$words")") + +  # If the completion list is empty, just continue with filename selection +  if [ -z "$completions" ] +  then +    _arguments '*::arguments: _normal' +    return +  fi + +  # This is not a variable assignment, don't remove spaces! +  _values = "${(ps:\n:)completions}" +} +compdef _dotnet_zsh_complete dotnet  | 
