Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun jump-forward-and-highlight-inside-quotes ()
- "highlight encounters in-between single and double quotes"
- (interactive)
- (deactivate-mark)
- (forward-char 2)
- (when (re-search-forward "'\\|\"" nil t)
- (er/expand-region 1)
- (exchange-point-and-mark)
- )
- )
- (defun jump-backward-and-highlight-inside-quotes ()
- "highlight encounters in-between single and double quotes"
- (interactive)
- (deactivate-mark)
- (backward-char 2)
- (when (re-search-backward "'\\|\"" nil t)
- (er/expand-region 1)
- ;(exchange-point-and-mark)
- )
- )
- (defun jump-forward-and-highlight-inside-pairs ()
- "Bounce from one paren to the matching paren."
- (interactive)
- (when (re-search-forward "\\[\\|\{\\|\(" nil t)
- (er/mark-inside-pairs)
- (exchange-point-and-mark)
- )
- )
- (defun jump-backward-and-highlight-inside-pairs ()
- "Bounce from one paren to the matching paren."
- (interactive)
- (when (re-search-backward "\\]\\|\}\\|\)" nil t)
- (er/mark-inside-pairs)
- (exchange-point-and-mark)
- )
- )
- (defhydra hydra-zoom ()
- ("1" (do-what "b"))
- ("2" (do-what "f"))
- ("-" (do-what "b"))
- ("=" (do-what "f"))
- ("p" (do-what "b"))
- ("n" (do-what "f"))
- ("[" (do-what "b"))
- ("]" (do-what "f"))
- ("k" (do-what "b"))
- ("i" (do-what "f"))
- ("d" (do-what "b"))
- ("f" (do-what "f"))
- )
- ;;g->
- (defun dz-quote-bracket-highlight (arg)
- (interactive "P")
- (message nil)
- (setq r (format "%c" (read-key)))
- ;; (setq r (read-key))
- ;;(message ">%s<" r)
- (hydra-menu))
- ;;hydra->
- (defun hydra-menu ()
- (interactive)
- (hydra-zoom/body)
- ;(message "%s" r)
- )
- (defun dz-quote (direction)
- (interactive)
- (pcase direction
- ("b" (jump-backward-and-highlight-inside-quotes))
- ("f" (jump-forward-and-highlight-inside-quotes))
- (otherwise (message "bracket direction not specified correctly"))
- )
- )
- (defun dz-bracket (direction)
- (interactive)
- (pcase direction
- ("b" (jump-backward-and-highlight-inside-pairs))
- ("f" (jump-forward-and-highlight-inside-pairs))
- (otherwise (message "bracket direction not specified correctly"))
- )
- )
- (defun do-what (direction)
- (interactive)
- (pcase r
- ("b" (dz-bracket direction))
- ("q" (dz-quote direction))
- (otherwise nil))
- )
- (global-set-key (kbd "<C-f1>") 'hydra-menu)
- (global-set-key (kbd "<C-f2>") 'dz-quote-bracket-highlight)
- (global-set-key (kbd "<C-f3>") 'eval-buffer)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement