summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xzsh/aliasrc61
-rwxr-xr-xzsh/keybindrc4
-rw-r--r--zsh/lficons2
-rw-r--r--zsh/zshrc6
4 files changed, 45 insertions, 28 deletions
diff --git a/zsh/aliasrc b/zsh/aliasrc
index 0c8dff2..6aa57c2 100755
--- a/zsh/aliasrc
+++ b/zsh/aliasrc
@@ -5,45 +5,60 @@ alias -s \
{c,h,txt,md}=nvim
## Normal Aliases ##
+# Replacement programs
+alias \
+ sudo="doas" \
+ ls="exa --icons -a --group-directories-first" \
+ htop="htim" \
+ vim="nvim" \
+
# Shorten program names
alias \
- xi="sudo xbps-install" \
- xq="xbps-query -Rs" \
- xr="sudo xbps-remove" \
spotify="flatpak run com.spotify.Client" \
- xbs="xbacklight -set" \
smi="sudo make install" \
smci="sudo make clean install"
-# Replacement programs
+
+# Quick navigate to directories / open specific files
+alias \
+ zrc="cd ~/.config/zsh" \
+ xrc="cd ~/.config/x11" \
+ vrc="nvim ~/.config/nvim/init.vim"
+
+# Package management
+[ "$COMPUTER" = "laptop" ] && alias \
+ xi="sudo xbps-install" \
+ xq="xbps-query --search -R" \
+ xr="sudo xbps-remove"
+[ "$COMPUTER" = "desktop" ] && alias \
+ e="sudo emerge" \
+ eaum="sudo emerge --autounmask-continue"
+
+# Power scripts
alias \
- sudo="doas" \
halt="sudo poweroff" \
off="sudo poweroff" \
- ls="exa --icons -a --group-directories-first" \
- htop="htim" \
- vim="nvim"
+ reboot="sudo reboot"
+[ "$COMPUTER" = "laptop" ] && alias \
+ zzz="sudo zzz" \
+ xbs="xbacklight -set"
+[ "$COMPUTER" = "desktop" ] && alias \
+ zzz="sudo s2ram"
+
# Colorize command output
alias \
- grep="grep --color=auto -In" \
+ grep="grep --color=auto -I --line-numer --ignore-case" \
diff="diff --color=auto"
#ls="ls -hN --color=auto --group-directories-first" \
+
# Verbosity / non-verbosity
alias \
- cp="cp -iv" \
- mv="mv -iv" \
- rm="rm -vI" \
- mkd="mkdir -pv" \
+ cp="cp --interactive --verbose" \
+ mv="mv --interactive --verbose" \
+ rm="rm --interactive --verbose" \
+ mkd="mkdir --parents --verbose" \
br="br -h" \
ffmpeg="ffmpeg -hide_banner"
-# Auto-sudo
-alias \
- zzz="sudo zzz" \
- reboot="sudo reboot"
-# Quick navigate to directories / open specific files
-alias \
- zrc="cd ~/.config/zsh" \
- xrc="cd ~/.config/x11" \
- vrc="nvim ~/.config/nvim/init.vim"
+
# Make startx link to proper xinitrc location
alias \
startx="startx ~/.config/x11/xinitrc" \
diff --git a/zsh/keybindrc b/zsh/keybindrc
index 56d8a6c..a52b826 100755
--- a/zsh/keybindrc
+++ b/zsh/keybindrc
@@ -5,8 +5,8 @@ bindkey -v
export KEYTIMEOUT=1
# Keybinding functions
- #function name #function #description
-autoload edit-command-line; zle -N edit-command-line # Edit line in Vim buffer
+ #function name #function #description
+autoload edit-command-line; zle -N edit-command-line # Edit line in Vim buffer
# Unbind some default keybindings
bindkey -r "^U" "^V" "^W" "^G" "^J" "^Q" "^R" "^[[200~"
diff --git a/zsh/lficons b/zsh/lficons
index 59b5c55..240bae4 100644
--- a/zsh/lficons
+++ b/zsh/lficons
@@ -1,3 +1,5 @@
+#!/bin/sh
+# TODO: remove icons for unused file types
export LF_ICONS="\
di=:\
fi=:\
diff --git a/zsh/zshrc b/zsh/zshrc
index 7e5408e..cce5d37 100644
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -2,7 +2,7 @@
# Colors! + Prompt
autoload -U colors && colors
-PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b "
+PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b " # TODO: change $ to # when root
# Load aliasrc and keybindrc
source "${XDG_CONFIG_HOME:-$HOME/.config}/zsh/aliasrc"
@@ -10,7 +10,7 @@ source "${XDG_CONFIG_HOME:-$HOME/.config}/zsh/keybindrc"
# lf icons
source "${XDG_CONFIG_HOME:-$HOME/.config}/zsh/lficons"
-# Change cursor shape for different vi modes (LARBS)
+# Change cursor shape for different vi modes (Cred: LARBS)
function zle-keymap-select () {
case $KEYMAP in
vicmd) echo -ne '\e[1 q';; # block
@@ -19,7 +19,7 @@ function zle-keymap-select () {
}
zle -N zle-keymap-select
zle-line-init() {
- zle -K viins # initiate `vi insert` as keymap (can be removed if `bindkey -V` has been set elsewhere)
+ #zle -K viins # initiate `vi insert` as keymap (can be removed if `bindkey -V` has been set elsewhere)
echo -ne "\e[5 q"
}
zle -N zle-line-init