From 23cd0b8bd3629e5a4df640bd25caf0b43998e7c5 Mon Sep 17 00:00:00 2001 From: Salt Date: Tue, 5 Feb 2019 12:44:41 -0600 Subject: [PATCH] Shells: Move shellrcs to home repo --- .bashrc | 15 ++++++++++++++- .bin | 2 +- .kshrc | 14 +++++++++++++- .zshrc | 52 +++++++++++++++++++++++++++++++++++++++++++++++++++- 4 files changed, 79 insertions(+), 4 deletions(-) mode change 120000 => 100755 .bashrc mode change 120000 => 100755 .kshrc mode change 120000 => 100755 .zshrc diff --git a/.bashrc b/.bashrc deleted file mode 120000 index 8f937257..00000000 --- a/.bashrc +++ /dev/null @@ -1 +0,0 @@ -.bin/shrc/bashrc \ No newline at end of file diff --git a/.bashrc b/.bashrc new file mode 100755 index 00000000..63ef744f --- /dev/null +++ b/.bashrc @@ -0,0 +1,14 @@ +#!/bin/bash +# +# ~/.bashrc +# + +# If not running interactively, don't do anything +[[ $- != *i* ]] && return + +# Source .profile +if [ -r ~/.profile ]; then + # shellcheck disable=1090 + source ~/.profile +fi + diff --git a/.bin b/.bin index ebe072a3..5641c987 160000 --- a/.bin +++ b/.bin @@ -1 +1 @@ -Subproject commit ebe072a32cfcbe8b0c41c96773600462ad4f2300 +Subproject commit 5641c98708a87161ee2d480ae9cde8b2009979f1 diff --git a/.kshrc b/.kshrc deleted file mode 120000 index 4e687e88..00000000 --- a/.kshrc +++ /dev/null @@ -1 +0,0 @@ -.bin/shrc/kshrc \ No newline at end of file diff --git a/.kshrc b/.kshrc new file mode 100755 index 00000000..d920b922 --- /dev/null +++ b/.kshrc @@ -0,0 +1,13 @@ +#!/bin/ksh +# +# ~/.kshrc +# + +# Source /etc/profile +. /etc/profile + +# Source .profile +if [ -r ~/.profile ]; then + # shellcheck disable=1090 + . ~/.profile +fi diff --git a/.zshrc b/.zshrc deleted file mode 120000 index a4b99fba..00000000 --- a/.zshrc +++ /dev/null @@ -1 +0,0 @@ -.bin/shrc/zshrc \ No newline at end of file diff --git a/.zshrc b/.zshrc new file mode 100755 index 00000000..621e7a64 --- /dev/null +++ b/.zshrc @@ -0,0 +1,51 @@ +#!/usr/bin/env zsh +# +# ~/.zshrc +# + +# Source /etc/profile +if [[ -f "/etc/profile" ]]; then + source /etc/profile 2>& /dev/null +fi + +# General options +DEFAULT_USER=salt +HISTFILE=~/.histfile +HISTSIZE=1000 +SAVEHIST=1000 +export LANG="en_US.UTF-8" +setopt appendhistory autocd extendedglob nomatch +unsetopt beep notify +bindkey -e + +# Partial history matching +autoload -U history-search-end +zle -N history-beginning-search-backward-end history-search-end +zle -N history-beginning-search-forward-end history-search-end +bindkey '\e[A' history-beginning-search-backward-end +bindkey '\e[B' history-beginning-search-forward-end + +# Set up styling +zstyle :compinstall filename '/home/salt/.zshrc' + +# Completion +autoload -Uz compinit +compinit +compdef _git dot +compdef _ssh ssht + +# The prompt +autoload -Uz promptinit +setopt prompt_percent +if [ "$SSH_CLIENT" = "" ]; then + PROMPT="[%F{blue}%~" +else + PROMPT="[%F{red}%B%m%b:%~" +fi +PROMPT="$PROMPT%f]%(0?..%F{red}%B?%b%f)%(!.%F{red}#%f.%F{green}$%f) " +promptinit + +# Source .profile +if [[ -f "$HOME/.profile" ]]; then + source "$HOME/.profile" 2>& /dev/null +fi