diff options
author | Aditya <bluenerd@protonmail.com> | 2023-02-27 20:04:56 +0530 |
---|---|---|
committer | Aditya <bluenerd@protonmail.com> | 2023-02-27 20:04:56 +0530 |
commit | edc449275b6c04445f58b108ca0937a87c1e8430 (patch) | |
tree | 9fd484d58145b616f29a78857cc0b1c8b1c18f05 /oh-my-zsh/plugins/textastic | |
parent | 6f5424ca96c4221ef433f545642669e9c104d0ed (diff) |
add zsh
Diffstat (limited to 'oh-my-zsh/plugins/textastic')
-rw-r--r-- | oh-my-zsh/plugins/textastic/README.md | 15 | ||||
-rw-r--r-- | oh-my-zsh/plugins/textastic/textastic.plugin.zsh | 17 |
2 files changed, 32 insertions, 0 deletions
diff --git a/oh-my-zsh/plugins/textastic/README.md b/oh-my-zsh/plugins/textastic/README.md new file mode 100644 index 0000000..3f3bcea --- /dev/null +++ b/oh-my-zsh/plugins/textastic/README.md @@ -0,0 +1,15 @@ +## textastic + +Plugin for Textastic, a text and code editor for Mac OS X + +### Requirements + + * [Textastic](https://www.textasticapp.com/mac.html) + +### Usage + + * If `tt` command is called without an argument, launch Textastic + + * If `tt` is passed a directory, cd to it and open it in Textastic + + * If `tt` is passed a file, open it in Textastic diff --git a/oh-my-zsh/plugins/textastic/textastic.plugin.zsh b/oh-my-zsh/plugins/textastic/textastic.plugin.zsh new file mode 100644 index 0000000..f5901ea --- /dev/null +++ b/oh-my-zsh/plugins/textastic/textastic.plugin.zsh @@ -0,0 +1,17 @@ +# +# If the tt command is called without an argument, launch Textastic +# If tt is passed a directory, cd to it and open it in Textastic +# If tt is passed a file, open it in Textastic +# +function tt() { + if [[ -z "$1" ]] + then + open -a "textastic.app" + else + open -a "textastic.app" "$1" + if [[ -d "$1" ]] + then + cd "$1" + fi + fi +} |