about summary refs log tree commit diff
path: root/configs
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2019-04-01T17·27+0100
committerWilliam Carroll <wpcarro@gmail.com>2019-04-01T17·27+0100
commit9ef4b5bb0a61e9cbc2b54e0b6d175c6864324cb4 (patch)
treef7da00e02d5a0e8f04c0cb9be028304b8166150a /configs
parent6a2d7ef035e54d81f818e65d8362caa06b3c2748 (diff)
Support run_java
I probably won't need this as I become more familiar with Java.
Diffstat (limited to 'configs')
-rw-r--r--configs/shared/zsh/functions.zsh9
1 files changed, 9 insertions, 0 deletions
diff --git a/configs/shared/zsh/functions.zsh b/configs/shared/zsh/functions.zsh
index 8c751c64aaa8..26f81a3ca656 100644
--- a/configs/shared/zsh/functions.zsh
+++ b/configs/shared/zsh/functions.zsh
@@ -47,6 +47,15 @@ snipit() {
     echo "Copied \"$uri\" to your clipboard."
 }
 
+# Java
+run_java() {
+  # Usage: run_java path/to/file.java
+  # Intended to be similar in spirit to Haskell's `runhaskell`.
+  set -e
+  javac $1
+  java ${1%.java}
+}
+
 # Aptitude
 apts() {
   # Searches aptitude package repository for $1, surrounding it in ^$ to ensure