       (insert command-and-go)
       (move-marker (process-mark proc) (point)))
     (process-send-string proc command-and-go)
-    (switch-to-buffer "*shell*")))
+    (when switch-buffer
+      (switch-to-buffer "*shell*"))))
 
 (defun csm-love-repl ()
   (interactive)
-  (csm-sh-send-command (concat "cd " (projectile-project-root) " && make run")))
+  (csm-sh-send-command (concat "cd " (projectile-project-root) " && make run") t))
 
 (defun csm-love-test ()
   (interactive)
-  (csm-sh-send-command (concat "cd " (projectile-project-root) " && make test")))
+  (csm-sh-send-command (concat "cd " (projectile-project-root) " && make test") t))
+
+(defun csm-love-sync-all ()
+  (interactive)
+  (csm-sh-send-command "(love.game.sync-all)"))
+
+;;** Send to shell
+(defun csm-send-region-to-shell ()
+  (interactive)
+  (let ((sexp (buffer-substring-no-properties (region-beginning) (region-end))))
+    (csm-sh-send-command sexp)))
+
+(defun csm-send-defun-to-shell ()
+  (interactive)
+  (save-excursion
+    (mark-defun)
+    (csm-send-region-to-shell)))
+
+(defun csm-send-buffer-to-shell ()
+  (interactive)
+  (save-excursion
+    (mark-page)
+    (csm-send-region-to-shell)))
+
+(defun csm-fnl-hotswap-file ()
+  "Hotswaps the current buffer. Relies on a directory structure of src/?.fnl;src/?/init.fnl"
+  (interactive)
+  (save-buffer)
+  (let* ((modname (buffer-file-name))
+         (from-src-pos (string-match ".*/src/\\(.*\\).fnl" modname))
+         (modname (match-string 1 modname))
+         (modname (replace-regexp-in-string "\\/" "." modname))
+         (modname (replace-regexp-in-string ".init$" "" modname)))
+    (csm-sh-send-command (concat "(dbg.hot :" modname ")"))))
+
+
+(defun csm-switch-to-shell ()
+  (interactive)
+  (switch-to-buffer "*shell*"))

       "e S" #'sp-backward-slurp-sexp
       "e b" #'sp-forward-barf-sexp
       "e B" #'sp-backward-barf-sexp

       "b m" #'csm-show-message-log
       "=" 'csm-indent-buffer)

    (untabify (point-min) (point-max))))

(defun csm-show-message-log ()
  "Show the message log bufffer. Print to log with (message ...)"
  (interactive)
  (switch-to-buffer " *Message-Log*"))

;; https://emacs.stackexchange.com/questions/48954/the-elisp-function-to-run-the-shell-command-in-specific-file-path/48968#48968?newreg=b86e9e5763734e37a1bee5a230d71551
;; Use "term /bin/zsh", *terminal* buffer and terminal process if you want to use zsh. It needs some work to be smooth though
(defun csm-sh-send-command (command &optional switch-buffer)
  "Send COMMAND to current shell process.
    Creates new shell process if none exists.
    See URL `https://stackoverflow.com/a/7053298/5065796'"
