diff --git a/bootstrap.sh b/bootstrap.sh index 0e5cc90..c4e365a 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -14,6 +14,7 @@ test -L $HOME/.gitignore || ln -f -s $BASEDIR/gitignore $HOME/.gitignore test -L $HOME/.hushlogin || ln -f -s $BASEDIR/hushlogin $HOME/.hushlogin test -d $HOME/.ncmpcpp || mkdir $HOME/.ncmpcpp test -L $HOME/.ncmpcpp/config || ln -f -s $BASEDIR/ncmpcpp $HOME/.ncmpcpp/config +test -L $HOME/.functions.zsh || ln -f -s $BASEDIR/functions.zsh $HOME/.functions.zsh test -L $HOME/.zshrc || ln -f -s $BASEDIR/zshrc $HOME/.zshrc # ln vim files diff --git a/functions.zsh b/functions.zsh new file mode 100644 index 0000000..4038253 --- /dev/null +++ b/functions.zsh @@ -0,0 +1,29 @@ +#!/usr/bin/env zsh + +# Functions + +# Generate TLS certs using a local CA +gencert () { + DOMAIN=$1 + + test -d /Users/jonny/Development/localCA && ROOT='/Users/jonny/Development/localCA' + test -d /home/jonny/git/ca && ROOT='/home/jonny/git/ca' + test -d /usr/local/opt/openssl@1.1/bin && PATH='/usr/local/opt/openssl@1.1/bin':$PATH + test -f /usr/local/etc/openssl@1.1/openssl.cnf && SSLCNF='/usr/local/etc/openssl@1.1/openssl.cnf' + test -f /etc/ssl/openssl.cnf && SSLCNF='/etc/ssl/openssl.cnf' + + cd $ROOT + [[ ! -d $DOMAIN ]] && mkdir $DOMAIN + cd $DOMAIN + [[ -f key ]] && mv key key.bak + [[ -f csr ]] && mv csr csr.bak + [[ -f crt ]] && mv crt crt.bak + + openssl ecparam -name secp384r1 -genkey -noout -out key + chmod 644 key + openssl req -new -sha256 -key key -subj "/C=UK/ST=England/L=Darwen/O=JMB Dev Ltd/CN=$DOMAIN" -reqexts SAN -config <(cat $SSLCNF <(printf "[SAN]\nsubjectAltName=DNS:$DOMAIN")) -out csr + openssl x509 -req -in csr -extfile <(cat $SSLCNF <(printf "[SAN]\nsubjectAltName=DNS:$DOMAIN")) -extensions SAN -CA ../jmb-ca-ecc.pem -CAkey ../jmb-ca-ecc.key -CAcreateserial -days 90 -sha256 -out crt + + cd $HOME + echo 'Certs generated for $DOMAIN' +} \ No newline at end of file diff --git a/gitconfig b/gitconfig index 1ba6c61..ab18430 100644 --- a/gitconfig +++ b/gitconfig @@ -1,11 +1,15 @@ [alias] - # lg + # list aliases + aliases = !git config --get-regexp 'alias.*' | colrm 1 6 | sed 's/[ ]/ = /' | sort + bdm = "!git branch --merged | grep -v '*' | xargs -n 1 git branch -d" lg = log --graph --pretty=tformat:'%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%an %ar)%Creset' - # lg2 lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all - # lastchange lastchange = log -p --follow -n 1 + plog = log --graph --pretty='format:%C(red)%d%C(reset) %C(yellow)%h%C(reset) %ar %C(green)%aN%C(reset) %s' + rank = shortlog -sn --no-merges + st = status -sb + tlog = log --stat --since='1 Day Ago' --graph --pretty=oneline --abbrev-commit --date=relative [apply] diff --git a/ncmpcpp b/ncmpcpp index e158d15..04bcc05 100644 --- a/ncmpcpp +++ b/ncmpcpp @@ -205,15 +205,15 @@ message_delay_time = 5 # #alternative_header_second_line_format = {{$4$b%a$/b$9}{ - $7%b$9}{ ($4%y$9)}}|{%D} # -#now_playing_prefix = $b +now_playing_prefix = $r # -#now_playing_suffix = $/b +now_playing_suffix = $/r # #browser_playlist_prefix = "$2playlist$9 " # -#selected_item_prefix = $6 +selected_item_prefix = $6 # -#selected_item_suffix = $9 +selected_item_suffix = $9 # #modified_item_prefix = $3> $9 # diff --git a/vim/vimrc b/vim/vimrc index d02a62e..0393247 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -199,6 +199,10 @@ nnoremap :echomsg "use j" nnoremap :echomsg "use j" nnoremap :echomsg "use l" +" And spell-checking +autocmd FileType gitcommit setlocal spell +set complete+=kspell + " Keymap to open NERDtree map :NERDTreeToggle " Autoclose when NERDtree is the last buffer diff --git a/zshrc b/zshrc index b310a22..75058b1 100644 --- a/zshrc +++ b/zshrc @@ -58,6 +58,11 @@ bindkey -v # Source the untracked `extra` file test -e $HOME/.extra && source $HOME/.extra +# Source VTE for Terminix +if [ $TERMINIX_ID ] || [ $VTE_VERSION ]; then + source /etc/profile.d/vte.sh +fi + # Determine the running OS platform="unkown" unamestr=$(uname -s) @@ -121,10 +126,12 @@ alias bubc="brew upgrade && brew cleanup" alias bubo="brew update && brew outdated" alias brewcurl="/usr/local/opt/curl/bin/curl --cacert /usr/local/etc/openssl/cert.pem" alias brewssl="/usr/local/opt/openssl@1.1/bin/openssl" +alias ga="git add" +alias gf="git fetch --all; git fetch --tags" +alias gs="git status" alias irc="ssh jmb -t '. ~/.zshrc; tmux attach -t irc'" test "$platform" = 'linux' && alias ls="ls -F --color=always" test "$platform" = 'osx' && alias ls="ls -FG" -alias phpunit="phpdbg -qrr vendor/bin/phpunit" test "$platform" = 'linux' && alias pipup="pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 sudo pip install -U" test "$platform" = 'osx' && alias pipup="pip3 freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip3 install -U" alias rtor="tmux attach -t rtor" @@ -146,7 +153,8 @@ auto-ls () { chpwd_functions=( auto-ls $chpwd_functions ) # Go Lang stuff -export GOPATH=$HOME/Development/go +test "$platform" = 'linux' && export GOPATH=$HOME/go +test "$platform" = 'osx' && export GOPATH=$HOME/Development/go export PATH="$PATH:/usr/local/opt/go/libexec/bin:$GOPATH/bin" # GnuPG stuff @@ -163,6 +171,9 @@ export PATH="$PATH:$HOME/.yarn/bin" # rust/cargo bin PATH export PATH="$PATH:$HOME/.cargo/bin" +# Ruby PATH +export PATH="$PATH:$HOME/.gem/ruby/2.4.0/bin" + # Set the DEFAULT_USER variable to me (jonny) export DEFAULT_USER="jonny" @@ -179,4 +190,7 @@ export LS_COLORS='di=33;40:ln=35;40:so=32;40:pi=33;40:ex=31;40:bd=34;46:cd=34;43 # They are packaged correctly for Arch Linux test "$platform" = 'osx' && fpath=(/usr/local/share/zsh-completions $fpath) +# Source my own functions +test -e $HOME/.functions.zsh && source $HOME/.functions.zsh + test -e ${HOME}/.iterm2_shell_integration.zsh && source ${HOME}/.iterm2_shell_integration.zsh