From 3b241ae86af7c0d3a5844cb1c61b6676c423d3e3 Mon Sep 17 00:00:00 2001 From: Yessiest Date: Sat, 9 Apr 2022 12:54:43 +0400 Subject: [PATCH] Fixed 01-local-bins.zsh --- 00-ls_colors.zsh | 11 +++++++++++ 01-local-bin.zsh | 8 ++++++++ 02-aliases.zsh | 28 ++++++++++++++++++++++++++++ 03-completion.zsh | 19 +++++++++++++++++++ 04-bindings.zsh | 8 ++++++++ 5 files changed, 74 insertions(+) create mode 100644 00-ls_colors.zsh create mode 100644 01-local-bin.zsh create mode 100644 02-aliases.zsh create mode 100644 03-completion.zsh create mode 100644 04-bindings.zsh diff --git a/00-ls_colors.zsh b/00-ls_colors.zsh new file mode 100644 index 0000000..c56cd88 --- /dev/null +++ b/00-ls_colors.zsh @@ -0,0 +1,11 @@ +LS_COLORS="di=01;34" #directory color +LS_COLORS=$LS_COLORS":ln=01;36" #link color +LS_COLORS=$LS_COLORS":so=01;35" #socket color +LS_COLORS=$LS_COLORS":pi=40;33" #pipe color +LS_COLORS=$LS_COLORS":ex=32" #executable color +LS_COLORS=$LS_COLORS":bd=40;33" #block device color +LS_COLORS=$LS_COLORS":cd=40;33;01" #char device color +LS_COLORS=$LS_COLORS":su=37;41" #setuid executable color (i.e. sudo) +LS_COLORS=$LS_COLORS":sg=30;43" #setgid executable color +export LS_COLORS +alias ls="ls --color" diff --git a/01-local-bin.zsh b/01-local-bin.zsh new file mode 100644 index 0000000..d318f71 --- /dev/null +++ b/01-local-bin.zsh @@ -0,0 +1,8 @@ +declare -a LOCAL_BINS +LOCAL_BINS=( "$HOME/.local/bin" "$HOME/Projects/env/bin" "/usr/local/bin" "/usr/local/sbin" ) +for bin in $LOCAL_BINS; do + if [ -e $bin ]; then + PATH="$PATH:$bin" + fi +done +export PATH diff --git a/02-aliases.zsh b/02-aliases.zsh new file mode 100644 index 0000000..0684260 --- /dev/null +++ b/02-aliases.zsh @@ -0,0 +1,28 @@ +# Just a funky little collection of more or less useful aliases + +#Various impractical jokes and tools +if [ -n "$LOCALCITY" ]; then + alias weatherfetch="curl -sf https://wttr.in/$LOCALCITY | head -n 7 && echo ''" +fi +if [ -n "$DESKTOP_SESSION" ]; then + alias linuxver="nohup zenity --info --text=\"Linux version: \\n$(uname -srm)\" > /dev/null" + alias paste="xclip -o -selection clipboard" + alias copy="xclip -o | xclip -i -selection clipboard" +fi +alias vim="nvim" +function nojail() { + PATH=`echo $PATH | sed "s/:\/usr\/local\/bin//g" | sed "s/:\/usr\/local\/sbin//g"` $@ +} + +if which flashplayer > /dev/null; then + function z0rde() { + local id + id="$1" + if [ "$1" == "" ]; then + id="$((1 + $RANDOM % 8000))" + fi + echo $id + flashplayer "https://z0r.de/L/z0r-de_$id.swf" + } +fi + diff --git a/03-completion.zsh b/03-completion.zsh new file mode 100644 index 0000000..f422496 --- /dev/null +++ b/03-completion.zsh @@ -0,0 +1,19 @@ +autoload -Uz compinit +compinit +# ZSH menu styling +# Enabling completers, cache and menu with selection. +zstyle :compinstall filename '/home/yessiest/.zshrc' +zstyle ':completion:*' completer _extensions _complete _approximate +zstyle ':completion:*' use-cache on +zstyle ':completion:*' cache-path "$HOME/.cache/zsh/.zcompcache" +zstyle ':completion:*' menu select +# Colors for descriptions +zstyle ':completion:*:*:*:*:descriptions' format '%F{green} %d:%f' +zstyle ':completion:*:*:*:*:corrections' format '%F{yellow} %d (errors: %e):%f' +# Custom coloring for options +zstyle ':completion:*:options' list-colors '=(#b)*(-- *)=0=38;5;241' +# Custom coloring for processes +zstyle ':completion:*:processes' list-colors '=(#b) #([0-9]#)*( *[a-z])*=0=38;5;242=32' +# Colors for LS +zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} + diff --git a/04-bindings.zsh b/04-bindings.zsh new file mode 100644 index 0000000..4fd38c5 --- /dev/null +++ b/04-bindings.zsh @@ -0,0 +1,8 @@ +# The default text editing behaviour +bindkey "^[[1;5C" forward-word #Ctrl+right goes forwards one word +bindkey "^[[1;5D" backward-word #Ctrl+left goes backwards one word +bindkey "^[[1;3C" forward-word #Alt+right goes forwards one word +bindkey "^[[1;3D" backward-word #Alt+left goes backwards one word +bindkey '^[[H' beginning-of-line #Home goes to the beginning of the line +bindkey '^[[F' end-of-line #End goes to the end of the line +