Configure the interface and editing behaviour a bit

This commit is contained in:
Jesse Braham 2025-02-09 13:55:16 +01:00
parent 214c7ee964
commit 6727eafc99
3 changed files with 50 additions and 0 deletions

22
editor.el Normal file
View File

@ -0,0 +1,22 @@
;; Automatically reload files if modified outside of the editor.
(global-auto-revert-mode)
;; Overwrite selected text when typing.
(delete-selection-mode)
;; Display line numbers.
(global-display-line-numbers-mode)
;; Display a ruler in the 80th column.
(setq-default display-fill-column-indicator-column 80)
(add-hook 'prog-mode-hook #'display-fill-column-indicator-mode)
(add-hook 'text-mode-hook #'display-fill-column-indicator-mode)
;; Whitespace settings:
;; - Tabs are 4 space characters (as the gods intended)
;; - Ensure a newline character is present at the end files when saving
;; - Clean up extraneous whitespace when saving
(setq-default indent-tabs-mode nil
tab-width 4)
(setq require-final-newline t)
(add-hook 'before-save-hook 'whitespace-cleanup)

View File

@ -38,5 +38,7 @@
;; Load all user-defined configuration files:
(load-user-file "editor.el")
(load-user-file "interface.el")
(load-user-file "key-bindings.el")
(load-user-file "typography.el")

26
interface.el Normal file
View File

@ -0,0 +1,26 @@
;; Hide the menu bar.
(menu-bar-mode -1)
;; Don't use double-spaces after periods.
(setq sentence-end-double-space nil)
;; Use unicode ellipses, because they're nicer.
(setq truncate-string-ellipsis "")
;; Don't require full yes/no answers, allow y/n instead.
(fset 'yes-or-no-p 'y-or-n-p)
;; Open new windows to the right, not on the bottom.
(setq split-height-threshold nil
split-width-threshold 0)
;; Scroll line-by-line, rather than jumping around haphazardly.
(setq scroll-conservatively 10000
scroll-margin 0
scroll-preserve-screen-position 1)
;; Display the column and line numbers of the cursor in the mode line.
(column-number-mode)
;; Display the file size in the mode line.
(size-indication-mode)