     (if modes
         (dolist (mode modes)
           (if (eq mode t)
-              (vimpulse-global-set-key 'vi-state key def t)
-            (vimpulse-define-major-key mode 'vi-state key def t)))
+              (vimpulse-global-set-key state key def t)
+            (vimpulse-define-major-key mode state key def t)))
       (vimpulse-with-state state
         (vimpulse-make-careful-binding basic-map key def)))))
 


(defcustom vimpulse-want-quit-like-Vim t
  "Whether :q quits the editor like in Vim, on by default."
  :group 'vimpulse
  :type  'boolean)


(vimpulse-define-operator vimpulse-fill (beg end)
  "Fill text."
  :move-point nil
  :whole-lines t
  (setq end
        (save-excursion
          (goto-char end)
          (skip-chars-backward " ")
          (max beg (point))))
  (save-excursion
    (condition-case nil
        (fill-region beg end)
      (error nil))))

(vimpulse-define-operator vimpulse-downcase (beg end)
  "Convert text to lower case."
