Move shell files

This commit is contained in:
David Todd
2021-01-11 16:32:54 -06:00
parent 1c3e57ecd9
commit 5260b6fb5d
7 changed files with 0 additions and 0 deletions

View File

@@ -1,23 +0,0 @@
# Common Aliases
# These will be sourced into the main *sh config that's loaded
alias ls='ls --color=auto'
alias ll='ls -l'
alias la='ls -Alh'
alias l='ls -C'
alias ld='ls -ld'
alias lo='ls -lh | sed -e 's/--x/1/g' -e 's/-w-/2/g' -e 's/-wx/3/g' -e 's/r--/4/g' -e 's/r-x/5/g' -e 's/rw-/6/g' -e 's/rwx/7/g' -e 's/---/0/g''
alias back='cd $OLDPWD'
alias clkear='clear'
alias ckear='clear'
alias reload='source ~/.zshrc'
alias webshare='python -c "import SimpleHTTPServer;SimpleHTTPServer.test()"'
alias ipa='ip addr|grep inet'
alias cls='clear;ls'
alias rvi='sudo -E vim'
alias ta='tmux attach -t C0DE || tmux new -s C0DE'
alias open='xdg-open'
# Use `shred` if it exists, or just `rm -P`
type "$shred" > /dev/null || alias shred='rm -P'

View File

@@ -1,96 +0,0 @@
# Include our shared environment stuff
source ~/dotfiles/home/shell/env
source ~/dotfiles/home/shell/aliases
source ~/dotfiles/home/shell/functions
# Basic options
export HISTCONTROL=ignoredups
export COLORFGBG='default;default'
export LESS_TERMCAP_mb=$'\E[01;31m'
export LESS_TERMCAP_md=$'\E[01;31m'
export LESS_TERMCAP_me=$'\E[0m'
export LESS_TERMCAP_se=$'\E[0m'
export LESS_TERMCAP_so=$'\E[01;44;33m'
export LESS_TERMCAP_ue=$'\E[0m'
export LESS_TERMCAP_us=$'\E[01;32m'
shopt -s checkwinsize
eval "$(dircolors -b /etc/dircolors)"
# X Terminal titles
case "$TERM" in
xterm*|rxvt*)
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
;;
*)
;;
esac
# Bash completion
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
echo "appending a '&' on the back of commands will run them in the background"
echo "Don't forget ^s to pause commands and ^q to resume paused commands"
function timer_start {
timer=${timer:-$SECONDS}
}
function timer_stop {
timer_show=$(($SECONDS - $timer))
unset timer
}
trap 'timer_start' DEBUG
PROMPT_COMMAND=timer_stop
# Prompt
# Black 0;30 Dark Gray 1;30
# Blue 0;34 Light Blue 1;34
# Green 0;32 Light Green 1;32
# Cyan 0;36 Light Cyan 1;36
# Red 0;31 Light Red 1;31
# Purple 0;35 Light Purple 1;35
# Brown 0;33 Yellow 1;33
# Light Gray 0;37 White 1;37
BLACK='\[\033[0;30m\]'
BLUE='\[\033[0;34m\]'
GREEN='\[\033[0;32m\]'
CYAN='\[\033[0;36m\]'
RED='\[\033[0;31m\]'
PURPLE='\[\033[0;35m\]'
BROWN='\[\033[0;33m\]'
LGRAY='\[\033[0;37m\]'
DGRAY='\[\033[1;30m\]'
LBLUE='\[\033[1;34m\]'
LGREEN='\[\033[1;32m\]'
LCYAN='\[\033[1;36m\]'
LRED='\[\033[1;31m\]'
LPURPLE='\[\033[1;35m\]'
YELLOW='\[\033[1;33m\]'
WHITE='\[\033[1;37m\]'
RBG='\e[41m'
ALERT=${WHITE}${RBG} # Bold White on red background
NC="\e[m" # Color Reset
PS1="\[\033]0;Bash | \u@\H:\w\007\]" # Add a dynamically changing window title - Shows current user@host:current directory (comment this and "$PS1" at beginning of next line when not an a terminal emulator)
PS1="$PS1""${LGREEN}[${LPURPLE}\u${WHITE}@${LBLUE}\h${LGREEN}]-(${YELLOW}\w${LGREEN})"
PS1="$PS1""\n [${LRED}\@ ${LGRAY}Last:${WHITE} \${timer_show}s ${LCYAN}Err:"
# Error code test - not working
#if [[ \$? = "0" ]] # If last program exited with 0 (good exit)
#then
PS1="$PS1"" ${WHITE}\$?" # show white error code
#else
# PS1="$PS1"" ${LRED}\$?" # if last program exited with anything else, show red error code
#fi
PS1="$PS1"" ${LPURPLE}BJobs:${PURPLE} \j ${LBLUE}Hist: ${LCYAN}\!${LGREEN}]\n ->${LGRAY} "
#PS1="$PS1"" ${NC}"

View File

@@ -1,48 +0,0 @@
# Skip all this for non-interactive shells
[[ -z "$PS1" ]] && return
# Force en_US UTF-8 environment
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
# Terminal Editor
export EDITOR=vim
# Paths
export PATH=${HOME}/bin:$PATH:/usr/lib/wine/bin:/sbin:/usr/sbin:/usr/local/bin
# Give the path to the dotfiles
export _DOTFILES="${HOME}/dotfiles"
# Allow automatic updates
export DISABLE_DOTFILES_AUTO_UPDATE="FALSE"
# Set "true" to update without asking first
export DISABLE_DOTFILES_UPDATE_PROMPT="FALSE"
# Update every 2 weeks (OMZ default)
export UPDATE_DOTFILES_DAYS=13
# Whether or not to automatically connect to a TMUX session when opening the shell
export ENABLE_TMUXAC="FALSE"
# If there is not an active tmux session, we probably want one
# Otherwise, the shell will not open the session again (eg. opening tabs, new terminals)
if $(tmux list-sessions >> /dev/null 2>&1); then
export TMUXATT="TRUE"
else
export TMUXATT="FALSE"
fi
# Automatically attach tmux session "C0DE"
if [[ -z "$TMUX" && "$TMUXATT" != "TRUE" && "$ENABLE_TMUXAC" != "FALSE" ]]; then
tmux attach -t C0DE || tmux new -s C0DE
fi
# Enable shell-history for interactive shells
# https://github.com/pawamoy/shell-history
#if [[ $- == *i* ]] && command -v shellhistory-location &>/dev/null; then
# . $(shellhistory-location)
# shellhistory enable
#fi

View File

@@ -1,91 +0,0 @@
# Functions gathered from around the internet
# Takes 1st argument and attempts to extract them in the current directory
extract () { # Extracts most common compressed files
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) rar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
*.tbz2) tar xjf $1 ;;
*.tgz) tar xzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1 ;;
*) echo "'$1' cannot be extracted via extract()" ;;
esac
else
echo "'$1' is not a valid file"
fi
}
# Takes 1st argument and makes a .tar.gz archive
maketgz() { tar cvzf "${1%%/}.tar.gz" "${1%%/}/"; }
# Takes 1st argument and makes a .zip archive
makezip() { zip -r "${1%%/}.zip" "$1" ; }
# Generate password - 1st argument is the number of characters, defaults to 20
gpass() {
local l=$1
[ "$l" == "" ] && l=20
tr -dc A-Za-z0-9-!@%^*_ < /dev/urandom | head -c ${l} | xargs
}
# Shows the current PS list for the signed in user - Not cygwin compatible
myps() { ps $@ -u $USER -o pid,%cpu,%mem,bsdtime,command ; }
# Searches the process list (ps) for 1st argument
psgrep() {
if [ ! -z $1 ] ; then
echo "Grepping for processes matching $1..."
ps aux | grep $1 | grep -v grep
else
echo "!! Need name to grep for"
fi
}
# dirsize - finds directory sizes and lists them for the current directory
dirsize (){
du -shx * .[a-zA-Z0-9_]* 2> /dev/null | \
egrep '^ *[0-9.]*[MG]' | sort -n > /tmp/list
egrep '^ *[0-9.]*M' /tmp/list
egrep '^ *[0-9.]*G' /tmp/list
rm -rf /tmp/list
}
# Usage: up <Number of directories>. Blank for up one dir.
up() {
local d=""
limit=$1
for ((i=1; i <= limit; i++)); do
d=$d/..
done
d=$(echo $d | sed 's/^\///')
if [ -z "$d" ]; then
d=..
fi
cd $d
}
# Search inside files for a string
# Usage: search <regex string>
search () {
grep -r "$1" | fzf
}
# Search for a file by its name
# Usage: ff <filename> (optional) <max depth>
ff() { #find file
if [ -z "${2}" ]; then
find . -type f -iname "*${1}*"
else
find . -type f -maxdepth "${2}" -iname "*${1}*"
fi
}
# Search for a file by its name and edit it
# Usage: vf <filename> (optional) <max depth>
vf() { vim "$(ff "$@" | fzf)"; }
# Usage: replay <number of commands> to repeat. Blank for 1
replay() {
from="${1:-2}"
to="${2:-1}"
if [ "$from" -ne "$to" ]; then
for i in `seq "$from" -1 "$(($to + 1))"`; do
printf "$(fc -ln -${i} -${i}) && "
done
fi
$(fc -ln -${to} -${to})
}

View File

@@ -1,201 +0,0 @@
# 0 is too far from `
set -g base-index 1
# Turn on mouse stuff
set-option -g mouse off
# Turn off automatic window naming
set-option -g allow-rename off
# Unbind the Page keys as they interfere with VIM
unbind Pageup
unbind Pagedown
# Change Kill window behavior
#unbind C-&
unbind &
bind k confirm kill-pane
bind K confirm kill-window
# Change our prefix to not have to move my fingers as far
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# Split with pipe and dash
bind | split-window -h
bind - split-window -v
unbind '"'
unbind %
# Reload with C-r
bind r source-file ~/.tmux.conf
# Switch Panes using Alt-arrow without prefix
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# Switch windows alt+number
bind-key -n M-1 select-window -t 1
bind-key -n M-2 select-window -t 2
bind-key -n M-3 select-window -t 3
bind-key -n M-4 select-window -t 4
bind-key -n M-5 select-window -t 5
bind-key -n M-6 select-window -t 6
bind-key -n M-7 select-window -t 7
bind-key -n M-8 select-window -t 8
bind-key -n M-9 select-window -t 9
bind-key -n M-0 select-window -t 0
# Resize panes without prefix
bind -n M-< resize-pane -L 1
bind -n M-> resize-pane -R 1
# Display visual indicator about which pane is what
bind-key w display-panes
# Sets tmux scrollback history
set -g history-limit 5000
# Syncronizes keys typed in one pane across all panes, press again to disable
bind-key y setw synchronize-panes
#
#######################
#### DESIGN CHANGES ###
#######################
#
## panes
#set -g pane-border-fg black
#set -g pane-active-border-fg brightred
#
### Status bar design
## status line
#set -g status-utf8 on
#set -g status-justify left
#set -g status-bg default
#set -g status-fg colour12
#set -g status-interval 2
#
## messaging
#set -g message-fg black
#set -g message-bg yellow
#set -g message-command-fg blue
#set -g message-command-bg black
#
##window mode
#setw -g mode-bg colour6
#setw -g mode-fg colour0
#
## window status
#setw -g window-status-format " #F#I:#W#F "
#setw -g window-status-current-format " #F#I:#W#F "
#setw -g window-status-format "#[fg=magenta]#[bg=black] #I #[bg=cyan]#[fg=colour8] #W "
#setw -g window-status-current-format "#[bg=brightmagenta]#[fg=colour8] #I #[fg=colour8]#[bg=colour14] #W "
#setw -g window-status-current-bg colour0
#setw -g window-status-current-fg colour11
#setw -g window-status-current-attr dim
#setw -g window-status-bg green
#setw -g window-status-fg black
#setw -g window-status-attr reverse
#
## Info on left (I don't have a session display for now)
#set -g status-left ''
#
## loud or quiet?
#set-option -g visual-activity off
#set-option -g visual-bell off
#set-option -g visual-silence off
#set-window-option -g monitor-activity off
#set-option -g bell-action none
#
## Colors
#set -g default-terminal "screen-256color"
#
## The modes {
#setw -g clock-mode-colour colour135
#setw -g mode-attr bold
#setw -g mode-fg colour196
#setw -g mode-bg colour238
#
## }
## The panes {
#
#set -g pane-border-bg colour235
#set -g pane-border-fg colour238
#set -g pane-active-border-bg colour236
#set -g pane-active-border-fg colour51
#
## }
## The statusbar {
#
#set -g status-position bottom
#set -g status-bg colour234
#set -g status-fg colour137
#set -g status-attr dim
#set -g status-left '#{prefix_highlight}'
#set -g status-right '#{net_speed} #[fg=yellow]#(hostname)#[default] #[fg=colour234,bg=colour241,bold] %m/%d #[fg=colour233,bg=colour245,bold] %H:%M:%S '
#set -g status-right-length 70
#set -g status-left-length 4
#
#setw -g window-status-current-fg colour81
#setw -g window-status-current-bg colour238
#setw -g window-status-current-attr bold
#setw -g window-status-current-format ' #I#[fg=colour250]:#[fg=colour255]#W#[fg=colour50]#F '
#
#setw -g window-status-fg colour138
#setw -g window-status-bg colour235
#setw -g window-status-attr none
#setw -g window-status-format ' #I#[fg=colour237]:#[fg=colour250]#W#[fg=colour244]#F '
#
#setw -g window-status-bell-attr bold
#setw -g window-status-bell-fg colour255
#setw -g window-status-bell-bg colour1
#
## }
## The messages {
#
#set -g message-attr bold
#set -g message-fg colour232
#set -g message-bg colour166
#
## }
#
# Load Iceberg theme
source-file ~/.tmux/iceberg.tmux.conf
# Iceberg-specific settings
# Powerline separators
separator_left="\ue0b0"
separator_right="\ue0b2"
subseparator_left="\ue0b1"
subseparator_right="\ue0b3"
# List your plugins here
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-net-speed'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'tmux-plugins/tmux-sessionist'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
set -g @plugin 'tmux-plugins/tmux-logging'
set -g @plugin 'nhdaly/tmux-better-mouse-mode'
# Plugin settings here
set -g @continuum-restore 'on'
# Automatically install TPM plugins (eg. first launch)
setenv -g TMUX_PLUGIN_MANAGER_PATH '$HOME/.tmux/plugins/'
# Install TPM if it does not exist
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'

