about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2020-11-24 08:33:25 -0600
committerCase Duckworth2020-11-24 08:33:25 -0600
commit9b1ce477453e778737ef67c23b34a0b30fd476d6 (patch)
treef7f3bfc82c6110acfeb58e17fc6b3c628de13e7d
parentRequire uniquify (diff)
downloademacs-9b1ce477453e778737ef67c23b34a0b30fd476d6.tar.gz
emacs-9b1ce477453e778737ef67c23b34a0b30fd476d6.zip
Various better-defaults-style changes
-rw-r--r--config.org85
1 files changed, 72 insertions, 13 deletions
diff --git a/config.org b/config.org index 538220f..c90e586 100644 --- a/config.org +++ b/config.org
@@ -452,6 +452,38 @@ See [[https://emacs.stackexchange.com/questions/12351/when-to-call-find-font-if-
452 (t . nil))) 452 (t . nil)))
453#+end_src 453#+end_src
454 454
455*** Hippie expand
456
457#+begin_src emacs-lisp
458 (global-set-key (kbd "M-/") 'hippie-expand)
459#+end_src
460
461*** iBuffer
462
463#+begin_src emacs-lisp
464 (global-set-key (kbd "C-x C-b") 'ibuffer)
465#+end_src
466
467*** Zap-up-to-char, not zap-to-char
468
469#+begin_src emacs-lisp
470 (autoload 'zap-up-to-char "misc"
471 "Kill up to, but not including, ARGth occurrence of CHAR." t)
472
473 (global-set-key (kbd "M-z") 'zap-up-to-char)
474#+end_src
475
476*** Other "[[https://git.sr.ht/~technomancy/better-defaults/tree/master/better-defaults.el][better defaults]]"
477
478#+begin_src emacs-lisp
479 (cuss save-interprogram-paste-before-kill t)
480 (cuss apropos-do-all t)
481 (cuss mouse-yank-at-point t)
482 (cuss require-final-newline t)
483 (cuss visible-bell (not (string= (system-name) "larry")))
484 (cuss ediff-window-setup-function #'ediff-setup-windows-plain)
485#+end_src
486
455* Persistence 487* Persistence
456 488
457** Auto-saves 489** Auto-saves
@@ -469,7 +501,12 @@ See [[https://emacs.stackexchange.com/questions/12351/when-to-call-find-font-if-
469 501
470#+begin_src emacs-lisp 502#+begin_src emacs-lisp
471 (cuss backup-directory-alist 503 (cuss backup-directory-alist
472 `((".*" . ,(no-littering-expand-var-file-name "backup/")))) 504 `((".*" . ,(no-littering-expand-var-file-name "backup/"))))
505
506 (cuss backup-by-copying 1)
507 (cuss delete-old-versions -1)
508 (cuss version-control t)
509 (cuss vc-make-backup-files t)
473#+end_src 510#+end_src
474 511
475** Recent files 512** Recent files
@@ -506,8 +543,8 @@ See [[https://emacs.stackexchange.com/questions/12351/when-to-call-find-font-if-
506 (use-package saveplace 543 (use-package saveplace
507 :custom 544 :custom
508 (save-place-file (no-littering-expand-var-file-name "places")) 545 (save-place-file (no-littering-expand-var-file-name "places"))
509 (save-place-forget-unreadable-files (not 546 (save-place-forget-unreadable-files (not
510 (eq system-type 'windows-nt)) 547 (eq system-type 'windows-nt))
511 :config 548 :config
512 (save-place-mode 1))) 549 (save-place-mode 1)))
513#+end_src 550#+end_src
@@ -522,6 +559,8 @@ See [[https://emacs.stackexchange.com/questions/12351/when-to-call-find-font-if-
522 search-ring 559 search-ring
523 regexp-search-ring)) 560 regexp-search-ring))
524 (savehist-save-minibuffer-history t) 561 (savehist-save-minibuffer-history t)
562 (history-length t)
563 (history-delete-duplicates t)
525 :config 564 :config
526 (savehist-mode 1)) 565 (savehist-mode 1))
527#+end_src 566#+end_src
@@ -548,17 +587,24 @@ See [[https://emacs.stackexchange.com/questions/12351/when-to-call-find-font-if-
548I'm going to be honest -- most of this is a stab in the dark. 587I'm going to be honest -- most of this is a stab in the dark.
549 588
550#+begin_src emacs-lisp 589#+begin_src emacs-lisp
551 (prefer-coding-system 'utf-8-unix) 590 (set-language-environment 'utf-8)
552 (set-default-coding-systems 'utf-8-unix) 591 (set-terminal-coding-system 'utf-8)
553 (set-terminal-coding-system 'utf-8-unix) 592 (cuss locale-coding-system 'utf-8)
554 (set-keyboard-coding-system 'utf-8-unix) 593 (set-default-coding-systems 'utf-8)
555 (set-selection-coding-system 'utf-8-unix) 594 (set-selection-coding-system 'utf-8)
556 (set-file-name-coding-system 'utf-8-unix) 595 (prefer-coding-system 'utf-8)
557 (set-clipboard-coding-system 'utf-8-unix) 596
558 (set-buffer-file-coding-system 'utf-8-unix) 597 ;; from https://www.emacswiki.org/emacs/EndOfLineTips
559 (cuss locale-coding-system 'utf-8-unix) 598
560 (cuss x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING)) 599 (defun acdw/no-junk-please-were-unixish ()
600 "Convert line endings to UNIX, dammit."
601 (let ((coding-str (symbol-name buffer-file-coding-system)))
602 (when (string-match "-\\(?:dos\\|mac\\)$" coding-str)
603 (set-buffer-file-coding-system 'unix))))
604
605 (add-hook 'find-file-hooks #'acdw/no-junk-please-were-unixish)
561#+end_src 606#+end_src
607
562** Undo 608** Undo
563 609
564#+begin_src emacs-lisp 610#+begin_src emacs-lisp
@@ -596,6 +642,19 @@ I'm going to be honest -- most of this is a stab in the dark.
596 ("C-+" . er/contract-region)) 642 ("C-+" . er/contract-region))
597 #+end_src 643 #+end_src
598 644
645** Clean up white space on save
646
647#+begin_src emacs-lisp
648 (add-hook 'before-save-hook #'whitespace-cleanup)
649 (add-hook 'before-save-hook #'delete-trailing-whitespace)
650#+end_src
651
652** Automatically revert a file to what it is on disk
653
654#+begin_src emacs-lisp
655 (global-auto-revert-mode 1)
656#+end_src
657
599* Writing 658* Writing
600 659
601** Word count 660** Word count