Begin moving to new XDG compliant directory structure
This commit is contained in:
parent
50c1b6cacb
commit
5e50aafcd0
23 changed files with 27 additions and 8 deletions
27
.config/zsh/01-history
Normal file
27
.config/zsh/01-history
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
### Set ZSH History defaults
|
||||
|
||||
# set some history options
|
||||
setopt append_history
|
||||
setopt extended_history
|
||||
setopt hist_expire_dups_first
|
||||
setopt hist_ignore_all_dups
|
||||
setopt hist_ignore_dups
|
||||
setopt hist_ignore_space
|
||||
setopt hist_reduce_blanks
|
||||
setopt hist_save_no_dups
|
||||
setopt hist_verify
|
||||
|
||||
# Share your history across all your terminal windows
|
||||
setopt share_history
|
||||
#setopt noclobber
|
||||
|
||||
# set some more options
|
||||
setopt pushd_ignore_dups
|
||||
#setopt pushd_silent
|
||||
|
||||
# Keep a ton of history.
|
||||
HISTSIZE=100000
|
||||
SAVEHIST=100000
|
||||
HISTFILE=~/.zsh_history
|
||||
export HISTIGNORE="ls:cd:cd -:pwd:exit:date:* --help"
|
||||
|
||||
14
.config/zsh/02-inline-glob-expansion
Normal file
14
.config/zsh/02-inline-glob-expansion
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
# Expand aliases inline - see http://blog.patshead.com/2012/11/automatically-expaning-zsh-global-aliases---simplified.html
|
||||
globalias() {
|
||||
if [[ $LBUFFER =~ ' [A-Z0-9]+$' ]]; then
|
||||
zle _expand_alias
|
||||
zle expand-word
|
||||
fi
|
||||
zle self-insert
|
||||
}
|
||||
|
||||
zle -N globalias
|
||||
|
||||
bindkey " " globalias
|
||||
bindkey "^ " magic-space # control-space to bypass completion
|
||||
bindkey -M isearch " " magic-space # normal space during searches
|
||||
11
.config/zsh/03-screen-information-dialog
Normal file
11
.config/zsh/03-screen-information-dialog
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
# deal with screen, if we're using it - courtesy MacOSXHints.com
|
||||
# Login greeting ------------------
|
||||
if [ "$TERM" = "screen" -a ! "$SHOWED_SCREEN_MESSAGE" = "true" ]; then
|
||||
detached_screens=$(screen -list | grep Detached)
|
||||
if [ ! -z "$detached_screens" ]; then
|
||||
echo "+---------------------------------------+"
|
||||
echo "| Detached screens are available: |"
|
||||
echo "$detached_screens"
|
||||
echo "+---------------------------------------+"
|
||||
fi
|
||||
fi
|
||||
20
.config/zsh/04-set-up-dotfiles-repo-management
Normal file
20
.config/zsh/04-set-up-dotfiles-repo-management
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# enables git management through dotfiles command
|
||||
alias dotfiles='/usr/bin/git --git-dir=/home/marty/.dotfiles/ --work-tree=/home/marty'
|
||||
alias df=dotfiles
|
||||
|
||||
## Make git assume the readme is not changing (essentially ignore it).
|
||||
#
|
||||
# This means you can safely remove the README.md file from your home dir
|
||||
# without git trying to delete it from the repository.
|
||||
# If you WANT to make changes to the README.md, you will have to make git
|
||||
# watch it again with the commented out command
|
||||
#
|
||||
# Read more: https://stackoverflow.com/questions/4308610/how-to-ignore-certain-files-in-git
|
||||
# and: https://stackoverflow.com/questions/653454/how-do-you-make-git-ignore-files-without-using-gitignore
|
||||
#
|
||||
#dotfiles update-index --no-assume-unchanged README.md
|
||||
|
||||
dotfiles update-index --assume-unchanged README.md
|
||||
|
||||
## Make git not show untracked files (i.e. ALL other files in your home dir)
|
||||
dotfiles config status.showUntrackedFiles no
|
||||
1
.config/zsh/05-set-locale-to-us-utf8
Normal file
1
.config/zsh/05-set-locale-to-us-utf8
Normal file
|
|
@ -0,0 +1 @@
|
|||
export LC_ALL="en_US.utf-8"
|
||||
4
.config/zsh/10-report-time-for-long-running-processes
Normal file
4
.config/zsh/10-report-time-for-long-running-processes
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
# Long running processes should return time after they complete. Specified
|
||||
# in seconds.
|
||||
REPORTTIME=2
|
||||
TIMEFMT="%U user %S system %P cpu %*Es total"
|
||||
232
.config/zsh/12-ssh-agent-autoconfiguration
Normal file
232
.config/zsh/12-ssh-agent-autoconfiguration
Normal file
|
|
@ -0,0 +1,232 @@
|
|||
## Integration at the Bottom
|
||||
|
||||
# Copyright (C) 2011 by Wayne Walker <wwalker@solid-constructs.com>
|
||||
#
|
||||
# Released under one of the versions of the MIT License.
|
||||
#
|
||||
# Copyright (C) 2011 by Wayne Walker <wwalker@solid-constructs.com>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
|
||||
_LIVE_AGENT_LIST=""
|
||||
declare -a _LIVE_AGENT_SOCK_LIST
|
||||
_LIVE_AGENT_SOCK_LIST=()
|
||||
|
||||
_debug_print() {
|
||||
if [[ $_DEBUG -gt 0 ]]
|
||||
then
|
||||
printf "%s\n" $1
|
||||
fi
|
||||
}
|
||||
|
||||
find_all_ssh_agent_sockets() {
|
||||
_SSH_AGENT_SOCKETS=`find /tmp/ -type s -name agent.\* 2> /dev/null | grep '/tmp/ssh-.*/agent.*'`
|
||||
_debug_print "$_SSH_AGENT_SOCKETS"
|
||||
}
|
||||
|
||||
find_all_gpg_agent_sockets() {
|
||||
_GPG_AGENT_SOCKETS=`find /tmp/ -type s -name S.gpg-agent.ssh 2> /dev/null | grep '/tmp/gpg-.*/S.gpg-agent.ssh'`
|
||||
_debug_print "$_GPG_AGENT_SOCKETS"
|
||||
}
|
||||
|
||||
find_all_gnome_keyring_agent_sockets() {
|
||||
_GNOME_KEYRING_AGENT_SOCKETS=`find /tmp/ -type s -name ssh 2> /dev/null | grep '/tmp/keyring-.*/ssh$'`
|
||||
_debug_print "$_GNOME_KEYRING_AGENT_SOCKETS"
|
||||
}
|
||||
|
||||
find_all_osx_keychain_agent_sockets() {
|
||||
[[ -n "$TMPDIR" ]] || TMPDIR=/tmp
|
||||
_OSX_KEYCHAIN_AGENT_SOCKETS=`find $TMPDIR/ -type s -regex '.*/ssh-.*/agent..*$' 2> /dev/null`
|
||||
_debug_print "$_OSX_KEYCHAIN_AGENT_SOCKETS"
|
||||
}
|
||||
|
||||
test_agent_socket() {
|
||||
local SOCKET=$1
|
||||
SSH_AUTH_SOCK=$SOCKET ssh-add -l 2> /dev/null > /dev/null
|
||||
result=$?
|
||||
|
||||
_debug_print $result
|
||||
|
||||
if [[ $result -eq 0 ]]
|
||||
then
|
||||
# contactible and has keys loaded
|
||||
_KEY_COUNT=`SSH_AUTH_SOCK=$SOCKET ssh-add -l | wc -l | tr -d ' '`
|
||||
fi
|
||||
|
||||
if [[ $result -eq 1 ]]
|
||||
then
|
||||
# contactible butno keys loaded
|
||||
_KEY_COUNT=0
|
||||
fi
|
||||
|
||||
if [[ ( ( $result -eq 0 ) || ( $result -eq 1 ) ) ]]
|
||||
then
|
||||
if [[ -n "$_LIVE_AGENT_LIST" ]]
|
||||
then
|
||||
_LIVE_AGENT_LIST="${_LIVE_AGENT_LIST} ${SOCKET}:$_KEY_COUNT"
|
||||
else
|
||||
_LIVE_AGENT_LIST="${SOCKET}:$_KEY_COUNT"
|
||||
fi
|
||||
return 0
|
||||
fi
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
find_live_gnome_keyring_agents() {
|
||||
for i in $_GNOME_KEYRING_AGENT_SOCKETS
|
||||
do
|
||||
test_agent_socket $i
|
||||
done
|
||||
}
|
||||
|
||||
find_live_osx_keychain_agents() {
|
||||
for i in $_OSX_KEYCHAIN_AGENT_SOCKETS
|
||||
do
|
||||
test_agent_socket $i
|
||||
done
|
||||
}
|
||||
|
||||
find_live_gpg_agents() {
|
||||
for i in $_GPG_AGENT_SOCKETS
|
||||
do
|
||||
test_agent_socket $i
|
||||
done
|
||||
}
|
||||
|
||||
find_live_ssh_agents() {
|
||||
for i in $_SSH_AGENT_SOCKETS
|
||||
do
|
||||
test_agent_socket $i
|
||||
done
|
||||
}
|
||||
|
||||
function fingerprints() {
|
||||
local file="$1"
|
||||
while read l; do
|
||||
[[ -n $l && ${l###} = $l ]] && ssh-keygen -l -f /dev/stdin <<<$l
|
||||
done < $file
|
||||
}
|
||||
|
||||
find_all_agent_sockets() {
|
||||
_SHOW_IDENTITY=0
|
||||
if [ "$1" = "-i" ] ; then
|
||||
_SHOW_IDENTITY=1
|
||||
fi
|
||||
_LIVE_AGENT_LIST=
|
||||
find_all_ssh_agent_sockets
|
||||
find_all_gpg_agent_sockets
|
||||
find_all_gnome_keyring_agent_sockets
|
||||
find_all_osx_keychain_agent_sockets
|
||||
find_live_ssh_agents
|
||||
find_live_gpg_agents
|
||||
find_live_gnome_keyring_agents
|
||||
find_live_osx_keychain_agents
|
||||
_debug_print "$_LIVE_AGENT_LIST"
|
||||
_LIVE_AGENT_LIST=$(echo $_LIVE_AGENT_LIST | tr ' ' '\n' | sort -n -t: -k 2 -k 1 | uniq)
|
||||
_LIVE_AGENT_SOCK_LIST=()
|
||||
_debug_print "SORTED: $_LIVE_AGENT_LIST"
|
||||
if [ -e ~/.ssh/authorized_keys ] ; then
|
||||
_FINGERPRINTS=$(fingerprints ~/.ssh/authorized_keys)
|
||||
fi
|
||||
if [[ $_SHOW_IDENTITY -gt 0 ]]
|
||||
then
|
||||
i=0
|
||||
for a in $_LIVE_AGENT_LIST ; do
|
||||
sock=${a/:*/}
|
||||
_LIVE_AGENT_SOCK_LIST[$i]=$sock
|
||||
# technically we could have multiple keys forwarded
|
||||
# But I haven't seen anyone do it
|
||||
akeys=$(SSH_AUTH_SOCK=$sock ssh-add -l)
|
||||
key_size=$(echo ${akeys} | awk '{print $1}')
|
||||
fingerprint=$(echo ${akeys} | awk '{print $2}')
|
||||
remote_name=$(echo ${akeys} | awk '{print $3}')
|
||||
if [ -e ~/.ssh/authorized_keys ] ; then
|
||||
authorized_entry=$(fingerprints ~/.ssh/authorized_keys | grep $fingerprint)
|
||||
fi
|
||||
comment=$(echo ${authorized_entry} | awk '{print $3,$4,$5,$6,$7}')
|
||||
printf "export SSH_AUTH_SOCK=%s \t#%i) \t%s\n" "$sock" $((i+1)) "$comment"
|
||||
i=$((i+1))
|
||||
done
|
||||
else
|
||||
printf "%s\n" "$_LIVE_AGENT_LIST" | sed -e 's/ /\n/g' | sort -n -t: -k 2 -k 1
|
||||
fi
|
||||
}
|
||||
|
||||
set_ssh_agent_socket() {
|
||||
if [ "$1" = "-c" -o "$1" = "--choose" ]
|
||||
then
|
||||
find_all_agent_sockets -i
|
||||
|
||||
if [ -z "$_LIVE_AGENT_LIST" ] ; then
|
||||
echo "No agents found"
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo -n "Choose (1-${#_LIVE_AGENT_SOCK_LIST[@]})? "
|
||||
read choice
|
||||
if [ -n "$choice" ]
|
||||
then
|
||||
n=$((choice-1))
|
||||
if [ -z "${_LIVE_AGENT_SOCK_LIST[$n]}" ] ; then
|
||||
echo "Invalid choice"
|
||||
return 1
|
||||
fi
|
||||
echo "Setting export SSH_AUTH_SOCK=${_LIVE_AGENT_SOCK_LIST[$n]}"
|
||||
export SSH_AUTH_SOCK=${_LIVE_AGENT_SOCK_LIST[$n]}
|
||||
fi
|
||||
else
|
||||
# Choose the first available
|
||||
SOCK=$(find_all_agent_sockets|tail -n 1|awk -F: '{print $1}')
|
||||
if [ -z "$SOCK" ] ; then
|
||||
return 1
|
||||
fi
|
||||
export SSH_AUTH_SOCK=$SOCK
|
||||
fi
|
||||
|
||||
# set agent pid
|
||||
if [ -n "$SSH_AUTH_SOCK" ] ; then
|
||||
export SSH_AGENT_PID=$((`echo $SSH_AUTH_SOCK | cut -d. -f2` + 1))
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
ssh-find-agent() {
|
||||
if [ "$1" = "-c" -o "$1" = "--choose" ]
|
||||
then
|
||||
set_ssh_agent_socket -c
|
||||
return $?
|
||||
elif [ "$1" = "-a" -o "$1" = "--auto" ]
|
||||
then
|
||||
set_ssh_agent_socket
|
||||
return $?
|
||||
else
|
||||
find_all_agent_sockets -i
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
# Automatically add ssh-agent to any new ssh connection
|
||||
ssh-find-agent -a
|
||||
if [ -z "$SSH_AUTH_SOCK" ]
|
||||
then
|
||||
eval $(ssh-agent) > /dev/null
|
||||
ssh-add -l >/dev/null || alias ssh='ssh-add -l >/dev/null || ssh-add && unalias ssh; ssh'
|
||||
fi
|
||||
11
.config/zsh/13-command-spelling-correction
Normal file
11
.config/zsh/13-command-spelling-correction
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
# Correct spelling for commands
|
||||
setopt correct
|
||||
|
||||
# turn off the infernal correctall for filenames
|
||||
unsetopt correctall
|
||||
|
||||
# Enable command auto-correction.
|
||||
ENABLE_CORRECTION="true"
|
||||
|
||||
# Display red dots whilst waiting for completion.
|
||||
COMPLETION_WAITING_DOTS="true"
|
||||
40
.config/zsh/15-theme-powerlevel9k
Normal file
40
.config/zsh/15-theme-powerlevel9k
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
POWERLEVEL9K_MODE='nerdfont-complete'
|
||||
#POWERLEVEL9K_SHORTEN_DIR_LENGTH=1
|
||||
#POWERLEVEL9K_SHORTEN_DELIMITER=""
|
||||
#POWERLEVEL9K_SHORTEN_STRATEGY="truncate_from_right"
|
||||
POWERLEVEL9K_PROMPT_ON_NEWLINE=true
|
||||
POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR=''
|
||||
POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR=''
|
||||
POWERLEVEL9K_LEFT_SUBSEGMENT_SEPARATOR=''
|
||||
POWERLEVEL9K_RIGHT_SUBSEGMENT_SEPARATOR=''
|
||||
POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX="%F{blue}\u256D\u2500%F{white}"
|
||||
POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX="%F{blue}\u2570\uf460%F{white} "
|
||||
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(root_indicator dir dir_writable_joined)
|
||||
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(command_execution_time
|
||||
vcs background_jobs_joined time_joined)
|
||||
POWERLEVEL9K_VCS_MODIFIED_BACKGROUND="clear"
|
||||
POWERLEVEL9K_VCS_UNTRACKED_BACKGROUND="clear"
|
||||
POWERLEVEL9K_VCS_MODIFIED_FOREGROUND="yellow"
|
||||
POWERLEVEL9K_VCS_UNTRACKED_FOREGROUND="yellow"
|
||||
POWERLEVEL9K_DIR_HOME_BACKGROUND="clear"
|
||||
POWERLEVEL9K_DIR_HOME_FOREGROUND="blue"
|
||||
POWERLEVEL9K_DIR_HOME_SUBFOLDER_BACKGROUND="clear"
|
||||
POWERLEVEL9K_DIR_HOME_SUBFOLDER_FOREGROUND="blue"
|
||||
POWERLEVEL9K_DIR_WRITABLE_FORBIDDEN_BACKGROUND="clear"
|
||||
POWERLEVEL9K_DIR_WRITABLE_FORBIDDEN_FOREGROUND="red"
|
||||
POWERLEVEL9K_DIR_DEFAULT_BACKGROUND="clear"
|
||||
POWERLEVEL9K_DIR_DEFAULT_FOREGROUND="white"
|
||||
POWERLEVEL9K_ROOT_INDICATOR_BACKGROUND="red"
|
||||
POWERLEVEL9K_ROOT_INDICATOR_FOREGROUND="white"
|
||||
POWERLEVEL9K_STATUS_OK_BACKGROUND="clear"
|
||||
POWERLEVEL9K_STATUS_OK_FOREGROUND="green"
|
||||
POWERLEVEL9K_STATUS_ERROR_BACKGROUND="clear"
|
||||
POWERLEVEL9K_STATUS_ERROR_FOREGROUND="red"
|
||||
POWERLEVEL9K_TIME_BACKGROUND="clear"
|
||||
POWERLEVEL9K_TIME_FOREGROUND="cyan"
|
||||
POWERLEVEL9K_COMMAND_EXECUTION_TIME_BACKGROUND='clear'
|
||||
POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND='magenta'
|
||||
POWERLEVEL9K_BACKGROUND_JOBS_BACKGROUND='clear'
|
||||
POWERLEVEL9K_BACKGROUND_JOBS_FOREGROUND='green'
|
||||
|
||||
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=250"
|
||||
13
.config/zsh/16-install-tmux-plugin-manager
Normal file
13
.config/zsh/16-install-tmux-plugin-manager
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
# Clone tmux plugin manager if not existing
|
||||
if [[ -z "$TPM_PARENT_DIR" ]]; then
|
||||
TPM_PARENT_DIR=$HOME
|
||||
fi
|
||||
if [[ ! -f $TPM_PARENT_DIR/.tmux/plugins/tpm/tpm ]]; then
|
||||
if [[ ! -d "$TPM_PARENT_DIR" ]]; then
|
||||
mkdir -p "$TPM_PARENT_DIR"
|
||||
fi
|
||||
pushd $TPM_PARENT_DIR
|
||||
git clone https://github.com/tmux-plugins/tpm ./.tmux/plugins/tpm
|
||||
popd
|
||||
fi
|
||||
unset TPM_PARENT_DIR
|
||||
55
.config/zsh/20-essential
Normal file
55
.config/zsh/20-essential
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
echo "Creating a zgen save"
|
||||
ZGEN_LOADED=()
|
||||
ZGEN_COMPLETIONS=()
|
||||
|
||||
zgen oh-my-zsh
|
||||
|
||||
# If you want to customize your plugin list, create a file named
|
||||
# .zgen-local-plugins in your home directory. That file will be sourced
|
||||
# during startup *instead* of running this load-starter-plugin-list function,
|
||||
# so make sure to include everything from this function that you want to keep.
|
||||
|
||||
# If zsh-syntax-highlighting is bundled after zsh-history-substring-search,
|
||||
# they break, so get the order right.
|
||||
zgen load zdharma/fast-syntax-highlighting
|
||||
zgen load zsh-users/zsh-history-substring-search
|
||||
|
||||
# Set keystrokes for substring searching
|
||||
zmodload zsh/terminfo
|
||||
bindkey "$terminfo[kcuu1]" history-substring-search-up
|
||||
bindkey "$terminfo[kcud1]" history-substring-search-down
|
||||
|
||||
# Automatically run zgen update and zgen selfupdate every 7 days.
|
||||
zgen load unixorn/autoupdate-zgen
|
||||
|
||||
# Warn you when you run a command that you've set an alias for without
|
||||
# using the alias.
|
||||
zgen load djui/alias-tips
|
||||
|
||||
# Colorize the things if you have grc installed. Well, some of the
|
||||
# things, anyway.
|
||||
zgen load unixorn/warhol.plugin.zsh
|
||||
|
||||
zgen load chrissicool/zsh-256color
|
||||
|
||||
# Add Fish-like autosuggestions to your ZSH.
|
||||
zgen load zsh-users/zsh-autosuggestions
|
||||
|
||||
# k is a zsh script / plugin to make directory listings more readable,
|
||||
# adding a bit of color and some git status information on files and
|
||||
# directories.
|
||||
zgen load supercrabtree/k
|
||||
|
||||
# Bullet train prompt setup.
|
||||
zgen load bhilburn/powerlevel9k powerlevel9k
|
||||
|
||||
# automatically sources (known/whitelisted) .autoenv.zsh files
|
||||
# as long as you're in the folder (and can optionally 'unsource' on leaving)
|
||||
zgen load Tarrasch/zsh-autoenv
|
||||
|
||||
# radically enhanced cd command, all sorts of options
|
||||
zgen load b4b4r07/enhancd
|
||||
|
||||
# set up nvm, the npm version manager
|
||||
zgen load lukechilds/zsh-nvm
|
||||
|
||||
31
.config/zsh/21-integrations
Normal file
31
.config/zsh/21-integrations
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
if [ $(uname -a | grep -ci Darwin) = 1 ]; then
|
||||
# Load macOS-specific plugins
|
||||
zgen oh-my-zsh plugins/brew
|
||||
zgen oh-my-zsh plugins/osx
|
||||
fi
|
||||
|
||||
# Add git helper scripts.
|
||||
zgen load unixorn/git-extra-commands
|
||||
|
||||
# Tom Limoncelli's tooling for storing private information (keys, etc)
|
||||
# in a repository securely by encrypting them with gnupg.
|
||||
zgen load StackExchange/blackbox
|
||||
|
||||
# Load some oh-my-zsh plugins
|
||||
zgen oh-my-zsh plugins/pip
|
||||
zgen oh-my-zsh plugins/sudo
|
||||
zgen oh-my-zsh plugins/aws
|
||||
zgen oh-my-zsh plugins/chruby
|
||||
zgen oh-my-zsh plugins/colored-man-pages
|
||||
zgen oh-my-zsh plugins/git
|
||||
zgen oh-my-zsh plugins/github
|
||||
zgen oh-my-zsh plugins/python
|
||||
zgen oh-my-zsh plugins/rsync
|
||||
zgen oh-my-zsh plugins/screen
|
||||
zgen oh-my-zsh plugins/vagrant
|
||||
zgen oh-my-zsh plugins/autojump
|
||||
zgen oh-my-zsh plugins/tmux
|
||||
zgen oh-my-zsh plugins/tmuxinator
|
||||
|
||||
# when in a directory with vagrant/docker files can use start, stop, up, down
|
||||
zgen load Cloudstek/zsh-plugin-appup
|
||||
16
.config/zsh/22-autocompletions
Normal file
16
.config/zsh/22-autocompletions
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
# Load more completion files for zsh from the zsh-lovers github repo.
|
||||
zgen load zsh-users/zsh-completions src
|
||||
|
||||
# Docker completion
|
||||
zgen load srijanshetty/docker-zsh
|
||||
|
||||
# Very cool plugin that generates zsh completion functions for commands
|
||||
# if they have getopt-style help text. It doesn't generate them on the fly,
|
||||
# you'll have to explicitly generate a completion, but it's still quite cool.
|
||||
zgen load RobSis/zsh-completion-generator
|
||||
|
||||
# Tab complete rakefile targets.
|
||||
zgen load unixorn/rake-completion.zshplugin
|
||||
|
||||
# Load me last
|
||||
GENCOMPL_FPATH=$HOME/.zsh/complete
|
||||
13
.config/zsh/30-configure-autocompletion
Normal file
13
.config/zsh/30-configure-autocompletion
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
# Speed up autocomplete, force prefix mapping
|
||||
zstyle ':completion:*' accept-exact '*(N)'
|
||||
zstyle ':completion:*' use-cache on
|
||||
zstyle ':completion:*' cache-path ~/.zsh/cache
|
||||
zstyle -e ':completion:*:default' list-colors 'reply=("${PREFIX:+=(#bi)($PREFIX:t)*==34=34}:${(s.:.)LS_COLORS}")';
|
||||
|
||||
# Load any custom zsh completions we've installed
|
||||
if [ -d ~/.zsh-completions ]; then
|
||||
for completion in ~/.zsh-completions/*
|
||||
do
|
||||
source "$completion"
|
||||
done
|
||||
fi
|
||||
19
.config/zsh/31-deduplicate-path-variable
Normal file
19
.config/zsh/31-deduplicate-path-variable
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
# In case a plugin adds a redundant path entry, remove duplicate entries
|
||||
# from PATH
|
||||
#
|
||||
# This snippet is from Mislav Marohnić <mislav.marohnic@gmail.com>'s
|
||||
# dotfiles repo at https://github.com/mislav/dotfiles
|
||||
dedupe_path() {
|
||||
typeset -a paths result
|
||||
paths=($path)
|
||||
|
||||
while [[ ${#paths} -gt 0 ]]; do
|
||||
p="${paths[1]}"
|
||||
shift paths
|
||||
[[ -z ${paths[(r)$p]} ]] && result+="$p"
|
||||
done
|
||||
|
||||
export PATH=${(j+:+)result}
|
||||
}
|
||||
|
||||
dedupe_path
|
||||
22
.config/zsh/32-aliases-base
Normal file
22
.config/zsh/32-aliases-base
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
# Prettify ls commands
|
||||
if [[ "$(uname -s)" == "Linux" ]]; then
|
||||
# we're on linux
|
||||
alias l-d="ls -lFad"
|
||||
alias l="ls -lAhF" # Overwritten for k in -aliasing-k
|
||||
alias ll="ls -lFa | TERM=vt100 less"
|
||||
alias ls='ls --color=auto'
|
||||
fi
|
||||
|
||||
# Show the top 5 commands used in recent history
|
||||
alias historysummary="history | awk '{a[\$2]++} END{for(i in a){printf \"%5d\t%s\n\",a[i],i}}' | sort -rn | head"
|
||||
# Display timestamped recent command history
|
||||
alias zh="fc -l -d -D"
|
||||
|
||||
# Display your current ip address
|
||||
alias myip="curl -s icanhazip.com"
|
||||
|
||||
# move around faster for often used cd commands
|
||||
alias ..="cd .." # overwritten by enhancd config in .zshrc.d/
|
||||
alias ...="cd ../.."
|
||||
alias ~="cd ~"
|
||||
|
||||
4
.config/zsh/33-alias-mkcd
Normal file
4
.config/zsh/33-alias-mkcd
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
# mkdir & cd
|
||||
function mkcd {
|
||||
mkdir -p "$@" && cd $_
|
||||
}
|
||||
9
.config/zsh/34-alias-show-newest-files
Normal file
9
.config/zsh/34-alias-show-newest-files
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
# show newest files
|
||||
# http://www.commandlinefu.com/commands/view/9015/find-the-most-recently-changed-files-recursively
|
||||
newest (){
|
||||
find . -type f -printf '%TY-%Tm-%Td %TT %p\n' | \
|
||||
grep -v cache | \
|
||||
grep -v '.hg' | grep -v '.git' | \
|
||||
sort -r | \
|
||||
less
|
||||
}
|
||||
3
.config/zsh/35-alias-k-to-l
Normal file
3
.config/zsh/35-alias-k-to-l
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# uses k (installed with plugins) but makes it accessible through l as well
|
||||
alias k="k -h"
|
||||
alias l="k -A"
|
||||
4
.config/zsh/36-disable-enhancd-double-dot
Normal file
4
.config/zsh/36-disable-enhancd-double-dot
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
# Assumes enhancd is installed (via plugin)
|
||||
# Let's you go back a directory with .. (usual cd .. behavior)
|
||||
# Let's the enhancd backtrack menu appear with cd .. (usual enhancd behavior)
|
||||
alias ..="ENHANCD_DISABLE_DOT=1 cd .."
|
||||
5
.config/zsh/37-alias-ssh-tmux-attaching
Normal file
5
.config/zsh/37-alias-ssh-tmux-attaching
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
# automatically use tmux whenever we ssh to a server
|
||||
|
||||
function ssht(){
|
||||
ssh $* -t 'tmux a || tmux || /bin/bash'
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue