Rudy’s OBTF Rudolf Adamkovič

Home / Emacs / TODO SPLIT SPLIT SPLIT Configuration


Configure the graphical user interface (GUI)

Key Description Note
C-x C-M-= increase text size also s-= or C-<wheel-up> globally
C-x C-M-- decrease text size also s-- or C-<wheel-down> globally
C-x C-M-0 restore text size also s-0

(These are some horrible keyboard shortcuts.)

Do not use tabs for indentation. Also highlight them.

(setopt indent-tabs-mode nil)

Note: To remove tabs from a region, use untabify.

Make switch-to-buffer (C-x b) prompt with the previous buffer even if shown in another frame.

;;(defun other-buffer-advice (orig-fun &optional buffer visible-ok frame)
;;  (funcall orig-fun buffer t frame))
;;(advice-add 'other-buffer :around #'other-buffer-advice)

Remember the last editing position in files.

Saves the places to save-place-file.

(save-place-mode)

Treat sub-words as words.

The sub-word mode is handy to and jump in PascalCaseIdentifiers.

Enable the global minor mode and also diminish its mode line indicator.

(global-subword-mode)

Highlight URLs.

(global-goto-address-mode)

Open URLs with RET in addition to C-c RET.

Experiment. Temporarily disabled due to frequent accidental calls.

;; (keymap-set goto-address-highlight-keymap "RET" #'goto-address-at-point)
(setopt create-lockfiles nil
        use-dialog-box nil)

Replace the region upon typing over it.

(add-hook 'after-init-hook #'delete-selection-mode)

Do not blink the cursor.

Cons:

  • when switching windows, sometimes it is not clear which one is active
  • blinking is distracting

Pros:

  • With blink-cursor-blinks set to -1, the cursor blinks forever, which makes for a good “Emacs is busy” indicator.
;; (setopt blink-cursor-blinks -1)
(blink-cursor-mode -1)

Stop Customize from messing up any hand-written initialization files.

(setopt custom-file (make-temp-file "emacs-custom"))

(Do not use null-device, it breaks e.g. load-theme.)

Delete trailing whitespace on save.

(add-hook 'text-mode-hook #'delete-trailing-whitespace-mode)
(add-hook 'prog-mode-hook #'delete-trailing-whitespace-mode)

Enlarge the kill ring from \(120\) to \(2^{13} = 8192\) entries.

(setopt kill-ring-max 8192)

Do not add an entry to the kill ring if duplicates the top-most entry.

(setopt kill-do-not-save-duplicates t)

Do not add an entry to the kill ring if the entry consists just of whitespace.

(setopt kill-transform-function
        (lambda (string)
          (if (string-blank-p string) nil string)))

Save the (operating system) clipboard to the kill ring before replacing its content.

(setopt save-interprogram-paste-before-kill t)

Do not try to recenter the point when scrolling.

(setopt scroll-conservatively 9999)

Disable noisy warnings.

(setopt load-prefer-newer t
        byte-compile-warnings nil)

Do not show warnings during asynchronous native compilation.

(eval-when-compile (require 'comp))
(setopt native-comp-async-report-warnings-errors 'silent)

Use a single core, instead of half of them, to avoid choppiness.

(setopt native-comp-async-jobs-number 1)

Do not abbreviate Emacs Lisp outputs with ellipses.

https://www.gnu.org/software/emacs/manual/html_node/elisp/Output-Variables.html https://www.gnu.org/software/emacs/manual/html_node/emacs/Lisp-Eval.html

;; NOTE Not `custom'-settable.
(setq print-level nil
      print-length nil)
(setopt eval-expression-print-level nil
        eval-expression-print-length nil)

Define a TempEl template for quickly adding Emacs Lisp.

org-mode
(emacs
 "#+begin_src elisp :results silent" n
 q n
 "#+end_src")

Indent C-like languages, including Java, like this

some_function(
  some_argument,
  some_argument
)

instead of like this

some_function(
  some_argument,
  some_argument)
(add-hook 'c-mode-common-hook
          (lambda ()
            (c-set-offset 'arglist-intro '+)
            (c-set-offset 'arglist-close 0)))


© 2025 Rudolf Adamkovič under GNU General Public License version 3.
Made with Emacs and secret alien technologies of yesteryear.