   (let ((keymap (make-sparse-keymap)))
     (define-key keymap (kbd "C-c C-c") 'plantuml-preview)
     (define-key keymap (kbd "C-c C-e") 'plantuml-export)
+    (define-key keymap (kbd "C-c C-v") 'plantuml-view-exported-file)
     keymap)
   "Keymap for plantuml-mode.")
 

(defcustom plantuml-indent-level tab-width
  "Indentation level of PlantUML lines")

(defcustom plantuml-export-overwrite-files nil
  "Control whether file exporting is allowed to silently overwrite files."
  :type 'boolean
  :group 'plantuml)


;; TODO add support for exec-modes `server' and `executable'

(defun plantuml--export-file-name ()
  "Return export file name based on the file name associated with the current buffer."
  (let ((original-file-name (buffer-file-name (current-buffer))))

    (unless original-file-name
      (error "Current buffer is not associated with any file, cannot determine output file name"))

    (concat (file-name-sans-extension original-file-name)
            "."
            plantuml-output-type)))

(defun plantuml-export (&optional export-file-name)
  "Export a plantuml diagram to a file.
Exports the whole buffer unless a region is active, in which case
only the region will be exported.  Unless EXPORT-FILE-NAME is
explicitly given, the file name of the exported file will be
determined based on the file name of the current plantuml-file
and `plantuml-output-type'"
  (interactive)
  (let ((diagram-string (if mark-active
                            (buffer-substring-no-properties
                             (region-beginning) (region-end))
                          (buffer-string)))
        errors-during-export)

    (unless export-file-name
      (setq export-file-name (plantuml--export-file-name)))

    (unless (or (not (file-exists-p export-file-name))
                (not plantuml-confirm-overwrite-on-export)
                (yes-or-no-p (message "File %s already exists, overwrite?" export-file-name)))
      (user-error "File %s already exists, will not overwrite" export-file-name))

    (message "Exporting to %s ..." export-file-name)

