Compare commits
12 Commits
8d4e100277
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| a192f828af | |||
| dd6646cf40 | |||
|
|
4cf415c886 | ||
| e77d1cc820 | |||
| e7db7d41e7 | |||
|
|
3d19f52f90 | ||
| 5bfa36bce1 | |||
| d33ced3f6e | |||
| 9e434c94f5 | |||
| 287aed455a | |||
| acadd11016 | |||
| 6542633eb2 |
15
.fzf.zsh
15
.fzf.zsh
@@ -1,16 +1,21 @@
|
|||||||
# Setup fzf
|
# Setup fzf
|
||||||
# ---------
|
# ---------
|
||||||
if [[ ! "$PATH" == */home/chawley/.fzf/bin* ]]; then
|
if [[ ! "$PATH" == *$HOME/.fzf/bin* ]]; then
|
||||||
PATH="${PATH:+${PATH}:}/home/chawley/.fzf/bin"
|
PATH="${PATH:+${PATH}:}$HOME/.fzf/bin"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Export FZF settings
|
||||||
|
export FZF_DEFAULT_OPTS="--height=50% --layout=reverse --info=inline --border --margin=1 --padding=1"
|
||||||
|
|
||||||
# Ignore .git directories
|
# Ignore .git directories
|
||||||
export FZF_DEFAULT_COMMAND="find . \( -name .git \) -prune -o -print"
|
export FZF_DEFAULT_COMMAND="find . \( -name .git -o -name .stversions \) -prune -o -print"
|
||||||
|
|
||||||
# Auto-completion
|
# Auto-completion
|
||||||
# ---------------
|
# ---------------
|
||||||
source "/home/chawley/.fzf/shell/completion.zsh"
|
#source "$HOME/.fzf/shell/completion.zsh"
|
||||||
|
|
||||||
# Key bindings
|
# Key bindings
|
||||||
# ------------
|
# ------------
|
||||||
source "/home/chawley/.fzf/shell/key-bindings.zsh"
|
#source "$HOME/.fzf/shell/key-bindings.zsh"
|
||||||
|
#
|
||||||
|
source <(fzf --zsh)
|
||||||
|
|||||||
48
.zshrc
48
.zshrc
@@ -1,18 +1,58 @@
|
|||||||
# Exports
|
# Exports
|
||||||
export PATH=$HOME/bin:/usr/local/bin:$HOME/.local/bin/:$PATH
|
export PATH=$HOME/bin:/usr/local/bin:$HOME/.local/bin/:$PATH
|
||||||
export ZSH="$HOME/.oh-my-zsh"
|
export ZSH="$HOME/.oh-my-zsh"
|
||||||
|
|
||||||
ZSH_THEME="powerlevel10k/powerlevel10k"
|
ZSH_THEME="powerlevel10k/powerlevel10k"
|
||||||
POWERLEVEL9K_MODE="nerdfont-complete"
|
POWERLEVEL9K_MODE="nerdfont-complete"
|
||||||
plugins=(git zsh-autosuggestions zsh-syntax-highlighting)
|
plugins=(git zsh-autosuggestions zsh-syntax-highlighting)
|
||||||
export ZSH_COMPDUMP=$ZSH/cache/completions/.zcompdump-$HOST
|
export ZSH_COMPDUMP=$ZSH/cache/completions/.zcompdump-$HOST
|
||||||
source $ZSH/oh-my-zsh.sh
|
source $ZSH/oh-my-zsh.sh
|
||||||
|
|
||||||
|
# If rc.local exists, source it
|
||||||
|
[ -f ~/.local/rc.local ] && source ~/.local/rc.local
|
||||||
|
|
||||||
# User-defined Aliases and Functions
|
# User-defined Aliases and Functions
|
||||||
[[ ! -f ~/.shell_functions ]] || source ~/.shell_functions
|
[[ ! -f ~/.shell_functions ]] || source ~/.shell_functions
|
||||||
[[ ! -f ~/.shell_aliases ]] || source ~/.shell_aliases
|
[[ ! -f ~/.shell_aliases ]] || source ~/.shell_aliases
|
||||||
|
|
||||||
fortune -a | cowsay | lolcat
|
# ZSH History Options
|
||||||
|
# Reference: https://unix.stackexchange.com/questions/273861/unlimited-history-in-zsh
|
||||||
|
HISTFILE="$HOME/.zsh_history"
|
||||||
|
HISTSIZE=10000
|
||||||
|
SAVEHIST=10000
|
||||||
|
setopt BANG_HIST # Treat the '!' character specially during expansion.
|
||||||
|
setopt EXTENDED_HISTORY # Write the history file in the ":start:elapsed;command" format.
|
||||||
|
setopt INC_APPEND_HISTORY # Write to the history file immediately, not when the shell exits.
|
||||||
|
setopt SHARE_HISTORY # Share history between all sessions.
|
||||||
|
setopt HIST_EXPIRE_DUPS_FIRST # Expire duplicate entries first when trimming history.
|
||||||
|
setopt HIST_IGNORE_DUPS # Don't record an entry that was just recorded again.
|
||||||
|
setopt HIST_IGNORE_ALL_DUPS # Delete old recorded entry if new entry is a duplicate.
|
||||||
|
setopt HIST_FIND_NO_DUPS # Do not display a line previously found.
|
||||||
|
setopt HIST_IGNORE_SPACE # Don't record an entry starting with a space.
|
||||||
|
setopt HIST_SAVE_NO_DUPS # Don't write duplicate entries in the history file.
|
||||||
|
setopt HIST_REDUCE_BLANKS # Remove superfluous blanks before recording entry.
|
||||||
|
setopt HIST_VERIFY # Don't execute immediately upon history expansion.
|
||||||
|
setopt HIST_BEEP # Beep when accessing nonexistent history.
|
||||||
|
|
||||||
|
# Display Random Quote
|
||||||
|
if command -v curl >/dev/null 2>&1; then
|
||||||
|
QUOTE=$(curl -s https://files.planethawleywood.com/quotes.txt)
|
||||||
|
if [ -n "$QUOTE" ]; then
|
||||||
|
if command -v shuf >/dev/null 2>&1; then
|
||||||
|
QUOTE=$(echo "$QUOTE" | shuf -n 1)
|
||||||
|
fi
|
||||||
|
if command -v cowsay >/dev/null 2>&1; then
|
||||||
|
if command -v lolcat >/dev/null 2>&1; then
|
||||||
|
echo "$QUOTE" | cowsay -f tux | lolcat
|
||||||
|
else
|
||||||
|
echo "$QUOTE" | cowsay -f tux
|
||||||
|
fi
|
||||||
|
elif command -v lolcat >/dev/null 2>&1; then
|
||||||
|
echo "$QUOTE" | lolcat
|
||||||
|
else
|
||||||
|
echo "$QUOTE"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# Instant Prompt Preamble
|
# Instant Prompt Preamble
|
||||||
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
|
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
|
||||||
@@ -22,7 +62,6 @@ if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]
|
|||||||
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
|
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# If .fzf.zsh exists, source it
|
# If .fzf.zsh exists, source it
|
||||||
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
|
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
|
||||||
|
|
||||||
@@ -31,3 +70,6 @@ fi
|
|||||||
|
|
||||||
# If .zshrc.$USER exists, source it
|
# If .zshrc.$USER exists, source it
|
||||||
[[ ! -f ~/.zshrc.$USER ]] || source ~/.zshrc.$USER
|
[[ ! -f ~/.zshrc.$USER ]] || source ~/.zshrc.$USER
|
||||||
|
|
||||||
|
# If autojump installed, source it
|
||||||
|
[[ ! -f /usr/share/autojump/autojump.zsh ]] || source /usr/share/autojump/autojump.zsh
|
||||||
|
|||||||
@@ -3,3 +3,5 @@
|
|||||||
Just a place to track my ZSH configs
|
Just a place to track my ZSH configs
|
||||||
|
|
||||||
Including `.zshrc`, `.fzf.zsh` and settings for [oh-my-zsh ](https://github.com/robbyrussell/oh-my-zsh) (required)
|
Including `.zshrc`, `.fzf.zsh` and settings for [oh-my-zsh ](https://github.com/robbyrussell/oh-my-zsh) (required)
|
||||||
|
|
||||||
|
Includes `.zshrc.original` as a working reference since I've changed mine so much.
|
||||||
|
|||||||
24
create-links.sh
Executable file
24
create-links.sh
Executable file
@@ -0,0 +1,24 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#===============================================================================
|
||||||
|
#
|
||||||
|
# FILE: create-symlinks.sh
|
||||||
|
# USAGE:
|
||||||
|
# DESCRIPTION:
|
||||||
|
# REQUIREMENTS:
|
||||||
|
# NOTES:
|
||||||
|
# AUTHOR: C Hawley
|
||||||
|
# CREATED:
|
||||||
|
#
|
||||||
|
#===============================================================================
|
||||||
|
|
||||||
|
# If regular files exists, remove them
|
||||||
|
[[ -f $HOME/.zshrc ]] && rm $HOME/.zshrc
|
||||||
|
[[ -f $HOME/.fzf.zsh ]] && rm $HOME/.fzf.zsh
|
||||||
|
|
||||||
|
# If symlinks exist, unlink them
|
||||||
|
[[ -L $HOME/.zshrc ]] && unlink $HOME/.zshrc
|
||||||
|
[[ -L $HOME/.fzf.zsh ]] && unlink $HOME/.fzf.zsh
|
||||||
|
|
||||||
|
# Create symlinks to files in repository
|
||||||
|
ln -s $PWD/.zshrc $HOME/.zshrc
|
||||||
|
ln -s $PWD/.fzf.zsh $HOME/.fzf.zsh
|
||||||
Reference in New Issue
Block a user