dotfiles

My dotfiles, nothing really interesting to see ...
git clone https://git.onna.be/dotfiles.git
Log | Files | Refs | README

commit aa825c03ced2a59f65e79f3d7efd2e482d2186f4
parent 3d4268c4166a68132ca1a168fc4f197e6734c2a7
Author: Paco Esteban <paco@onna.be>
Date:   Fri, 22 Mar 2019 09:06:47 +0100

zsh aliases changes

Diffstat:
zsh/.zsh/aliases.zsh | 19++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/zsh/.zsh/aliases.zsh b/zsh/.zsh/aliases.zsh @@ -142,7 +142,16 @@ function mvsp() { zmv '* *' '$f:gs/ /_' } # Grep the history with 'h' -function h () { history 0 | grep $1 } +function h () { + if command -v rg + then + mycommand=rg + else + mycommand=grep + fi + + history 0 | $mycommand $1 +} # Curl alias to calculate response time. function curl_time() { curl -o /dev/null -Ls -w " \ @@ -183,13 +192,9 @@ function transfer() { } # function to copy main ssh keys to clipboard when needed function pubkey () { - KEY="id_rsa.pub" - if [[ "$1" == "pws" ]]; then - KEY="id_rsa-ps_festeban.pub" - fi - cat ${HOME}/.ssh/${KEY} |\ + ssh-add -L |grep 'cardno:000608115828' |\ ${=CLIP_COMMAND} - echo "=> Public key ($KEY) copied to clipboard." + echo "=> Public key copied to clipboard." } # poor man's pastebin service (and secure !) function pastesrv() {