Wednesday, October 23, 2019

Emacs part 3

I have removed vim from my system.  Not because I am completely sold on emacs, but because I keep typing vim out of habit and I want to train myself to remember to type emacs.

My ~/.emacs file is growing.  So far I have this in it:
(package-initialize)

(require 'package)

(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/"))
(package-initialize)


;;; Prevent tabs and use 4 space tab stop

(setq-default indent-tabs-mode nil)
(setq-default tab-width 4)
(setq-default indent-line-function 'insert-tab)

;;; Put backup files in one place

(setq-default backup-directory-alias '(("" . "~/.emacs.d/backup")))
I have not done much to my configuration and that continues to be deliberate.  I have learned some new commands based on things I would frequently do in vim:

  • Ctrl-x i
Like ":r FILENAME" in vim, inserts the named file at the current cursor position.
  • Meta-g Meta-g NUMBER
Like ":NUM" in vim to go to a specific line number.  You type the number after the keystrokes and press Enter.

The Meta key is mapped to Alt on my keyboard despite there being a perfectly suitable Meta key.  I may remap it later.

Things I am still trying to figure out in emacs:
  • How to disable automatic formatting.  In vim I only had this enabled for certain types of source code files.  I want to turn it off by default in emacs.
  • Something like "set bg=dark" in vim.
  • How to show trailing whitespace on lines as dark grey characters.  In vim, I displayed trailing spaces as dark grey periods and trailing tabs as dark grey |_ blocks.  This has to be possible in emacs.
And the day continues.

No comments: