From 709542f2011784e2da48405a0972ee46705033b8 Mon Sep 17 00:00:00 2001 From: ryo Date: Thu, 31 Oct 2024 17:08:48 +0000 Subject: Fixed: major bugs and bad file names --- config/i3/config | 2 +- config/shell/alias | 60 ---------------------------------------- config/shell/aliases | 60 ++++++++++++++++++++++++++++++++++++++++ config/shell/func | 24 ---------------- config/shell/funcs | 24 ++++++++++++++++ config/zsh/.zshrc | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++ config/zsh/zshrc | 77 ---------------------------------------------------- 7 files changed, 162 insertions(+), 162 deletions(-) delete mode 100644 config/shell/alias create mode 100644 config/shell/aliases delete mode 100644 config/shell/func create mode 100644 config/shell/funcs create mode 100644 config/zsh/.zshrc delete mode 100644 config/zsh/zshrc (limited to 'config') diff --git a/config/i3/config b/config/i3/config index 46146e2..cabb700 100644 --- a/config/i3/config +++ b/config/i3/config @@ -24,7 +24,7 @@ bindsym $mod+Ctrl+s --release exec scshot.sh a exec --no-startup-id alacritty exec --no-startup-id nm-applet -exec --no-startup-id alacritty -n dropdown -e tmux new -s drop +exec --no-startup-id alacritty -n dropdown # ======================================= diff --git a/config/shell/alias b/config/shell/alias deleted file mode 100644 index 0b6287a..0000000 --- a/config/shell/alias +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env zsh - -# Ryo aliases -# https://ryo.nopwd.lol -# -# fork of Luke's config -# https://github.com/lukesmithxyz/voidrice - -# only if variables exists -[ -f "$XINITRC" ] && alias startx="startx $XINITRC" -[ -f "$MBSYNCRC" ] && alias mbsync="mbsync -c $MBSYNCRC" - -# be careful -alias \ - cp="cp -i" \ - mv="mv -i" \ - rm="rm -I" \ - bc="bc -ql" \ - d='doas' - -# colorize commands when possible. -alias \ - ls="ls -hN --color=auto --group-directories-first" \ - grep="grep --color=auto" \ - diff="diff --color=auto" \ - ccat="highlight --out-format=ansi" \ - ip="ip -color=auto" - -# Arch pacman -alias \ - p="pacman" \ - pacins='doas pacman -S' \ - pacinf='pacman -Si' \ - pacsch='pacman -Ss' - -# Void xbps -alias \ - xi="doas xbps-install" \ - xr="sudo xbps-remove -R" \ - xq="xbps-query" - - -alias \ - ll='ls -lh' \ - g="git" \ - i='nsxiv' \ - v="$EDITOR" \ - re='source $ZDOTDIR/.zshrc' \ - a='mpv --no-video' \ - mkd="mkdir -pv" \ - hmpv='mpv --really-quiet' \ - hcurl='curl -L -O' \ - hgit='git clone --depth=1 --no-tags --single-branch' \ - hfont='fc-list | grep -i' \ - hfind='find . -name' \ - xclip='xclip -selection clipboard -r' \ - idate='TZ=Iran date' \ - hxkb='setxkbmap -option caps:swapescape -layout us,ir -option grp:shifts_toggle' \ - ffmpeg="ffmpeg -hide_banner" - diff --git a/config/shell/aliases b/config/shell/aliases new file mode 100644 index 0000000..0b6287a --- /dev/null +++ b/config/shell/aliases @@ -0,0 +1,60 @@ +#!/usr/bin/env zsh + +# Ryo aliases +# https://ryo.nopwd.lol +# +# fork of Luke's config +# https://github.com/lukesmithxyz/voidrice + +# only if variables exists +[ -f "$XINITRC" ] && alias startx="startx $XINITRC" +[ -f "$MBSYNCRC" ] && alias mbsync="mbsync -c $MBSYNCRC" + +# be careful +alias \ + cp="cp -i" \ + mv="mv -i" \ + rm="rm -I" \ + bc="bc -ql" \ + d='doas' + +# colorize commands when possible. +alias \ + ls="ls -hN --color=auto --group-directories-first" \ + grep="grep --color=auto" \ + diff="diff --color=auto" \ + ccat="highlight --out-format=ansi" \ + ip="ip -color=auto" + +# Arch pacman +alias \ + p="pacman" \ + pacins='doas pacman -S' \ + pacinf='pacman -Si' \ + pacsch='pacman -Ss' + +# Void xbps +alias \ + xi="doas xbps-install" \ + xr="sudo xbps-remove -R" \ + xq="xbps-query" + + +alias \ + ll='ls -lh' \ + g="git" \ + i='nsxiv' \ + v="$EDITOR" \ + re='source $ZDOTDIR/.zshrc' \ + a='mpv --no-video' \ + mkd="mkdir -pv" \ + hmpv='mpv --really-quiet' \ + hcurl='curl -L -O' \ + hgit='git clone --depth=1 --no-tags --single-branch' \ + hfont='fc-list | grep -i' \ + hfind='find . -name' \ + xclip='xclip -selection clipboard -r' \ + idate='TZ=Iran date' \ + hxkb='setxkbmap -option caps:swapescape -layout us,ir -option grp:shifts_toggle' \ + ffmpeg="ffmpeg -hide_banner" + diff --git a/config/shell/func b/config/shell/func deleted file mode 100644 index 7788689..0000000 --- a/config/shell/func +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env zsh - -proxy_connect=0 -toggle_proxy() { - if [[ "$proxy_connect" -eq 0 ]]; then - export http_proxy="http://127.0.0.1:2081" - export https_proxy=$http_proxy - proxy_connect=1 - echo "vpn activated" - else - unset http_proxy - unset https_proxy - proxy_connect=0 - echo "vpn deactivated" - fi -} - -generate_pass() { - local len=8 - if [ $# -eq 1 ]; then - len=$1 - fi - tr -cd '[:graph:]' < /dev/urandom | head -c $len | xargs -0 -} diff --git a/config/shell/funcs b/config/shell/funcs new file mode 100644 index 0000000..7788689 --- /dev/null +++ b/config/shell/funcs @@ -0,0 +1,24 @@ +#!/usr/bin/env zsh + +proxy_connect=0 +toggle_proxy() { + if [[ "$proxy_connect" -eq 0 ]]; then + export http_proxy="http://127.0.0.1:2081" + export https_proxy=$http_proxy + proxy_connect=1 + echo "vpn activated" + else + unset http_proxy + unset https_proxy + proxy_connect=0 + echo "vpn deactivated" + fi +} + +generate_pass() { + local len=8 + if [ $# -eq 1 ]; then + len=$1 + fi + tr -cd '[:graph:]' < /dev/urandom | head -c $len | xargs -0 +} diff --git a/config/zsh/.zshrc b/config/zsh/.zshrc new file mode 100644 index 0000000..e9ed25f --- /dev/null +++ b/config/zsh/.zshrc @@ -0,0 +1,77 @@ +# Ryo zsh config +# https://ryo.nopwd.lol +# +# literally Luke's config +# https://github.com/lukesmithxyz/voidrice + + +# enable colors and change prompt +autoload -U colors && colors +setopt autocd +stty stop undef +setopt interactive_comments +PS1="%B%{$fg[blue]%}[%{$fg[cyan]%}%~%{$fg[blue]%}]%{$reset_color%}$%b " + +# history in cache directory +HISTSIZE=10000000 +SAVEHIST=10000000 +HISTFILE="$XDG_CACHE_HOME/zsh/history" +setopt inc_append_history + +# load aliases and functions if existent +source $HOME/.config/shell/aliases +source $HOME/.config/shell/funcs + +# basic auto/tab complete +autoload -U compinit +zstyle ':completion:*' menu select +zmodload zsh/complist +compinit +_comp_options+=(globdots) + +# vi mode +bindkey -v +export KEYTIMEOUT=1 + +# use vim keys in tab complete menu +bindkey -M menuselect 'h' vi-backward-char +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 -v '^?' backward-delete-char + +# change cursor shape for different vi modes +function zle-keymap-select () { + case $KEYMAP in + vicmd) echo -ne '\e[1 q';; # block + viins|main) echo -ne '\e[5 q';; # beam + esac +} +zle -N zle-keymap-select +zle-line-init() { + zle -K viins + echo -ne "\e[5 q" +} +zle -N zle-line-init +echo -ne '\e[1 q' # beam cursor on startup +preexec() { echo -ne '\e[1 q' ;} # also for each new prompt + +bindkey '^[[P' delete-char + +bindkey -s '^f' '^ucd "$(dirname "$(fzf)")"\n' + +# edit line in vim with ctrl-e: +autoload edit-command-line; zle -N edit-command-line +bindkey '^e' edit-command-line +bindkey -M vicmd '^[[P' vi-delete-char +bindkey -M vicmd '^e' edit-command-line +bindkey -M visual '^[[P' vi-delete + +# autosuggestion and syntax highlighting +source $HOME/src/zsh-as/zsh-autosuggestions.zsh 2> /dev/null +source $HOME/src/zsh-fsh/fast-syntax-highlighting.plugin.zsh 2>/dev/null + +bindkey '^s' autosuggest-accept + +# put your configs here + diff --git a/config/zsh/zshrc b/config/zsh/zshrc deleted file mode 100644 index 230a150..0000000 --- a/config/zsh/zshrc +++ /dev/null @@ -1,77 +0,0 @@ -# Ryo's zsh config -# https://ryo.nopwd.lol -# -# literally Luke's config -# https://github.com/lukesmithxyz/voidrice - - -# enable colors and change prompt -autoload -U colors && colors -setopt autocd -stty stop undef -setopt interactive_comments -PS1="%B%{$fg[blue]%}[%{$fg[cyan]%}%~%{$fg[blue]%}]%{$reset_color%}$%b " - -# history in cache directory -HISTSIZE=10000000 -SAVEHIST=10000000 -HISTFILE="$XDG_CACHE_HOME/zsh/history" -setopt inc_append_history - -# load aliases and functions if existent -source $HOME/.config/shell/aliasrc -source $HOME/.config/shell/funcrc - -# basic auto/tab complete -autoload -U compinit -zstyle ':completion:*' menu select -zmodload zsh/complist -compinit -_comp_options+=(globdots) - -# vi mode -bindkey -v -export KEYTIMEOUT=1 - -# use vim keys in tab complete menu -bindkey -M menuselect 'h' vi-backward-char -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 -v '^?' backward-delete-char - -# change cursor shape for different vi modes -function zle-keymap-select () { - case $KEYMAP in - vicmd) echo -ne '\e[1 q';; # block - viins|main) echo -ne '\e[5 q';; # beam - esac -} -zle -N zle-keymap-select -zle-line-init() { - zle -K viins - echo -ne "\e[5 q" -} -zle -N zle-line-init -echo -ne '\e[1 q' # beam cursor on startup -preexec() { echo -ne '\e[1 q' ;} # also for each new prompt - -bindkey '^[[P' delete-char - -bindkey -s '^f' '^ucd "$(dirname "$(fzf)")"\n' - -# edit line in vim with ctrl-e: -autoload edit-command-line; zle -N edit-command-line -bindkey '^e' edit-command-line -bindkey -M vicmd '^[[P' vi-delete-char -bindkey -M vicmd '^e' edit-command-line -bindkey -M visual '^[[P' vi-delete - -# autosuggestion and syntax highlighting -source $HOME/src/zsh-as/zsh-autosuggestions.zsh 2> /dev/null -source $HOME/src/zsh-fsh/fast-syntax-highlighting.plugin.zsh 2>/dev/null - -bindkey '^s' autosuggest-accept - -# put your configs here - -- cgit v1.2.3