mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2025-02-22 20:03:23 +08:00
Merge remote-tracking branch 'upstream/master'
Merging in preparation of a rebase, per maintainer's request.
This commit is contained in:
commit
ef890addac
8
plugins/python/_python.fish
Normal file
8
plugins/python/_python.fish
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# Use python2 if found, otherwise fallback to python.
|
||||||
|
function _python
|
||||||
|
if which python2
|
||||||
|
python2
|
||||||
|
else
|
||||||
|
python
|
||||||
|
end
|
||||||
|
end
|
@ -1,5 +1,5 @@
|
|||||||
# beautify json string
|
# beautify json string
|
||||||
# use : pybeautifyjson '{"foo": "lorem", "bar": "ipsum"}'
|
# use : pybeautifyjson '{"foo": "lorem", "bar": "ipsum"}'
|
||||||
function pybeautifyjson
|
function pybeautifyjson
|
||||||
echo $argv | python -mjson.tool
|
echo $argv | _python -mjson.tool
|
||||||
end
|
end
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
# clean current directory recursively from any .pyc and .pyo files
|
# clean current directory recursively from any .pyc and .pyo files
|
||||||
function pyclean
|
function pyclean
|
||||||
if test -n $argv
|
set -l path2CLEAN
|
||||||
set path2CLEAN $argv
|
|
||||||
else
|
if set -q $argv
|
||||||
set path2CLEAN .
|
set path2CLEAN .
|
||||||
|
else
|
||||||
|
set path2CLEAN $argv
|
||||||
end
|
end
|
||||||
|
|
||||||
find $path2CLEAN -name "*.py[co]" -type f -delete
|
find $path2CLEAN -name "*.py[co]" -type f -delete
|
||||||
end
|
end
|
||||||
|
@ -5,5 +5,6 @@ function pyhttp
|
|||||||
else
|
else
|
||||||
set HTTPPORT 1025
|
set HTTPPORT 1025
|
||||||
end
|
end
|
||||||
python -m SimpleHTTPServer $HTTPPORT;
|
|
||||||
|
_python -m SimpleHTTPServer $HTTPPORT;
|
||||||
end
|
end
|
||||||
|
@ -5,6 +5,7 @@ function pysmtp
|
|||||||
else
|
else
|
||||||
set SMTPPORT 1025
|
set SMTPPORT 1025
|
||||||
end
|
end
|
||||||
|
|
||||||
echo "smtp server started on port" $SMTPPORT;
|
echo "smtp server started on port" $SMTPPORT;
|
||||||
python -m smtpd -n -c DebuggingServer localhost:$SMTPPORT;
|
_python -m smtpd -n -c DebuggingServer localhost:$SMTPPORT;
|
||||||
end
|
end
|
||||||
|
@ -1,5 +1,11 @@
|
|||||||
function subl --description 'Open Sublime Text 2'
|
function subl --description 'Open Sublime Text'
|
||||||
if test -d "/Applications/Sublime Text 2.app"
|
if test -d "/Applications/Sublime Text.app"
|
||||||
|
"/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" $argv
|
||||||
|
else if test -d "/Applications/Sublime Text 2.app"
|
||||||
"/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" $argv
|
"/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" $argv
|
||||||
|
else if test -x "/opt/sublime_text/sublime_text"
|
||||||
|
"/opt/sublime_text/sublime_text" $argv
|
||||||
|
else
|
||||||
|
echo "No Sublime Text installation found"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user