blog // ~snubspreker

this is just a test

Maybe you wanna try emacs

April 13, 2020 — ~snubspreker


I know, you are a vim, Atom, SublimeText, etc. user and you don't see the need to change. Well yeah, if you have an editor and you are happy then just ignore me. But maybe you are curious about emacs or maybe you've heard about org-mode.

Well, there are much better blogs about emacs than anything you will get here. I will probably include a few links. But maybe you just want to tinker, and if you are like me, you only need a little info to get you going.

So, here is a little info.

Emacs is ugly

Yep. Plain old emacs is U.G.L.Y. no joke. There are tons of packages available that will fix this ugliness issue in one way or another. But you don't need all that to use emacs.

Toward a really useful emacs

When I first started using emacs the main thing I hated about it was scroll bars, menu bars, buttons, and the colors.

Well, if you are using emacs from a terminal logged into your account you don't have to worry about the buttons or scroll bars, but the menu is still there and the colors could be better.

When you start emacs, the first thing you see is a splash screen the GNU Emacs buffer. It has lots of great info and you really will benefit from any time spent reading or following the tutorials.

However, if you press q on the keyboard, that buffer will go away because q is bound to a function exit-splash-screen.

The next buffer you see

The scratch buffer is a kind of swiss army knife. You can use it for notes or for testing little scraps of elisp like those below.

(menu-bar-mode -1)                ;; don't need the menu bar especially in terminal
(load-theme 'wombat)              ;; but you want some color
(defalias 'yes-or-no-p 'y-or-n-p) ;; change yes or no to y or n
(show-paren-mode 1)               ;; show matching parens

Type those statements in the scratch buffer (or just copy and paste. Then press and hold the Alt and the letter x. This puts you in the mini-buffer. Just type eval-buffer and press enter.

You should see an immediate change. Emacs should look much nicer.

Make it semi-permanent

If you have a login you have emacs available as one of many choices. Nano is the default, but you can edit you ~.bashrc

# set EDITOR just in case
export EDITOR=emacs     # Just change this line that used to say nano
export PATH=$PATH:~/.local/bin

Of course if you aren't that committed you can just call it from the command line.

You emacs init.el

But say you like what you see and you want to play around with it. In the scratch buffer, just press Ctrl + x, followed by Ctrl + w. You'll be asked where youd like to save it. There are a couple of places you could save it, but for now just save it to ~.emacs.d/init.el/ and the next time you start emacs these changes will load automatically.

This is a very simplistic walk-through, but should get you started. I hope to keep going with these sorts of things. And I might make a git repo.