mirror of
https://codeberg.org/scip/dot-emacs.git
synced 2025-12-17 04:20:57 +01:00
(re-)added electric pair mode to eval-expression, added tvd-lisp-comment
This commit is contained in:
24
.emacs
24
.emacs
@@ -709,6 +709,8 @@
|
||||
;; - disabled outline C-<left> it overwrote sp slurp left
|
||||
;; - enhanced emacs-changelog
|
||||
;; - fixed parens bug, added sp ti monibuffer
|
||||
;; - added tvd-lisp-comment
|
||||
;; - (re-)added electric pair mode to eval-expression
|
||||
|
||||
;; ** TODO
|
||||
|
||||
@@ -2213,6 +2215,19 @@ Used when enabling smartparens-mode."
|
||||
(add-something-to-mode-hooks
|
||||
'(perl ruby c c++ shell-script makefile config-general) 'smartparens-mode)
|
||||
|
||||
;; I use my own lisp comment tool until sp#942 is fixed
|
||||
(defun tvd-lisp-comment ()
|
||||
(interactive)
|
||||
(if (not (looking-at "\("))
|
||||
(self-insert-command 1)
|
||||
(let ((beg (point)))
|
||||
(forward-list 1)
|
||||
(when (looking-at "\(")
|
||||
(insert "\n"))
|
||||
(comment-region beg (point))
|
||||
(indent-for-tab-command)
|
||||
(goto-char beg))))
|
||||
|
||||
(eval-after-load 'smartparens
|
||||
'(progn
|
||||
;; hydra via https://github.com/lunaryorn/old-emacs-configuration/blob/master/init.el
|
||||
@@ -2346,6 +2361,9 @@ respectively."
|
||||
;; up forward, effectively doing sp-up-sexp.
|
||||
(define-key smartparens-mode-map (kbd "C-S-<right>") 'sp-previous-sexp)
|
||||
|
||||
;; comment the whole sexp
|
||||
(define-key smartparens-mode-map (kbd ";") 'tvd-lisp-comment)
|
||||
|
||||
;; replace my global setting
|
||||
;; FIXME: fhceck/fix M<up+down>!
|
||||
(define-key smartparens-mode-map (kbd "M-<right>") 'sp-forward-symbol)
|
||||
@@ -3441,7 +3459,11 @@ Returns t if version changed, nil otherwise."
|
||||
(define-key comint-mode-map [up] 'comint-previous-input)))
|
||||
|
||||
;; sometimes I use lisp in minibuffer
|
||||
(defalias 'ee 'eval-expression)
|
||||
(defun ee()
|
||||
(interactive)
|
||||
(electric-pair-mode)
|
||||
(call-interactively 'eval-expression)
|
||||
(electric-pair-mode))
|
||||
|
||||
;; sometimes I eval regions
|
||||
(defalias 'er 'eval-region)
|
||||
|
||||
1001
emacs.html
1001
emacs.html
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user