From ecad7cfbba68231a54afdee78e2f256c78519db4 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 26 Oct 2016 14:23:33 +0200 Subject: zsh: load and save history --- tag-zsh/config/zsh/zshrc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tag-zsh/config/zsh') diff --git a/tag-zsh/config/zsh/zshrc b/tag-zsh/config/zsh/zshrc index 2a37b50..392343a 100644 --- a/tag-zsh/config/zsh/zshrc +++ b/tag-zsh/config/zsh/zshrc @@ -15,6 +15,10 @@ zplug "gerges/oh-my-zsh-jira-plus", as:plugin, if:"[[ ${(SN)HOST%spotcap} ]]" zplug "lukechilds/zsh-better-npm-completion", if:"[[ -n $commands[npm] ]]", nice:10 zplug "hlissner/zsh-autopair", nice:10 +HISTSIZE=3000 +SAVEHIST=10000 +HISTFILE=${XDG_CACHE_HOME:=$HOME/.cache}/zsh/history + WORDCHARS=${${WORDCHARS//[-.]}//[\/]} if [[ ${path[(I)$HOME/bin ]} ]] -- cgit 1.4.1 From 13c81a22ce6e9e206d47feb618e9ad5c9ac0ce28 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 31 Oct 2016 10:56:22 +0100 Subject: Reindent all the things --- LaunchAgents/gnu.emacs.daemon.plist | 26 ++--- hooks/post-up/emacs | 6 +- hooks/post-up/zsh | 22 ++-- host-ap-spotcap.local/config/zsh/zshenv.local | 2 +- tag-ssh/ssh/rc | 2 +- tag-zsh/config/zsh/zshenv | 26 ++--- tag-zsh/config/zsh/zshrc | 142 +++++++++++++------------- 7 files changed, 113 insertions(+), 113 deletions(-) mode change 100644 => 100755 tag-ssh/ssh/rc (limited to 'tag-zsh/config/zsh') diff --git a/LaunchAgents/gnu.emacs.daemon.plist b/LaunchAgents/gnu.emacs.daemon.plist index ecce7db..873e28f 100644 --- a/LaunchAgents/gnu.emacs.daemon.plist +++ b/LaunchAgents/gnu.emacs.daemon.plist @@ -2,18 +2,18 @@ - ServiceDescription - Gnu Emacs Daemon - ProgramArguments - - /Applications/Emacs.app/Contents/MacOS/Emacs - --daemon - - RunAtLoad - - WorkingDirectory - /Users/alan - Label - gnu.emacs.daemon + ServiceDescription + Gnu Emacs Daemon + ProgramArguments + + /Applications/Emacs.app/Contents/MacOS/Emacs + --daemon + + RunAtLoad + + WorkingDirectory + /Users/alan + Label + gnu.emacs.daemon diff --git a/hooks/post-up/emacs b/hooks/post-up/emacs index aad74be..cb9c091 100755 --- a/hooks/post-up/emacs +++ b/hooks/post-up/emacs @@ -2,8 +2,8 @@ if [[ -s $commands[emacs] ]] then - pushd ~/.emacs.d - emacs --batch --eval "(progn + pushd ~/.emacs.d + emacs --batch --eval "(progn (setq vc-follow-symlinks nil) (find-file \"init.org\") (require 'ob-tangle) @@ -11,5 +11,5 @@ then (byte-compile-file \"init.el\") (load-file \"init.el\") )" - popd + popd fi diff --git a/hooks/post-up/zsh b/hooks/post-up/zsh index b7a7d4a..3eef6e5 100755 --- a/hooks/post-up/zsh +++ b/hooks/post-up/zsh @@ -4,26 +4,26 @@ ZDOTDIR="${XDG_CONFIG_HOME:=~/.config}/zsh" pushd $ZDOTDIR for f in z*(-.) do - if [[ -e .$f ]] - then - if [[ ! -h .$f ]] - then - echo ".$f already exists as a regular file, ignoring" - fi - else - ln -s $f .$f - fi + if [[ -e .$f ]] + then + if [[ ! -h .$f ]] + then + echo ".$f already exists as a regular file, ignoring" + fi + else + ln -s $f .$f + fi done popd if [[ ! -d ~/.cache/zsh ]] then - mkdir -p ~/.cache/zsh + mkdir -p ~/.cache/zsh fi if [[ -z $commands[zplug] && ! -d ~/projects/zplug/ ]] then - git clone git://github.com/zplug/zplug ~/projects/zplug/ + git clone git://github.com/zplug/zplug ~/projects/zplug/ fi zsh -ic "zplug install" diff --git a/host-ap-spotcap.local/config/zsh/zshenv.local b/host-ap-spotcap.local/config/zsh/zshenv.local index f6881be..55a6031 100644 --- a/host-ap-spotcap.local/config/zsh/zshenv.local +++ b/host-ap-spotcap.local/config/zsh/zshenv.local @@ -1,5 +1,5 @@ # -*- mode: sh; -*- if [[ -e $HOME/.nix-profile/etc/profile.d/nix.sh ]] then - . $HOME/.nix-profile/etc/profile.d/nix.sh; + . $HOME/.nix-profile/etc/profile.d/nix.sh; fi diff --git a/tag-ssh/ssh/rc b/tag-ssh/ssh/rc old mode 100644 new mode 100755 index 7b6da3a..59e4cfd --- a/tag-ssh/ssh/rc +++ b/tag-ssh/ssh/rc @@ -1,5 +1,5 @@ #!/bin/sh if [ "$SSH_AUTH_SOCK" ] then - ln -sf $SSH_AUTH_SOCK ~/.ssh/ssh_auth_sock + ln -sf $SSH_AUTH_SOCK ~/.ssh/ssh_auth_sock fi diff --git a/tag-zsh/config/zsh/zshenv b/tag-zsh/config/zsh/zshenv index 9389353..86efc02 100644 --- a/tag-zsh/config/zsh/zshenv +++ b/tag-zsh/config/zsh/zshenv @@ -1,19 +1,19 @@ if [[ $SHLVL -eq 1 || (-n $DISPLAY && $SHLVL -lt 3) ]] then - if [[ -f $ZDOTDIR/zshenv.local ]] - then - . $ZDOTDIR/zshenv.local - fi + if [[ -f $ZDOTDIR/zshenv.local ]] + then + . $ZDOTDIR/zshenv.local + fi - if [[ -f $ZDOTDIR/zshenv.private ]] - then - . $ZDOTDIR/zshenv.private - fi + if [[ -f $ZDOTDIR/zshenv.private ]] + then + . $ZDOTDIR/zshenv.private + fi - ZPLUG_HOME=${ZPLUG_HOME:-~/projects/zplug} + ZPLUG_HOME=${ZPLUG_HOME:-~/projects/zplug} - if [[ -z $SSH_AUTH_SOCK ]] - then - export SSH_AUTH_SOCK=$XDG_RUNTIME_DIR/ssh-agent.socket - fi + if [[ -z $SSH_AUTH_SOCK ]] + then + export SSH_AUTH_SOCK=$XDG_RUNTIME_DIR/ssh-agent.socket + fi fi diff --git a/tag-zsh/config/zsh/zshrc b/tag-zsh/config/zsh/zshrc index 392343a..662ab66 100644 --- a/tag-zsh/config/zsh/zshrc +++ b/tag-zsh/config/zsh/zshrc @@ -7,8 +7,8 @@ zplug "clvv/fasd", hook-build:"PREFIX=$HOME make install" zplug "caarlos0/zsh-open-pr", as:plugin if [[ -n $commands[nix-env] ]] then - zplug "spwhitt/nix-zsh-completions", as:plugin - fpath=($fpath $ZPLUG_REPOS/spwhitt/nix-zsh-completions) + zplug "spwhitt/nix-zsh-completions", as:plugin + fpath=($fpath $ZPLUG_REPOS/spwhitt/nix-zsh-completions) fi zplug "gerges/oh-my-zsh-jira-plus", as:plugin, if:"[[ ${(SN)HOST%spotcap} ]]" @@ -23,17 +23,17 @@ WORDCHARS=${${WORDCHARS//[-.]}//[\/]} if [[ ${path[(I)$HOME/bin ]} ]] then - path+=($HOME/bin) + path+=($HOME/bin) fi export EDITOR=emacsclient alias ec=emacsclient alias open-project=projectile _emacs_function () { - emacsclient -e "($1 \"$2\")" > /dev/null + emacsclient -e "($1 \"$2\")" > /dev/null } projectile () { - _emacs_function projectile-switch-project-by-name ${1:-$PWD} + _emacs_function projectile-switch-project-by-name ${1:-$PWD} } ls='\ls' @@ -43,25 +43,25 @@ bsd_ls_options="-p" bsd_ls_isodate="-D '%F %k:%M'" case $OSTYPE in - darwin*) - if [[ -n $commands[gls] ]] - then - ls='\gls' - ls_options=$gnu_ls_options - ls_isodate=$gnu_ls_isodate - else - ls_options=$bsd_ls_options - ls_isodate=$bsd_ls_isodate - fi - ;; - freebsd*) - ls_options=$bsd_ls_options - ls_isodate=$bsd_ls_isodate - ;; - linux-gnu) - ls_options=$gnu_ls_options - ls_isodate=$gnu_ls_isodate - ;; + darwin*) + if [[ -n $commands[gls] ]] + then + ls='\gls' + ls_options=$gnu_ls_options + ls_isodate=$gnu_ls_isodate + else + ls_options=$bsd_ls_options + ls_isodate=$bsd_ls_isodate + fi + ;; + freebsd*) + ls_options=$bsd_ls_options + ls_isodate=$bsd_ls_isodate + ;; + linux-gnu) + ls_options=$gnu_ls_options + ls_isodate=$gnu_ls_isodate + ;; esac alias l="${ls} ${ls_options} -Bp" alias l1="${ls} ${ls_options} -1" @@ -79,19 +79,19 @@ bindkey '\e[3~' delete-char bindkey '\C-hd' describe-key-briefly backward-argument () { - local WORDCHARS="\!\`~#@$%^&*()-_=+[{]}\|;:,<.>/?\'\"" - zle backward-word + local WORDCHARS="\!\`~#@$%^&*()-_=+[{]}\|;:,<.>/?\'\"" + zle backward-word } forward-argument () { - local WORDCHARS="\!\`~#@$%^&*()-_=+[{]}\|;:,<.>/?\'\"" - zle forward-word + local WORDCHARS="\!\`~#@$%^&*()-_=+[{]}\|;:,<.>/?\'\"" + zle forward-word } kill-argument () { - local WORDCHARS="\!\`~#@$%^&*()-_=+[{]}\|;:,<.>/?\'\"" - zle backward-argument - zle kill-word + local WORDCHARS="\!\`~#@$%^&*()-_=+[{]}\|;:,<.>/?\'\"" + zle backward-argument + zle kill-word } zle -N backward-argument @@ -102,92 +102,92 @@ bindkey '\e^f' forward-argument bindkey '\e^k' kill-argument ds () { - du -hd1 $1 | sort -h + du -hd1 $1 | sort -h } zle -C hist-complete complete-word _generic zstyle ':completion:hist-complete:*' completer _history -bindkey '\e ' hist-complete +bindkey '\e ' hist-complete zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' '+m:{A-Z}={a-z}' zstyle ':completion:*' completer _expand _complete _match if [[ -z $SSH_AUTH_SOCK && $commands[ssh-agent] ]] then - eval $(ssh-agent) + eval $(ssh-agent) fi if zplug check Tarrasch/zsh-autoenv then - AUTOENV_FILE_ENTER=.envrc - AUTOENV_HANDLE_LEAVE=0 - AUTOENV_LOOK_UPWARDS=1 + AUTOENV_FILE_ENTER=.envrc + AUTOENV_HANDLE_LEAVE=0 + AUTOENV_LOOK_UPWARDS=1 fi if zplug check gerges/oh-my-zsh-jira-plus then - JIRA_RAPID_BOARD=true + JIRA_RAPID_BOARD=true fi # Then, source plugins and add commands to $PATH zplug load # General configuration -setopt auto_cd # Change directories without `cd` +setopt auto_cd # Change directories without `cd` if zplug check zsh-users/zsh-completions then - autoload -U compinit && compinit + autoload -U compinit && compinit fi if [[ -n $commands[hub] ]] then - compdef _hub hub - alias git=hub - alias gh=hub + compdef _hub hub + alias git=hub + alias gh=hub fi if [[ -n $commands[lunchy] ]] then - LUNCHY_DIR=$(dirname $(gem which lunchy))/../extras - if [ -f $LUNCHY_DIR/lunchy-completion.zsh ]; then - . $LUNCHY_DIR/lunchy-completion.zsh - fi + LUNCHY_DIR=$(dirname $(gem which lunchy))/../extras + if [ -f $LUNCHY_DIR/lunchy-completion.zsh ]; then + . $LUNCHY_DIR/lunchy-completion.zsh + fi fi if [[ $TERM == "dumb" ]] then - PROMPT="> " + PROMPT="> " else - unset RPROMPT - # show username@host if logged in through SSH - [[ "$SSH_CONNECTION" != '' ]] && prompt_pure_username=' %F{242}%n@%m%f' + unset RPROMPT + # show username@host if logged in through SSH + [[ "$SSH_CONNECTION" != '' ]] && prompt_pure_username=' %F{242}%n@%m%f' - # show username@host if root, with username in white - [[ $UID -eq 0 ]] && prompt_pure_username=' %F{white}%n%f%F{242}@%m%f' + # show username@host if root, with username in white + [[ $UID -eq 0 ]] && prompt_pure_username=' %F{white}%n%f%F{242}@%m%f' - setopt prompt_subst - setopt prompt_cr - PROMPT='%F{blue}%~%f${prompt_pure_username} + setopt prompt_subst + setopt prompt_cr + PROMPT='%F{blue}%~%f${prompt_pure_username} %(?.%F{magenta}.%F{red})>%f ' fi if zplug check clvv/fasd then - if [[ -n $commands[fasd] ]] - then - _FASD_DATA="$HOME/.cache/zsh/fasd-data" - source =fasd - - fasd_cache="$HOME/.fasd-init-zsh" - if [ "$(command -v fasd)" -nt "$fasd_cache" -o ! -s "$fasd_cache" ]; then - fasd --init posix-alias zsh-hook zsh-ccomp zsh-ccomp-install >| "$fasd_cache" - fi - source "$fasd_cache" - unset fasd_cache - else - echo "no fasd" - fi + if [[ -n $commands[fasd] ]] + then + _FASD_DATA="$HOME/.cache/zsh/fasd-data" + source =fasd + + fasd_cache="$HOME/.fasd-init-zsh" + if [ "$(command -v fasd)" -nt "$fasd_cache" -o ! -s "$fasd_cache" ]; then + fasd --init posix-alias zsh-hook zsh-ccomp zsh-ccomp-install >| "$fasd_cache" + fi + source "$fasd_cache" + unset fasd_cache + else + echo "no fasd" + fi fi -unsetopt flow_control # Let me use ^S and ^Q +unsetopt flow_control # Let me use ^S and ^Q -- cgit 1.4.1 From 8040ffef312042bab871b30e3f99b928f6df3d3f Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 31 Oct 2016 13:22:10 +0100 Subject: npm/yarn: Install to ~/.local --- npmrc | 1 + tag-zsh/config/zsh/zshrc | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 npmrc (limited to 'tag-zsh/config/zsh') diff --git a/npmrc b/npmrc new file mode 100644 index 0000000..6804f65 --- /dev/null +++ b/npmrc @@ -0,0 +1 @@ +prefix = ${HOME}/.local/ \ No newline at end of file diff --git a/tag-zsh/config/zsh/zshrc b/tag-zsh/config/zsh/zshrc index 662ab66..f532750 100644 --- a/tag-zsh/config/zsh/zshrc +++ b/tag-zsh/config/zsh/zshrc @@ -26,6 +26,11 @@ then path+=($HOME/bin) fi +if [[ ${path[(I)$HOME/.local/bin ]} ]] +then + path+=($HOME/.local/bin) +fi + export EDITOR=emacsclient alias ec=emacsclient alias open-project=projectile @@ -35,6 +40,9 @@ _emacs_function () { projectile () { _emacs_function projectile-switch-project-by-name ${1:-$PWD} } +yarn () { + PREFIX=$HOME/.local command yarn "$@" +} ls='\ls' gnu_ls_options="-v --group-directories-first --color=auto" -- cgit 1.4.1