about summary refs log tree commit diff
path: root/configs/shared
diff options
context:
space:
mode:
Diffstat (limited to 'configs/shared')
-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