DEV Community

Discussion on: What is the best .zshrc config you have seen?

Collapse
b2aff6009 profile image
b2aff6009

Thanks for sharing. I improved my .zshrc a lot since I saw this post. As I use my .zshrc on different machines I implemented an update before the edit.
And as I search for quite often for some strings inside of files I wrote a "find in files" function

alias findr='\fd'
#function for find strings in files
fif() {
    findr --type f $1|xargs grep -n -i  $2
}

sourceZsh(){
    source ~/.zshrc
    backupToDrive ~/.zshrc
    echo "New .zshrc sourced."
}

editZsh(){
    updateYadm
    vim ~/.zshrc
    source ~/.zshrc
    backupToDrive ~/.zshrc
    echo "New .zshrc sourced."
}

updateYadm() {
    yadm pull
}

backupToDrive(){
    yadm add ~/.zshrc
    yadm commit -m "updated .zshrc"
    yadm push
    echo "New .zshrc backed up to yadm."
}
Enter fullscreen mode Exit fullscreen mode