Jrapa86
Jrapa86

Reputation: 127

How to I fix custom alias from oh-my-zsh?

I am trying to create a custom file in my oh-my-zsh/custom folder so I can organize my aliases better. The problem is when I add it to my .oh-my-zsh/custom/aliases.zsh file, every time I restart my shell (I do it by command: source ~/.zshrc) it actually prints my alias at the top every time. How do I disable that from happening?

Is this an issue with my .zshrc file? I organized it a little nicer but maybe I broke a configuration somewhere. Can you see if there is anything wrong with my .zshrc? If not, what do you think the problem can be?

# ------------| .ZSHRC | ----------------
#----------------------------------------

# ------ Export Paths
export PATH=$HOME/bin:/usr/local/bin:$PATH
export ZSH="/Users/cnode/.oh-my-zsh" 
export PATH=$PATH:/opt/WebDriver/bin >> ~/.profile
export PATH=$PATH:/Users/cnode/Library/Application\ Support/Sublime\ Text\ 3/Packages/User/Deviot/penv/bin

# test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh"

export LANG=en_US.UTF-8
# ------ ZSH Config

ZSH_THEME="af-magic"
    #ZSH_THEME="robbyrussell"
    # ZSH_THEME="avit"
plugins=(git iterm2 z)



#-- For zsh-z
autoload -U compinit && compinit
# zstyle ':completion:*' menu select



# --------Preferred Editor
if [[ -n $SSH_CONNECTION ]]; then
  export EDITOR='subl -w'
else
  export EDITOR='vim'
fi



source $ZSH/oh-my-zsh.sh
source ~/.iterm2_shell_integration.zsh

# ------- Dir Browsing
d='dirs -v | head -10'
1='cd -'
2='cd -2'
3='cd -3'
4='cd -4'
5='cd -5'
6='cd -6'
7='cd -7'
8='cd -8'
9='cd -9'


# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
alias edit="subl ~/.zshrc"
alias editzsh="subl ~/.zshrc"
alias editomzsh="subl ~/.oh-my-zsh"
alias rst="source ~/.zshrc"
alias appid="appID"
alias cheat="vim ~/cube/cmdDoc/cheatsheet.txt"
alias cheatsheet="subl ~/cube/cmdDoc/cheatsheet.txt"
alias putbinhere='putbin'
alias connex='ssh [email protected]'
alias npmr='npm run'
alias npmi='npm install --save '
alias goto-hexo='cd /Users/cnode/cube/jsEnv/hexo/blog'
alias go-hexo='goto-hexo'



function hexotheme(){
    
    tmpDir='/Users/cnode/tmp/hexotheme.tmp'
    themeDir='/Users/cnode/cube/jsEnv/hexo/blog/themes'
    


    $(pwd)>>/Users/cnode/tmp/hexotheme.tmp
    cd $themeDir
    git clone `pbpaste`
    cd ~


}

function paste(){
    ps aux | pbcopy
    echo `pbpaste`
}


appID(){
    osascript -e 'id of app "'$1'"'
}

add_function(){
    newfxn=$(
       echo $1'(){'
       echo "${2}"
       echo '}'
    )
 echo $newfxn>>~/.zshrc
 rst
}

run(){
    sh $1'.sh'
}



makeExec(){
    FILE=$1
    chmod u+x $FILE
    echo $FILE' is now executable'
}

test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh"
export EDITOR='subl -w'

# Added Custom Functions from the command line 
#------------------------------------------

Upvotes: 0

Views: 2478

Answers (1)

user14364154
user14364154

Reputation: 26

dont put alias in .sh file source them like source ~/.config/zshalias also OMZ is a clustermess, avoid, you can achieve same/similar without it.

Upvotes: 1

Related Questions