summaryrefslogtreecommitdiff
path: root/.config/shell
diff options
context:
space:
mode:
Diffstat (limited to '.config/shell')
-rwxr-xr-x.config/shell/aliasrc27
-rwxr-xr-x.config/shell/inputrc19
-rwxr-xr-x.config/shell/profile38
3 files changed, 84 insertions, 0 deletions
diff --git a/.config/shell/aliasrc b/.config/shell/aliasrc
new file mode 100755
index 0000000..8d4eacd
--- /dev/null
+++ b/.config/shell/aliasrc
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+# Use neovim for vim if present.
+[ -x "$(command -v nvim)" ] && alias vim="nvim" vimdiff="nvim -d"
+
+# Use XINITRC variable if file exists.
+[ -f "$XINITRC" ] && alias startx="startx $XINITRC"
+
+# sudo not required for some system commands.
+for x in mount unmount sv pacman updatedb su ; do
+ alias $x="sudo $x"
+done
+
+# Verbosity and settings that you pretty much just always are going to want.
+alias \
+ cp="cp -iv" \
+ mv="mv -iv" \
+ rm="rm -vI" \
+ bc="bc -ql" \
+ mkd="mkdir -pv" \
+ ffmpeg="ffmpeg -hide_banner"
+
+alias \
+ ls="ls -hN --color=auto --group-directories-first" \
+ grep="grep --color=auto" \
+ diff="diff --color=auto" \
+ ccat="highlight --out-format=ansi"
diff --git a/.config/shell/inputrc b/.config/shell/inputrc
new file mode 100755
index 0000000..cbe8e5e
--- /dev/null
+++ b/.config/shell/inputrc
@@ -0,0 +1,19 @@
+#include /etc/inputrc
+set editing-mode vi
+$if mode=vi
+
+set show-mode-in-promt on
+set vi-ins-mode-string \1\e[6 q\2
+set vi-cmd-mode-string \1\e[2 q\2
+
+set keymap vi-command
+# These are for vi-command mode
+Control-l: clear-screen
+Control-a: beginning-of-line
+
+set keymap vi-insert
+# These are vi-insert mode
+Control-i: clear-screen
+Control-a: beginning-of-line
+
+$endif
diff --git a/.config/shell/profile b/.config/shell/profile
new file mode 100755
index 0000000..0630427
--- /dev/null
+++ b/.config/shell/profile
@@ -0,0 +1,38 @@
+#!/bin/zsh
+
+# profile file. Runs on login. Environmental variables are set here.
+
+# Adds `~/.local/bin` to $PATH
+export PATH="$PATH:${$(find ~/.local/bin -type -d printf %p:)%%:}"
+
+unsetopt PROMPT_SP
+
+# Default programs:
+export EDITOR="nvim"
+export TERMINAL="alacritty"
+export BROWSER="brave"
+
+# ~/ Clean-up:
+export XDG_CONFIG_HOME="$HOME/.config"
+export XDG_DATA_HOME="$HOME/.local/share"
+export XDG_CACHE_HOME="$HOME/.cache"
+export XINITRC="${XDG_CONFIG_HOME:-$HOME/.config}/x11/xinitrc"
+export ZDOTDIR="${XDG_CONFIG_HOME:-$HOME/.config}/zsh"
+export TMUX_TMPDIR="$XDG_RUNTIME_DIR"
+export CARGO_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/cargo"
+export GOPATH="${XDG_DATA_HOME:-$HOME/.local/share}/go"
+export HISTFILE="${XDG_DATA_HOME:-$HOME/.local/share}/history"
+export LESSHIST="-"
+
+# Other program settings:
+export FZF_DEFAULT_OPTS="--layout=reverse --height 40%"
+
+if pacman -Qs libxft-bgra >/dev/null 2>&1; then
+ # Start graphical server on user's current tty if not already running.
+ [ "$(tty)" = "/dev/tty1" ] && ! pidof -s Xorg >/dev/null 2>&1 && exec startx "$XINITRC"
+else
+ echo "\033[31mIMPORTANT\033[0m: Note that 033[32m\`libxft-bgra\`\033[0m must be installed for this build of dwm.
+Please run:
+\033[32myay -S libxft-bgra-git\033[0m
+and replace \`libxft\`. Afterwards, you may start the graphical server by running \`startx\`."
+fi