Skip to content

Instantly share code, notes, and snippets.

@farhany
Last active April 28, 2019 04:47
Show Gist options
  • Save farhany/03b096c189cbae3113a3337d1b07daaf to your computer and use it in GitHub Desktop.
Save farhany/03b096c189cbae3113a3337d1b07daaf to your computer and use it in GitHub Desktop.
Setup macOS
# https://github.com/tonsky/FiraCode/wiki
# Fonts
brew tap caskroom/fonts
brew cask install font-fira-code
# ZSH
brew install zsh-syntax-highlighting zsh-autosuggestions
brew install fasd
brew install ripgrep
cat << EOF >> ~/.zshrc
# lr: Full Recursive Directory Listing
alias lr='ls -R | grep ":$" | sed -e '\''s/:$//'\'' -e '\''s/[^-][^\/]*\//--/g'\'' -e '\''s/^/ /'\'' -e '\''s/-/|/'\'' | less'
# mans: Search manpage given in agument '1' for term given in argument '2' (case insensitive)
# displays paginated result with colored search terms and two lines surrounding each hit.
# Example: mans mplayer codec
mans () {
man $1 | grep -iC2 --color=always $2 | less
}
# showa: to remind yourself of an alias (given some part of it)
showa () { /usr/bin/grep --color=always -i -a1 $@ ~/Library/init/bash/aliases.bash | grep -v '^\s*$' | less -FSRXc ; }
DOTNET_CLI_TELEMETRY_OPTOUT=1
echo source /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh
echo eval "$(fasd --init posix-alias zsh-hook)"
echo alias c='fasd_cd -d'
gocheat() {
curl http://cheat.sh/"go/$*"
}
source ~/.go
plugins=(
git
golang
screen
mosh
fuck
)
eval $(thefuck --alias)
EOF
cat << EOF >> ~/.go
#.go
# ==== GO VARIABLES ====
export GOPATH=$HOME/code/go
export GOBIN=$GOPATH/bin
export GOROOT=`go env GOROOT`
export PATH=$PATH:$GOBIN
export GO111MODULE=on
#alias godocker='docker run --rm -it -v $PWD:/mnt golang'
#alias godocker='docker run --rm -it -v $PWD:/projectname golang'
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment