IDE Terminal House Keeping

I

I have no real idea why this happens, but my editor will start throwing errors that are well, cryptic. Missing config or profile files and compinit errors. Generally to be ignored by most of us, in the name of doing some housekeeping, I wanted to get rid of these nags.

[email protected] some-folder % 

/Users/drew/.zprofile:source:1: no such file or directory: /Users/drew/.profile

compinit:503: no such file or directory: /usr/local/share/zsh/site-functions/_brew_cask

You’re going to notice two errors here, first a missing .profile file, and the next some brew / zsh error.

That shouldn’t really matter because I have a .zshrc profile setup, so why I’m getting that I don’t know.

The compinit:503 I have no idea what it even is, but I did find the below command cleaned it up.

Two commands to clean these up:

touch ~/.profile will create a empty .profile file to get rid of that.

brew cleanup will get rid of the compinit:503 error.

Custom ZSH Settings

I have a custom .zshrc with a lot of settings I use often to create shortcuts to push to git and similar commonly used things I don’t want to fully type out. You can see that here.

You can also put these IN that .profile file we created, and maybe there’s some compatibility reason I’m unaware of that you may want to do that. I’ve never had an issue dropping stuff right in .zshrc though. So who knows.

# -------------------------------------------------------------------
# Open in Finder
# -------------------------------------------------------------------

function o() {
    if [[ $# -eq 0 ]]; then
        open .
    else
        open [email protected]
    fi
}

# -------------------------------------------------------------------
# Open in Visual Studio Code
# -------------------------------------------------------------------

function c() {
    if [[ $# -eq 0 ]]; then
        code .
    else
        code [email protected]
    fi
}

# -------------------------------------------------------------------
# Open in VIM
# -------------------------------------------------------------------

function v() {
    if [[ $# -eq 0 ]]; then
        vim
    else
        vim [email protected]
    fi
}

# -------------------------------------------------------------------
# NPM
# -------------------------------------------------------------------

alias start="npm start"
alias build="npm run build"

# -------------------------------------------------------------------
# Folders
# -------------------------------------------------------------------

hash -d documents=$HOME/Documents
hash -d downloads=$HOME/Downloads
hash -d spotfin=$HOME/Local\ Spotfin/

# -------------------------------------------------------------------
# Git
# -------------------------------------------------------------------
alias ga='git add .'
alias gp='git push'
alias gl='git log'
alias gs='git status'
alias gd='git diff'
alias gm='git commit -m'
alias gma='git commit -am'
alias gb='git branch'
alias gc='git checkout'
alias gra='git remote add'
alias grr='git remote rm'
alias gpu='git pull'
alias gcl='git clone'
alias gta='git tag -a -m'
alias gf='git reflog'
alias grh='git reset --hard'

# leverage an alias from the ~/.gitconfig
alias gh='git hist'

Something more powerful?

You might consider using oh-my-zsh if you want a really powerful, probably do too much terminal experience. It certainly takes a lot of thinking out of the equation but boy does it do A LOT.

I prefer the trimmed down zsh settings I have.

About the author

bmoredrew

I'm a software developer, product creator, and entrepreneur who focuses on Open Source software, specifically WordPress.

Add Comment

Follow Me