Skip to content

Instantly share code, notes, and snippets.

@Mumakil
Last active April 11, 2016 07:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mumakil/4351d059dde6cfbcdc75e48419d3275a to your computer and use it in GitHub Desktop.
Save Mumakil/4351d059dde6cfbcdc75e48419d3275a to your computer and use it in GitHub Desktop.
Fish functions
function be -d "Alias for `bundle exec`"
bundle exec $argv
end
function bi -d "Alias for `bundle install`"
bundle install $argv
end
# Path to Oh My Fish install.
set -gx OMF_PATH "/Users/otto/.local/share/omf"
# Customize Oh My Fish configuration path.
#set -gx OMF_CONFIG "/Users/otto/.config/omf"
# Load oh-my-fish configuration.
source $OMF_PATH/init.fish
# Fisher
set fisher_home ~/.local/share/fisherman
set fisher_config ~/.config/fisherman
source $fisher_home/config.fish
# Theme
set -g theme_nerd_fonts yes
set -g theme_display_vi yes
set -g theme_date_format "+%Y-%m-%d %H:%M"
set -g theme_display_vagrant yes
set -g theme_show_exit_status yes
# SSH-agent
set -g SSH_ENV ~/.ssh/environment
if test -f $SSH_ENV
bass . $SSH_ENV > /dev/null
#ps ${SSH_AGENT_PID} doesn't work under cywgin
if not eval (ps -ef | grep $SSH_AGENT_PID | grep ssh-agent\$ > /dev/null)
start_ssh_agent
end
else
start_ssh_agent
end
# Other
set -g LESS -R
set -g EDITOR vim
# Requires `bass` to be installed
function nvm -d "Bass wrapper for nvm bash command"
bass source ~/.nvm/nvm.sh --no-use ';' nvm $argv
end
# Requires `bass` to be installed and $SSH_ENV to be set
function start_ssh_agent -d "Starts an ssh agent and saves the environment to $SSH_ENV for reuse"
echo "Initialising new SSH agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > $SSH_ENV
echo succeeded
chmod 600 "$SSH_ENV"
bass . "$SSH_ENV" > /dev/null
/usr/bin/ssh-add;
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment