diff options
author | Dante Catalfamo | 2020-06-18 16:26:51 -0400 |
---|---|---|
committer | Dante Catalfamo | 2020-06-18 16:26:51 -0400 |
commit | c67aec76887935c3508e287036e1af136811ff2d (patch) | |
tree | 2b5c541707afd5ba6af86b995ec70b02db60d7b4 /content | |
parent | ca9c86e6409c7636d856ee883138f93a257b1ed4 (diff) | |
download | blog-c67aec76887935c3508e287036e1af136811ff2d.tar.gz blog-c67aec76887935c3508e287036e1af136811ff2d.tar.bz2 blog-c67aec76887935c3508e287036e1af136811ff2d.zip |
Add stop-mg-from-making-a-mess article
Diffstat (limited to 'content')
-rw-r--r-- | content/post/stop-mg-from-making-a-mess.org | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/content/post/stop-mg-from-making-a-mess.org b/content/post/stop-mg-from-making-a-mess.org new file mode 100644 index 0000000..fd29e42 --- /dev/null +++ b/content/post/stop-mg-from-making-a-mess.org @@ -0,0 +1,49 @@ +#+TITLE: Stop Mg From Making A Mess +#+DATE: 2020-06-18T16:04:33-04:00 +#+DRAFT: false +#+DESCRIPTION: +#+TAGS[]: openbsd emacs +#+KEYWORDS[]: +#+SLUG: +#+SUMMARY: + +If you've been an OpenBSD user for any period of time, you probably +know what =mg= is. For those who don't know, =mg= stands for +MicroGnuEmacs. It's a small clone of Emacs maintained by the OpenBSD +team that's included with the base system. + +Being an Emacs user, I love that =mg= is part of the OpenBSD base +system. It's great to have an editor that has familiar keybinds on a +system that I haven't had the time to install any packages on. It also +has (in my opinion), more useful features than =vi=, like =auto-fill-mode= +and =dired=. + +Despite all of the excellent things it emulates from Emacs, it also +emulates a couple behaviours from Emacs that I find a little +annoying. One of those behaviours is leaving backup files everywhere +when editing. Backup files have the original file name, with a tilde +appended to the end. So if you're editing =pf.conf=, =mg= will +automatically create a backup file called =pf.conf~= in the same +directory. + +Backup files can be incredibly useful if you same a mistake while +editing and you want to see what the original file looked like, but +after a while of editing files, seeing your =/etc/= littered with +files ending in =~= can be a little annoying. + +Fortunately the creators of =mg= are aware of this issue and have +provided a way to deal with it. + +Edit the =.mg= in your home directory, or create it if it doesn't +exist. Then add the following line + +#+BEGIN_SRC +backup-to-home-directory +#+END_SRC + +That's it. Now =mg= will still create backup files, but it will save +them to =~/.mg.d/= instead of the directory of the file you're +editing. It saves the file as the full path to the original file, with +the forward slashes replaced by exclamation marks. So if you were +editing =/etc/pf.conf=, the backup file will be saved as +=~/.mg.d/!etc!pf.conf~=. |