     (let ((str (format "apropos(\"%s\")" search)))
       (sm/comint-print-and-send (sm/julia-process) str)))
 
+  (defun sm/julia-activate-project ()
+    "Activate the julia project if available."
+    (interactive)
+    (let* ((project-file "Project.toml")
+           (dir (locate-dominating-file "." project-file)))
+      (if dir
+          (let* ((path (expand-file-name (concat dir project-file)))
+                 (cmd (format "using Pkg; Pkg.activate(\"%s\")" path)))
+            (sm/comint-print-and-send (sm/julia-process) cmd))
+        (message "Not in Julia project"))))
+
   (defun sm/julia-run ()
     "Open an julia buffer."
     (interactive)

                                 default-directory)))
      (pop-to-buffer (process-buffer (sm/julia-process)))))

  :bind(:map julia-mode-map
             ("C-c C-l" . sm/julia-send-buffer)
             ("C-c C-c" . sm/julia-send-region-or-line)
             ("C-c C-d d" . sm/julia-doc)
             ("C-c C-d C-d" . sm/julia-doc)
             ("C-c C-d a" . sm/julia-apropos)

    (interactive)
    (sm/comint-send-buffer (sm/julia-process)))

  (defun sm/julia-send-function ()
    (interactive)
    (save-excursion
      ;; TODO: Handle empty lines in function body.
      (mark-defun)
      (sm/julia-send-region-or-line)))

  (defun sm/julia-doc ()
    (interactive)
    (let* ((sym (thing-at-point 'symbol t))
