Skip to content

Instantly share code, notes, and snippets.

/.bash_profile Secret

Created March 28, 2016 03:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/18ff3b8e39fc47eb8644 to your computer and use it in GitHub Desktop.
Save anonymous/18ff3b8e39fc47eb8644 to your computer and use it in GitHub Desktop.
#alias
alias vi=vim
#PS1
export PS1="\[\e[00;34m\]\u\[\e[0m\]\[\e[00;37m\]:@\[\e[0m\]\[\e[00;36m\]\W\[\e[0m\]\[\e[00;37m\]\\$\[\e[0m\]"
### Added by the Heroku Toolbelt
export GOROOT=`go env GOROOT`
export GOBIN=$GOROOT/bin/
export GOTOOLS=$GOROOT/pkg/tool/
export GOPATH=$HOME/src/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
export PATH=$PATH:"/usr/local/bin:/usr/local/heroku/bin:$PATH"
export KKDAI=$GOPATH/src/github.com/kkdai
#alias for golang debugging with GDB
alias god="go build -gcflags '-N -l'"
alias godrun="go build -gcflags '-N -l' -o debug && gdb debug"
#docker setting
#eval "$(docker-machine env default)"
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
Copy link

ghost commented Mar 28, 2016

#1

Convert aliases into functions to opt in fish autoloading, tl;dr alias is slow, functions are fast.

For example:

function vi
     vim $argv
end

function god
     go build -gcflags '-N -l' $argv
end

...

#2

For export, use set -x

For example:

set -x GOPATH $HOME/src/go

#3

In fish we use fish_prompt, a function, to customize our prompts. PS1 and all that monstrosity is not needed in fish. This is a good thing unless you are into heavy S/M 😆

function fish_prompt
    echo "$PWD >>> "
end

#4

Instead of

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

You could write

if test -s "$HOME/.rvm/scripts/rvm"
    source "$HOME/.rvm/scripts/rvm"
end

@kkdai
Copy link

kkdai commented Mar 28, 2016

Any suggestion about

export GOROOT=`go env GOROOT`

I change to

set -x GOROOT `go env GOROOT`

But it not work.

Copy link

ghost commented Mar 28, 2016

set -x GOROOT (go env GOROOT)

Copy link

ghost commented Mar 28, 2016

So,

` `

in fish is basically

(  )

@kkdai
Copy link

kkdai commented Mar 28, 2016

Thank you. Now I can

chsh -s /usr/local/bin/fish

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment