Commits

Steve Losh committed 8fd0315

Make something real.

  • Participants
  • Parent commits f667b68

Comments (0)

Files changed (9)

File plugins/directories/aliases.fish

+function md
+    mkdir -p $argv
+end
+
+function l1
+    tree --dirsfirst -ChFL 1
+end
+function l2
+    tree --dirsfirst -ChFL 2
+end
+function l3
+    tree --dirsfirst -ChFL 3
+end
+
+function ll1
+    tree --dirsfirst -ChFupDaL 1
+end
+function ll2
+    tree --dirsfirst -ChFupDaL 2
+end
+function ll3
+    tree --dirsfirst -ChFupDaL 3
+end
+
+function l
+    l1
+end
+function ll
+    ll1
+end
+
+function ..
+    builtin cd ..
+end
+function ...
+    builtin cd ../..
+end
+function ....
+    builtin cd ../../..
+end
+function .....
+    builtin cd ../../../..
+end

File plugins/django/aliases.fish

+# General manage.py
+function pm
+    python manage.py
+end
+function pmr
+    python manage.py runserver
+end
+function pmrp
+    python manage.py runserver_plus
+end
+function pmrpg
+    pmrp --adminmedia (pwd)/media/admin
+end
+function pmsdb
+    python manage.py syncdb
+end
+function pms
+    python manage.py shell
+end
+function pmsp
+    python manage.py shell_plus
+end
+function pmlf
+    python manage.py loaddata fixtures/*
+end
+function pmt
+    python -W ignore::DeprecationWarning manage.py test
+end
+
+# South aliases
+function pmdm
+    python manage.py datamigration
+end
+function pmsm
+    python manage.py schemamigration --auto
+end
+function pmsi
+    python manage.py schemamigration --initial
+end
+function pmm
+    python manage.py migrate
+end
+function pmma
+    python manage.py migrate --all
+end
+function pmml
+    python manage.py migrate --list
+end
+function pmmf
+    python manage.py migrate --fake
+end
+function pmcats
+    python manage.py convert_to_south
+end

File plugins/misc/misc.fish

+function o -d "Open the given file or directory."
+    open $argv
+end
+
+function oo -d "Open the current directory."
+    open .
+end
+
+function ascii_chars -d "Print the ASCII values of each character on stdin."
+    python -c 'import sys; print " ".join(map(str, map(ord, sys.stdin.read())))'
+end
+
+function strip -d "Strip whitespace from around the arguments or stdin."
+    if test (count $argv) -eq 0
+        python -c 'import sys; sys.stdout.write(sys.stdin.read().strip())'
+    else
+        echo $argv | strip
+    end
+end

File plugins/osx/osx.fish

+function pretty_man -d "Open the specified manual page as a PDF in Preview."
+    man $argv[1] -t | open -f -a Preview
+end
+
+function quicklook -d "Open the given file in Quick Look.  Ctrl+C to quit."
+    qlmanage -p $argv ^/dev/null
+end

File plugins/python/python.fish

+function cdp -d "Change directory to the location of the specified Python module."
+    cd (python -c "import os.path as _, $argv[1]; print _.dirname(_.realpath($argv[1].__file__[:-1]))")
+end

File plugins/python/virtualenv.fish

+function wo -d "If an argument is given, workon that venv.  Otherwise workon the venv with the name contained in ./.venv"
+    if test -f './.venv'
+        workon (cat ./.venv)
+    else
+        workon $argv[1]
+    end
+end

File plugins/web/json.fish

+function pretty_json -d "Prettify JSON data from standard in and print it on stdout."
+    python -mjson.tool
+end
+
+function curl_json -d "Download the JSON from the given URL, prettify it, and print it to stdout."
+    curl -sS $argv | pretty_json
+end

File tacklebox.fish

+set -g tb $tacklebox_path
+
+. $tb/themes/$tacklebox_theme.fish
+
+for plug in $tacklebox_plugins
+    for f in $tb/plugins/$plug/*.fish
+        . $f
+    end
+end

File themes/prose.fish

+function fish_prompt
+    emit prompt
+
+    set -l cwd (prompt_pwd)
+    if test -z $cwd
+        set cwd "/"
+    end
+
+    printf "\n"
+    printf "%s%s%s " (set_color magenta) (whoami) (set_color normal)
+    printf "at %s%s%s " (set_color yellow) (hostname|cut -d . -f 1) (set_color normal)
+    printf "in %s$cwd%s" (set_color green) (set_color normal)
+    printf "\n><> "
+end
+