Emacs: Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
Emacs is great and sucks too. | Emacs is great and sucks too. | ||
== Configuration == | |||
* Use CUA mode | * Use CUA mode | ||
* This common config should work well in both terminal and UI: | |||
/home/m/development/config/common/home/m/.emacs | /home/m/development/config/common/home/m/.emacs | ||
NOTE that you need some other things to be configured properly: | NOTE that you need some other things to be configured properly: | ||
Line 13: | Line 10: | ||
export TERM=xterm-256color | export TERM=xterm-256color | ||
* Make sure you check out undo support via [ctrl-x u] | * Make sure you check out undo support via [ctrl-x u] | ||
==== GPG ==== | ==== GPG ==== | ||
Emacs can auto-en/decrypt PGP files during load/save, which is EXCELLENT since there is never plaintext on disk. | Emacs can auto-en/decrypt PGP files during load/save, which is EXCELLENT since there is never plaintext on disk. | ||
* You should have gpg installed by default, but apt install if needed. Create a strong key with passphrase | * You should have gpg installed by default, but apt install if needed. Create a strong key with passphrase; see [[gpg]]. | ||
* Configure emacs to prompt for PIN, otherwise gpg-agent prompt and emacs interfere with each other and lock out keyboard: | * Configure emacs to prompt for PIN, otherwise gpg-agent prompt and emacs interfere with each other and lock out keyboard: | ||
emacs ~/.emacs.d/init.el | emacs ~/.emacs.d/init.el |
Revision as of 13:30, 20 April 2021
Emacs is great and sucks too.
Configuration
- Use CUA mode
- This common config should work well in both terminal and UI:
/home/m/development/config/common/home/m/.emacs
NOTE that you need some other things to be configured properly:
- the terminal must use a light light blue background since it will be carried over into [emacs -nw]
- the terminal must have 256-color support; set this in .bashrc:
export TERM=xterm-256color
- Make sure you check out undo support via [ctrl-x u]
GPG
Emacs can auto-en/decrypt PGP files during load/save, which is EXCELLENT since there is never plaintext on disk.
- You should have gpg installed by default, but apt install if needed. Create a strong key with passphrase; see gpg.
- Configure emacs to prompt for PIN, otherwise gpg-agent prompt and emacs interfere with each other and lock out keyboard:
emacs ~/.emacs.d/init.el (setq epa-pinentry-mode 'loopback)
- Use files with .gpg extention to inform emacs to attempt decryption.
- To create a newly encrypted file, just tell emacs to open it, and select your gpg key as encryption target (hit M on it, then hit Enter on the OK "button"). When you save, it will be encrypted.