diff options
Diffstat (limited to '.config/fish/functions/take.fish')
| -rw-r--r-- | .config/fish/functions/take.fish | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/.config/fish/functions/take.fish b/.config/fish/functions/take.fish new file mode 100644 index 0000000..407cf36 --- /dev/null +++ b/.config/fish/functions/take.fish | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | function take --description 'Create a directory and cd to it' | ||
| 2 | command mkdir $argv | ||
| 3 | if test $status = 0 | ||
| 4 | switch $argv[(count $argv)] | ||
| 5 | case '-*' | ||
| 6 | |||
| 7 | case '*' | ||
| 8 | cd $argv[(count $argv)] | ||
| 9 | return | ||
| 10 | end | ||
| 11 | end | ||
| 12 | end | ||
