(setq-default indicate-empty-lines t
mouse-prefer-closest-glyph t
- line-move-visual nil
- transient-mark-mode nil)
+ line-move-visual nil)
(blink-cursor-mode -1)
(column-number-mode t)
:underline
t)
+;; Transient mark mode temp enabling
+(setq transient-mark-mode nil)
+
+(defun re/remap-mark-command (command &optional map)
+ "Remap a mark-* command to temporarily activate Transient Mark mode.
+Taken from https://spwhitton.name/blog/entry/transient-mark-mode/"
+ (let* ((cmd (symbol-name command))
+ (fun (intern (concat "re/" cmd)))
+ (doc (concat "Call `"
+ cmd
+ "' and temporarily activate Transient Mark mode.")))
+ (fset fun `(lambda ()
+ ,doc
+ (interactive)
+ (call-interactively #',command)
+ (activate-mark)))
+ (if map
+ (define-key map (vector 'remap command) fun)
+ (global-set-key (vector 'remap command) fun))))
+
+(dolist (command '(mark-beginning-of-buffer
+ mark-end-of-buffer
+ mark-end-of-sentence
+ mark-page
+ mark-paragraph
+ mark-sexp
+ mark-defun
+ mark-whole-buffer
+ mark-word
+ rectangle-mark-mode))
+ (re/remap-mark-command command))
+
;; Help
(setq apropos-do-all t)