Naive fixing of linter errors

This commit is contained in:
Marty Oehme 2019-07-24 07:33:28 +02:00
parent 21c40fa774
commit ef73a11e51
27 changed files with 207 additions and 194 deletions

View file

@ -1,3 +1,5 @@
#!/bin/zsh
### Set ZSH History defaults
# set some history options
@ -20,8 +22,7 @@ setopt pushd_ignore_dups
#setopt pushd_silent
# Keep a ton of history.
HISTSIZE=100000
SAVEHIST=100000
export HISTSIZE=100000
export SAVEHIST=100000
HISTFILE=~/.zsh_history
export HISTIGNORE="ls:cd:cd -:pwd:exit:date:* --help"

View file

@ -1,6 +1,8 @@
#!/bin/zsh
#
# Expand aliases inline - see http://blog.patshead.com/2012/11/automatically-expaning-zsh-global-aliases---simplified.html
globalias() {
if [[ $LBUFFER =~ ' [A-Z0-9]+$' ]]; then
if [[ $LBUFFER =~ [A-Z0-9]+$ ]]; then
zle _expand_alias
zle expand-word
fi

View file

@ -1,3 +1,4 @@
#!/bin/zsh
# Clone zgen if you haven't already
check_zgen_installation() {
if [[ -z "$ZGEN_PARENT_DIR" ]]; then
@ -8,10 +9,11 @@ check_zgen_installation() {
if [[ ! -d "$ZGEN_PARENT_DIR" ]]; then
mkdir -p "$ZGEN_PARENT_DIR"
fi
pushd $ZGEN_PARENT_DIR
cd $ZGEN_PARENT_DIR || return
git clone https://github.com/tarjoilija/zgen.git $ZGEN_DIR
popd
fi
# shellcheck source=/home/marty/.config/zgen/zgen.zsh
# shellcheck disable=SC1091
source $ZGEN_DIR/zgen.zsh
unset ZGEN_PARENT_DIR
}
@ -34,8 +36,8 @@ load_plugins() {
# Set keystrokes for substring searching
zmodload zsh/terminfo
bindkey "$terminfo[kcuu1]" history-substring-search-up
bindkey "$terminfo[kcud1]" history-substring-search-down
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
@ -91,7 +93,7 @@ load_plugins() {
zgen oh-my-zsh plugins/screen
zgen oh-my-zsh plugins/vagrant
# check for autojump install before applying plugin
if [ type autojump >/dev/null 2>&1 ]; then
if type autojump >/dev/null 2>&1; then
zgen oh-my-zsh plugins/autojump
fi
zgen oh-my-zsh plugins/tmux

View file

@ -1,11 +1,12 @@
#!/bin/zsh
# deal with screen, if we're using it - courtesy MacOSXHints.com
# Login greeting ------------------
if [ "$TERM" = "screen" -a ! "$SHOWED_SCREEN_MESSAGE" = "true" ]; then
if [ "$TERM" = "screen" ] && [ ! "$SHOWED_SCREEN_MESSAGE" = "true" ]; then
detached_screens=$(screen -list | grep Detached)
if [ ! -z "$detached_screens" ]; then
if [ -n "$detached_screens" ]; then
echo "+---------------------------------------+"
echo "| Detached screens are available: |"
echo "$detached_screens"
echo "+---------------------------------------+"
fi
fi
fi

View file

@ -1,3 +1,4 @@
#!/bin/zsh
# Correct spelling for commands
setopt correct
@ -8,4 +9,4 @@ unsetopt correctall
ENABLE_CORRECTION="true"
# Display red dots whilst waiting for completion.
COMPLETION_WAITING_DOTS="true"
COMPLETION_WAITING_DOTS="true"

View file

@ -1,4 +1,5 @@
#!/bin/zsh
# Long running processes should return time after they complete. Specified
# in seconds.
REPORTTIME=2
TIMEFMT="%U user %S system %P cpu %*Es total"
export REPORTTIME=2
export TIMEFMT="%U user %S system %P cpu %*Es total"

View file

@ -1,3 +1,5 @@
#!/bin/zsh
POWERLEVEL9K_MODE='nerdfont-complete'
#POWERLEVEL9K_SHORTEN_DIR_LENGTH=1
#POWERLEVEL9K_SHORTEN_DELIMITER=""

View file

@ -1,3 +1,5 @@
#!/bin/zsh
#
# Clone tmux plugin manager if not existing
if [[ -z "$TPM_PARENT_DIR" ]]; then
TPM_PARENT_DIR=${XDG_CONFIG_HOME:-$HOME/.config}/tmux
@ -7,14 +9,12 @@ if [[ ! -f $TPM_PARENT_DIR/plugins/tpm/tpm ]]; then
if [[ ! -d "$TPM_PARENT_DIR" ]]; then
mkdir -p "$TPM_PARENT_DIR"
fi
pushd $TPM_PARENT_DIR
cd "$TPM_PARENT_DIR" || exit
git clone https://github.com/tmux-plugins/tpm plugins/tpm
popd
fi
export TMUX_PLUGIN_MANAGER_PATH=$TPM_PARENT_DIR/plugins
alias tmux="tmux -f ${TPM_PARENT_DIR}/tmux.conf"
alias tmux="tmux -f "'"${TPM_PARENT_DIR}"'"/tmux.conf"
unset TPM_PARENT_DIR
unset TPM_SUB_DIR

View file

@ -1,3 +1,4 @@
#!/bin/zsh
# uses k (installed with plugins) but makes it accessible through l as well
alias k="k -h"
alias l="k -A"
alias l="k -A"

View file

@ -1,4 +1,5 @@
#!/bin/zsh
# mkdir & cd
function mkcd {
mkdir -p "$@" && cd $_
mkdir -p "$@" && cd "$_" || return
}

View file

@ -1,3 +1,4 @@
#!/bin/zsh
# show newest files
# http://www.commandlinefu.com/commands/view/9015/find-the-most-recently-changed-files-recursively
newest (){

View file

@ -1,5 +1,6 @@
#!/bin/zsh
# automatically use tmux whenever we ssh to a server
function ssht(){
ssh $* -t 'tmux a || tmux || /bin/bash'
}
ssh "$@" -t 'tmux a || tmux || /bin/bash'
}

View file

@ -10,4 +10,4 @@ if [ -d ~/.zsh-completions ]; then
do
source "$completion"
done
fi
fi

View file

@ -1,3 +1,8 @@
#!/bin/zsh
# shellcheck disable=SC2206
# shellcheck disable=SC2179
# shellcheck disable=SC2154
# In case a plugin adds a redundant path entry, remove duplicate entries
# from PATH
#
@ -16,4 +21,4 @@ dedupe_path() {
export PATH=${(j+:+)result}
}
dedupe_path
dedupe_path

View file

@ -1,3 +1,4 @@
#!/bin/zsh
# 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)