Add some comments to the functions

This commit is contained in:
Max Bucknell 2015-05-05 14:37:26 +01:00
parent 4b92313f7b
commit 3f8c900e19
6 changed files with 23 additions and 17 deletions

View file

@ -1,8 +1,17 @@
# Default path # Default path
set PATH /usr/local/bin /usr/local/sbin /usr/bin /bin /usr/sbin /sbin /usr/local/MacGPG2/bin set PATH /usr/local/bin
set PATH /usr/local/sbin $PATH
set PATH /usr/bin $PATH
set PATH /bin $PATH
set PATH /usr/sbin $PATH
set PATH /sbin $PATH
# Ruby support # MacGPG
set PATH /usr/local/Cellar/ruby/2.1.3/bin $PATH set PATH /usr/local/MacGPG2/bin $PATH
# Ruby
set RUBY_VERSION (ruby --version | cut -d " " -f 2 | cut -d "p" -f 1)
set PATH "/usr/local/Cellar/ruby/$RUBY_VERSION/bin" $PATH
# LaTeX! # LaTeX!
set PATH /usr/texbin $PATH set PATH /usr/texbin $PATH
@ -19,16 +28,10 @@ set PATH $PATH /opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resourc
# DYLD_LIBRARY_PATH (Rust asked for this) # DYLD_LIBRARY_PATH (Rust asked for this)
set DYLD_LIBRARY_PATH "/usr/local/lib" "$DYLD_LIBRARY_PATH" set DYLD_LIBRARY_PATH "/usr/local/lib" "$DYLD_LIBRARY_PATH"
# Mono asked for this:
source dnvm.sh
# For GitHub integration. # For GitHub integration.
# See github.com/github/hub # See github.com/github/hub
alias git hub alias git hub
# I don't want to delete things anymore.
alias rm trash
# Remove the greeting message on startup # Remove the greeting message on startup
set fish_greeting set fish_greeting
@ -43,6 +46,9 @@ alias mkdir "mkdir -p"
alias sl "/usr/local/bin/sl; and ls" alias sl "/usr/local/bin/sl; and ls"
# SSH Agent # SSH Agent
#
# Start SSH Agent if it's not already running, and add the
# id_(nice_hostname) identity.
setenv SSH_ENV "$HOME/.ssh/environment" setenv SSH_ENV "$HOME/.ssh/environment"
if [ -n "$SSH_AGENT_PID" ] if [ -n "$SSH_AGENT_PID" ]
ps -ef | grep $SSH_AGENT_PID | grep ssh-agent > /dev/null ps -ef | grep $SSH_AGENT_PID | grep ssh-agent > /dev/null

View file

@ -5,9 +5,7 @@ function fish_prompt
# Reset button # Reset button
set_color normal set_color normal
#
# Username # Username
#
# Show root user as red, to remind us of danger. # Show root user as red, to remind us of danger.
if test (whoami) = root if test (whoami) = root
@ -24,9 +22,7 @@ function fish_prompt
echo -n @ echo -n @
#
# Hostname # Hostname
#
# To remove boldness # To remove boldness
set_color normal set_color normal
@ -39,9 +35,7 @@ function fish_prompt
echo -n " in " echo -n " in "
#
# Current working dir # Current working dir
#
set_color normal set_color normal
set_color red set_color red
@ -51,9 +45,7 @@ function fish_prompt
set_color normal set_color normal
set_color -o black set_color -o black
#
# Git branch # Git branch
#
set branch (git_branch) set branch (git_branch)
if not test -z $branch if not test -z $branch

View file

@ -1,3 +1,6 @@
# Get the current git branch
#
# If we are not in a git repository, we silently ruturn noting.
function git_branch function git_branch
set __git_branch (git current-branch ^ /dev/null) set __git_branch (git current-branch ^ /dev/null)

View file

@ -1,3 +1,6 @@
# nice_hostname
#
# Take the first part of the hostname.
function nice_hostname function nice_hostname
hostname | cut -d . -f 1 hostname | cut -d . -f 1
end end

View file

@ -1,3 +1,4 @@
# Start SSH Agent and set relevant variables
function start_agent function start_agent
echo "Initializing new SSH agent ..." echo "Initializing new SSH agent ..."
ssh-agent -c | sed 's/^echo/#echo/' > $SSH_ENV ssh-agent -c | sed 's/^echo/#echo/' > $SSH_ENV

View file

@ -1,3 +1,4 @@
# Add my SSH identity
function test_identities function test_identities
ssh-add -l | grep "The agent has no identities" > /dev/null ssh-add -l | grep "The agent has no identities" > /dev/null
if [ $status -eq 0 ] if [ $status -eq 0 ]