Skip to content

Instantly share code, notes, and snippets.

/.bash_profile Secret
Created Mar 28, 2016

Embed
What would you like to do?
#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*
@ghost

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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.

@ghost

This comment has been minimized.

Copy link

commented Mar 28, 2016

set -x GOROOT (go env GOROOT)
@ghost

This comment has been minimized.

Copy link

commented Mar 28, 2016

So,

` `

in fish is basically

(  )
@kkdai

This comment has been minimized.

Copy link

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
You can’t perform that action at this time.