(setq-default indicate-empty-lines t
mouse-prefer-closest-glyph t
- line-move-visual nil
- word-wrap t)
+ fill-column 78)
(blink-cursor-mode -1)
(column-number-mode t)
confirm-kill-processes nil
mouse-1-click-follows-link nil
focus-follows-mouse t
- mouse-autoselect-window -0.25
- visual-line-fringe-indicators '(left-curly-arrow right-curly-arrow))
+ mouse-autoselect-window -0.25)
;; Recent Files/Buffers
(midnight-mode t)
(keymap-global-set "<mouse-4>" #'previous-buffer) ; Back button
(keymap-global-set "C-M-o" #'re/other-window-or-split-window)
(keymap-global-set "<remap> <move-beginning-of-line>" #'re/smart-beginning-of-line)
+(keymap-global-set "<remap> <move-end-of-line>" #'re/smart-end-of-line)
(keymap-set visual-line-mode-map "C-a" #'re/smart-beginning-of-line)
-(keymap-set visual-line-mode-map "C-e" #'move-end-of-line)
+(keymap-set visual-line-mode-map "C-e" #'re/smart-end-of-line)
(keymap-global-set "<remap> <goto-line>" #'re/goto-line)
;; Seeking
(call-interactively 'backward-kill-word)))
(defun re/smart-beginning-of-line ()
- "Move point to first non-whitespace character.
+ "Move point to first non-whitespace character or `beginning-of-visual-line'.
If point was already at that position, call `back-to-indentation'.
Called a third time, move point back to `beginning-of-line'.
If in org-mode, call `org-beginning-of-line' first."
(if (equal major-mode 'org-mode)
(org-beginning-of-line)
(progn
- (beginning-of-line 1)
+ (beginning-of-visual-line 1)
(skip-syntax-forward " " (line-end-position))
(backward-prefix-chars)))
(and (= oldpos (point))
(back-to-indentation)
(and (= newpos (point)) (beginning-of-line))))))
+(defun re/smart-end-of-line ()
+ "Move point to the end of the visual line.
+ If point was already at that position, call `move-end-of-line'.
+If in org-mode, call `org-end-of-line' first."
+ (interactive "^")
+ (let ((oldpos (point)))
+ (if (equal major-mode 'org-mode)
+ (org-end-of-line)
+ (end-of-visual-line 1))
+ (and (= oldpos (point)) (move-end-of-line nil))))
+
(defun re/goto-line ()
"Show line numbers before going to line, then hide them again."
(interactive)
(setq use-package-always-ensure t
use-package-always-demand t)
+(use-package visual-fill-column
+ :config
+ (global-visual-line-mode 1)
+ :custom
+ (word-wrap t)
+ (visual-line-fringe-indicators '(left-curly-arrow right-curly-arrow))
+ (visual-fill-column-enable-sensible-window-split t)
+ :bind
+ (("C-c v" . visual-fill-column-mode)))
+
(use-package corfu
:custom
(corfu-auto t)
(use-package expand-region
:bind
- (("C-=" quote er/expand-region)))
+ (("C-=" . er/expand-region)))
(use-package magit
:defer