View File

@@ -1,57 +0,0 @@
" Syntax highlighting based on detected language
syntax on
" Iceberg theme - I also use this theme in VSCode
colorscheme iceberg
" Default GUI Window Geometry
if has("gui_running")
" Preferred window size
set lines=29 columns=105
endif
" Show tabs at the top of the editor
set showtabline=2
" Render newlines with '$'
" Render Tabs with '>-'
" Render Trailing Whitespace with '~'
" Extends and Precedes are for Line Wrapping
set list
set listchars=eol:$,tab:>-,trail:~,extends:>,precedes:<
" Turn on Line numbering
set number
" Highlight all strings that match search
set hlsearch
" Turn on Mouse Aware mode, does lots of stuff
" What we're most interested in is the fact that
" it won't let us highlight the line numbers
set mouse+=a
" Yank and Paste using the system clipboard
set clipboard=unnamedplus
" Convert tabs to spaces
" Tabs are 4 spaces wide
set tabstop=8 softtabstop=0 expandtab shiftwidth=4 smarttab
" Golang Specific stuff
" Go syntax highlighting
let g:go_highlight_fields = 1
let g:go_highlight_functions = 1
let g:go_highlight_function_calls = 1
let g:go_highlight_extra_types = 1
let g:go_highlight_operators = 1
" Auto formatting and importing
let g:go_fmt_autosave = 1
let g:go_fmt_command = "goimports"
" Status line types/signatures
let g:go_auto_type_info = 1
execute pathogen#infect()
filetype plugin indent on

View File

@@ -1,81 +0,0 @@
# Include our shared shell stuff
source ~/dotfiles/home/shell/env
source ~/dotfiles/home/shell/aliases
source ~/dotfiles/home/shell/functions
# History Settings
export HISTIGNORE="&:ls:[bf]g:exit:reset:clear:cd:cd ..:cd..:replay"
export HISTSIZE=25000
export HISTFILE=~/.zsh_history
export SAVEHIST=10000
setopt INC_APPEND_HISTORY
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_IGNORE_SPACE
setopt HIST_REDUCE_BLANKS
setopt HIST_VERIFY
# Say how long a command took, if it took more than 15 seconds
export REPORTTIME=15
# Prompts for confirmation after 'rm *' etc
# Helps avoid mistakes like 'rm * o' when 'rm *.o' was intended
setopt RM_STAR_WAIT
# Background processes aren't killed on exit of shell
setopt AUTO_CONTINUE
# Dont write over existing files with >, use >! instead
setopt NOCLOBBER
# Dont nice background processes
setopt NO_BG_NICE
# Makes Alt-s insert a sudo at beginning of prompt
function insert_sudo {
if [[ $BUFFER != "sudo "* ]]; then
BUFFER="sudo $BUFFER"; CURSOR+=6
fi
}
zle -N insert-sudo insert_sudo
bindkey "^[s" insert-sudo
# Check for updates...
# Stolen and modified Oh-My-ZSH's update system
if [ "$DISABLE_DOTFILES_AUTO_UPDATE" != "true" ]; then
env ZSH=$ZSH _DOTFILES=$_DOTFILES DISABLE_UPDATE_PROMPT=$DISABLE_DOTFILES_UPDATE_PROMPT zsh -f $_DOTFILES/internal_bin/check_for_upgrade.sh
fi
# Oh-My-ZSH Options below this line
# Define Oh-My-ZSH root
ZSH=$HOME/.oh-my-zsh
# Would you like to use another custom folder than $ZSH/custom?
ZSH_CUSTOM=$_DOTFILES/omz
# Theme for Oh-My-ZSH
ZSH_THEME="darkblood"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
COMPLETION_WAITING_DOTS="true"
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git \
catimg \
fancy-ctrl-z \
emoji \
aws \
jsontools \
zsh-syntax-highlighting) # zsh-syntax-highlighting must remain the last plugin
# Load oh-my-zsh
source $ZSH/oh-my-zsh.sh