Created
September 7, 2018 03:27
-
-
Save gyu-don/410f33d155216ef107954f869beffd4a to your computer and use it in GitHub Desktop.
fish_functions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function c | |
if test (count $argv) -eq 0 | |
cd | |
else if test (count $argv) -gt 1 | |
echo "Too many arguments" >&2 | |
else if test -d $argv[1] | |
cd $argv[1] | |
else if test ! -e $argv[1] | |
echo "Not exists" >&2 | |
else if test (head -26 $argv[1] | wc -l) -lt 26 | |
cat $argv[1] | |
else | |
less $argv[1] | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function l | |
if test (count $argv) -eq 0 | |
ls | |
else if test (count $argv) -gt 1 | |
echo "Too many arguments" >&2 | |
else if test -d $argv[1] | |
ls $argv[1] | |
else if test ! -e $argv[1] | |
echo "Not exists" >&2 | |
else if test (head -26 $argv[1] | wc -l) -lt 26 | |
cat $argv[1] | |
else | |
less $argv[1] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment