summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWarrick Lo <warrick.s.z.lo@gmail.com>2021-11-27 04:18:00 -0800
committerWarrick Lo <warrick.s.z.lo@gmail.com>2021-11-27 04:18:00 -0800
commitd4fa77e06115731c056b285ea980f4b30db349a8 (patch)
tree8f05d76e19ccc9eb312b8da531c3413bd9ad7ba3
Add shell configs
-rw-r--r--.bashrc18
-rw-r--r--.config/aliasrc25
-rw-r--r--.profile19
-rw-r--r--.zshrc49
4 files changed, 111 insertions, 0 deletions
diff --git a/.bashrc b/.bashrc
new file mode 100644
index 0000000..b486d2c
--- /dev/null
+++ b/.bashrc
@@ -0,0 +1,18 @@
+# Bash configuration
+
+# Set prompt.
+PS1="\[\033[38;5;3m\][\u@\h \w]\[\033[0m\] \$ "
+
+# History file configuration.
+shopt -s histappend
+HISTSIZE=100000
+HISTFILESIZE=100000
+HISTFILE="$HOME/.cache/bash/history"
+
+# GPG.
+export GPG_TTY="$(tty)"
+
+# Load aliases.
+if [ -f "$HOME/.config/aliasrc" ]; then
+ source "$HOME/.config/aliasrc"
+fi
diff --git a/.config/aliasrc b/.config/aliasrc
new file mode 100644
index 0000000..3f63899
--- /dev/null
+++ b/.config/aliasrc
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+# Shell alias definitions
+
+# General-purpose
+
+# This first alias gets inherited by the other ls aliases.
+alias ls="ls -F"
+alias la="ls -A"
+alias ll="ls -alh"
+alias lsm="ls -alht"
+alias lss="ls -alhsS"
+
+alias cp="cp -iv"
+alias mv="mv -iv"
+alias rm="rm -iv"
+alias mkdir="mkdir -p"
+
+alias ipinfo="curl https://ipinfo.io/ip -w '\n'"
+
+# Alias vim to neovim.
+alias vim="nvim"
+
+# Alias git bare to manage configuration files.
+alias cfg="/usr/bin/git --git-dir=\$HOME/cfg --work-tree=\$HOME"
diff --git a/.profile b/.profile
new file mode 100644
index 0000000..5125710
--- /dev/null
+++ b/.profile
@@ -0,0 +1,19 @@
+# Shell profile
+
+# Export path.
+
+# Scripts and local binaries.
+if [ -d "$HOME/bin" ]; then
+ export PATH="$PATH:$HOME/bin"
+fi
+if [ -d "$HOME/.local/bin" ]; then
+ export PATH="$PATH:$HOME/.local/bin"
+fi
+
+# Set environment variables.
+
+# Set default programs.
+export TERMINAL="alacritty"
+export PAGER="less"
+export EDITOR="nvim"
+export BROWSER="brave"
diff --git a/.zshrc b/.zshrc
new file mode 100644
index 0000000..58e79a7
--- /dev/null
+++ b/.zshrc
@@ -0,0 +1,49 @@
+# Zsh configuration
+
+# Set colors.
+autoload -U colors
+colors
+
+# Set prompt.
+PS1="%F{3}[%n@%m %~]%f %(?..%B%F{9}%?%f%b )%(!.#.$) "
+
+# History file configuration.
+setopt hist_ignore_dups
+SAVEHIST=100000
+HISTSIZE=100000
+HISTFILE="$HOME/.cache/zsh/history"
+
+# Enable tab completion.
+autoload -U compinit
+zstyle ":completion:*" menu select
+zmodload zsh/complist
+
+# Do not ask before executing 'rm *' or 'rm path/*'.
+setopt rm_star_silent
+
+# vi-like bindings.
+bindkey -v "^?" backward-delete-char
+
+# GPG.
+export GPG_TTY="$(tty)"
+
+# Load aliases.
+if [ -f "$HOME/.config/aliasrc" ]; then
+ source "$HOME/.config/aliasrc"
+fi
+
+# Load Zsh scripts.
+
+autosuggestions="$HOME/.local/share/zsh/autosuggestions/zsh-autosuggestions.zsh"
+syntax_highlight="$HOME/.local/share/zsh/syntax-highlighting/zsh-syntax-highlighting.zsh"
+
+if [ -f "$autosuggestions" ]; then
+ source "$autosuggestions"
+fi
+
+if [ -f "$syntax_highlight" ]; then
+ source "$syntax_highlight"
+fi
+
+unset autosuggestions
+unset syntax_highlight