  ("C-x C-u" . modi/upcase)
  ("C-x C-l" . modi/downcase))
 
-(hydra-create "M-c"
-  '(("c"   modi/capitalize       "Capitalize")     ; M-c c
-    ("u"   modi/upcase           "UPCASE")         ; M-c u
-    ("l"   modi/downcase         "downcase")       ; M-c l
-    ("M-c" xah-cycle-letter-case "→Cap→UP→down→")) ; M-c M-c
-  modi-mode-map)
+(bind-key "M-c"
+          (defhydra hydra-change-case()
+            "change-case"
+            ("c"   modi/capitalize       "Capitalize")     ; M-c c
+            ("u"   modi/upcase           "UPCASE")         ; M-c u
+            ("l"   modi/downcase         "downcase")       ; M-c l
+            ("M-c" xah-cycle-letter-case "→Cap→UP→down→")) ; M-c M-c
+          modi-mode-map)
 
 (bind-to-modi-map "x" eval-and-replace-last-sexp)
 ;; Bind `what-cursor-position' to `modi-mode-map' as I have overridden its

;; Toggle comment on current line or selected region
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; http://stackoverflow.com/questions/9688748/emacs-comment-uncomment-current-line
(defun toggle-comment-on-line-or-region (&optional arg)
  "comment or uncomment current line or selected region , and go to the next line"
  (interactive)
  (if (region-active-p)
      (comment-or-uncomment-region (region-beginning) (region-end))
    (comment-or-uncomment-region (line-beginning-position) (line-end-position)))
  (next-line))

;; Make `kill-whole-line' indentation aware
;; https://github.com/lunaryorn/stante-pede/blob/master/init.el

(bind-to-modi-map "=" what-cursor-position)

;; Source: http://oremacs.com/2015/01/14/repeatable-commands/
;; Usage: Quickly pressing `j' twice will toggle comment on the current line or
;;        region and proceed the cursor to the next line.
;;        Now each consecutive pressing of `j', will toggle the comment on that
;;        line and proceed to the next line. Pressing `p' or `n' will simply
;;        navigate the cursor to the next or previous line without commenting
;;        or uncommenting anything.
;;
;;        jj j j j j j n n n j j p j n
;;
;;        Numeric prefixes are supported too:
;;
;;        jj 5j 7j 2j j 7n n n j j p j n
;;
;;        Press any other key (other than j, p or n) to quit this behavior.
(key-chord-define-global "jj" (defhydra hydra-comment()
                                "comment and navigate"
                                ("j" endless/comment-line-or-region "toggle comment")
                                ("p" previous-line "go to previous line")
                                ("n" next-line "go to next line")))

(key-chord-define-global "^^" (λ (insert "λ")))

