Skip to content

Instantly share code, notes, and snippets.

@dorentus
Last active March 17, 2016 01:57
Show Gist options
  • Save dorentus/e6750e14e5ef206bbb5b to your computer and use it in GitHub Desktop.
Save dorentus/e6750e14e5ef206bbb5b to your computer and use it in GitHub Desktop.
# global env
set -gx LC_TIME 'ja_JP.UTF-8'
set -gx LC_MESSAGES 'en_US.UTF-8'
set -gx PATH $HOME/bin /usr/local/sbin /usr/local/bin $PATH
set -gx EDITOR vim
# swiftenv
#setenv SWIFTENV_ROOT "$HOME/.swiftenv"
#setenv PATH "$SWIFTENV_ROOT/bin" $PATH
#status --is-interactive; and . (swiftenv init -|psub)
# tools from homebrew
if command -s gfind > /dev/null # findutils
alias find gfind
end
if command -s gsed > /dev/null # gnu-sed
alias sed gsed
end
# colors ls
if test (uname) = "Linux"
alias ls 'ls --color=auto'
alias dir 'dir --color=auto'
alias vdir 'vdir --color=auto'
else
if command -s gls > /dev/null
alias ls 'gls --color=auto'
end
if command -s gdir > /dev/null
alias dir 'gdir --color=auto'
end
if command -s gvdir > /dev/null
alias vdir 'gvdir --color=auto'
end
end
# colors other
alias grep 'grep --color=auto'
alias gfrep 'fgrep --color=auto'
alias egrep 'egrep --color=auto'
# more ls
alias ll 'ls -l'
alias la 'ls -A'
alias l 'ls -CF'
# mysql UTF-8
alias mysql 'mysql --default-character-set=utf8'
# others
alias rscp 'rsync -vazP -e ssh'
alias axel 'axel -a'
alias tree 'tree -N'
# LS_COLORS
touch ~/.dircolors
eval (gdircolors -c ~/.dircolors | sed 's/>&\/dev\/null$//')
# proxy (SURGE)
set -gx http_proxy http://127.0.0.1:6152
# Neovim
if command -s nvim > /dev/null
alias vim nvim
alias vi nvim
end
function cdf --description 'Change to directory opened by Finder'
if [ -x /usr/bin/osascript ]
set -l target (osascript -e 'tell application "Finder" to if (count of Finder windows) > 0 then get POSIX path of (target of front Finder window as text)')
if [ "$target" != "" ]
cd "$target"; pwd
else
echo 'No Finder window found' >&2
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment