When I first tried using Emacs it was to play with Orgmode. I loved Orgmode but being a staunch vim user I really struggled with the key bindings. Ultimately my first attempt to use Orgmode fell by the wayside.
When I learned about evil mode I gave it another go. I stumbled my way through just enough to get evil-mode working and Orgmode became much more usable. I still primarily interacted with Orgmode via direct files. I didn't make use of the agenda other than for searching. I only used Emacs for Orgmode.
Spacemacs is now my primary editor.
For a vim user coming to spacemacs I found this document very helpful. https://spin.atomicobject.com/2016/08/30/introduction-to-spacemacs/
I maintain my spacemacs config in an org file and the configuration snippets are
tangled out to ~/.spacemacs
.
dotspacemacs/layers
These are the layers that I use. I tend to run on develop
branch and update at
no particular interval.
|
|
Completion (Ivy)
I have started to prefer ivy over helm. It seems significantly snappier. I don't seem to miss much from helm. Some of the auto complete for helm took frequncy into account I think, but its easy enough to be more specific in trade for the speed.
|
|
Language Support
|
|
Org-mode
I pretty much live in org-mode. I keep my personal journal with the excellent
org-journal package. I do my presentations with org-reveal, and much more config
down in dotspacemacs/user-config
.
|
|
Spell Checking
Werd Spell checking is nice, and auto completion will pop up correction suggestions when the insertion point is on a misspelled word.
|
|
Email (mu4e)
mu4e must be installed on the system for this to work. I started using mu4e while I was running Ubuntu 16.04. 0.9.11 (the version readily available) worked fine while I got started with a single account.
|
|
I am currently running Ubuntu 16.10 which has mu4e 0.9.16 available in the
default repos. 0.9.16 adds Contexts
as the reccomended way to handle multiple
acccounts. I am configuring contexts in dotspacemacs/user-config
.
How can I apply format=flowed
to my outgoing messages, enabling receiving
clients that support this feature to reflow my paragraphs? Plain text emails
with Content-Type: text/plain; format=flowed
can be reflowed (i.e. line
endings removed, paragraphs refilled) by receiving clients that support this
standard. Clients that don’t support this, show them as is, which means this
feature is truly non-invasive.
Here’s an explanatory blog post which also shows why this is a desirable feature: https://mathiasbynens.be/notes/gmail-plain-text (if you don’t have it, your mails mostly look quite bad especially on mobile devices) and here’s the RFC with all the details: http://www.ietf.org/rfc/rfc2646.txt.
Since version 0.9.17, mu4e send emails with format=flowed
by setting
(setq mu4e-compose-format-flowed t)
in your Emacs init file (~/.emacs
or ~/.emacs.d/init.el
). The transformation
of your message into the proper format is done at the time of sending. In order
to happen properly, you should write each paragraph of your message of as a long
line (i.e. without carriage return). If you introduce unwanted newlines in your
paragraph, use M-q to reformat it as a single line.
If you want to send the message with paragraphs on single lines but without
format=flowed
(because, say, the receiver does not understand the latter as it
is the case for Google or Github), use M-x use-hard-newlines (to turn
use-hard-newlines
off) or uncheck the box format=flowed
in the Text menu
when composing a message.
Useful tools
|
|
|
|
Additional Packages
|
|
END dotspacemacs/layers
-I disable magithub
because I keep getting API errors and it asks me if I want
to work offline-. I am still trying to learn magit by itself so better to have
something that doesn't nag at me constantly before trying to improve my workflow
integration with github specifically.
|
|
dotspacemacs/init
|
|
Theme
|
|
More Defaults
A better font? http://www.tutysara.net/posts/2016/09/03/good-font-for-spacemacs/
|
|
Whitespace Cleanup
|
|
|
|
dotspacemcacs/user-init
|
|
Functions for executing cfengine src blocks
|
|
CFEngine
|
|
nickanderson/cfengine-policy-perms
Function to add unique ID to each entry
I have this function so that I can add a unique id to each entry in the file. It can be obnoxious but my property drawers are folded so its not that intrusive, and it does allow for linking to a nodes unique id so that links can remain working after re-filing entries into different files. Sometimes I have a save hook configured to run this.
|
|
END of dotspacemacs/user-init
|
|
dotspacemacs/user-config
This is where the bulk of my custom config lives.
|
|
IRC
In October of 2017 I started using ERC for my IRC needs. Previously I used irssi inside of a tmux session. I miss the mobile notifications I had setup for irssi, and I miss the always connected agent, but it's much easier to move text inside emacs than from an external console.
Probably with some effort I could replace the functionality of irssinotifier and have some kind of bounder.
|
|
Org-mode
Org-mode is the killer app for emacs. Checkout the details of the org layer by
typing SPC h l org
. The org-layer has support for org-buillets, org-pomodoro,
org-download, and org-projectile.
I have an open pull request to add org-journal support.
The org layer documentation states:
Since version 0.104, spacemacs uses the org
version from the org ELPA
repository instead of the one shipped with emacs. Then, any org
related code
should not be loaded before dotspacemacs/user-config
, otherwise both versions
will be loaded and will conflict.
Because of autoloading, calling to org
functions will trigger the loading up
of the org
shipped with emacs which will induce conflicts.
One way to avoid conflict is to wrap your org
config code in a
with-eval-after-load
block like this:
|
|
But I get errors when I try and use that. Somewhere along the way I picked up this different style:
|
|
Configure TODO Keywords
This sets up quick access to TODO
states. I definitely use TODO
and DONE
but I haven't really found my flow with any other states so this gets messed
with from time to time.
|
|
I like these fancy utf characters in the TODO keywords, but it could complicate manual editing and I would need to fix all my existing keywords first. Keeping it here in case I get a wild hair someday.
|
|
Fast TODO selection
This enables fast todo selection to bring up the menu of TODO keywords when
pressing t
on a headline.
|
|
Babel Languages
|
|
|
|
|
|
Agenda
I consider myself quite unorganized. At least inside my head it feels that way. Org mode really helps me because it can search across multiple files. So I can have as many different files as I like for different projects or clients and then I can search across all of them for something using the agenda view. This specifies each of your org files, or the directories to be searched for org files.
I might want to add the deft directory so that my searches cover those notes as well.
|
|
|
|
|
|
|
|
Clocktables
Use hours for clocktable summaries and show the current clock time in the modeline.
|
|
Hyperlink abbreviations
I link to several issue tracking systems frequently, and link abbreviations make it much nicer.
|
|
Journal
To enable org-journal
in the org layer I need to define
org-enable-org-journal-support
when I enable the layer. If not the org-journal
package won't be installed.
|
|
The default is ~/Documents/journal/
but I prefer to keep my journal inside my
org directory for now.
I now set this when i load the layer.
|
|
I find the default journal file names hard to read and prefer some visual separation.
Note: I would prefer to have them named with a .org
extension but I found
that broke the calendar search functionality.
I now set this when I load the layer
|
|
I like my org files to start off with a Title with a human readable day so that they might look nice if I ever decide to export them.
I now set this when I load the layer
|
|
The default entry is a second level heading (=** =). But since I start with a Title instead of a first level heading I like to bump this back out. Additionally I really dislike the timestamps being inserted at the beginning of each entry. Perhaps for a worklog journal I would like it a bit more.
I now set this when I load the layer.
|
|
Notes (deft)
I like to use #+Title
as the first line in note files.
|
|
Images
I now do the majority of my writing in org-mode. Sometimes I include images. This makes them render in-line by default. I might switch this back off. It's nice but I have found it makes navigating documents more difficult when images are displayed inline.
|
|
org-download
provides functions for capturing and automatically inserting a
screenshot. I didn't like the directories it would create so I figure that using
the normal org attach machinery will keep things tidy.
|
|
Note:
ATTR_HTML: :width x
can be used to control the image rendering within org as well.- Pressing
C-c C-c
while point is onDOWNLOADED
will cause a refresh and the image will resize.
Drag and drop images into org-mode can be useful.
Capturing
I use the TODO
capture all the time. All of the captured TODOs goto the same
place and then I re-file them (Rarely, but I'm trying to get better about it.
There is a slight pain factor involved at times when a single org file gets up
to 30K lines) into other files later on. Note that I clock time during the
capture and then automatically resume the previously clocked task when I am done
capturing.
I keep trying other templates.
|
|
Refiling
When I refile, I want to be able to go up to 5 levels deep. Probably I could take this down a notch or two. Usually I am only filing 1 or 2 levels deep.
|
|
Indention
I picked this up from a co-worker. Before I started using this setting I was managing whitespace indentation inside my org files. Now its all indented automatically but the source itself is not indented. This really makes org-mode feel like more of an application than working in free form text. Slightly more of a word processor feel.
|
|
Exporting
My primary authoring tool is org. Being able to easily export to other formats is amazing.
|
|
|
|
Publishing
You can export sets of files using the publishing functionality. I use this to export my notes for colleagues to be able to access. I publish my notes in multiple formats because different strokes for different folks.
|
|
END of Org
And here we close out with-eval-after-load 'org
|
|
Blogging via Hugo
I switched from wordpress to hugo for my blog. I really wanted a to move to a static site generator and Hugo can nativly parse org formatted source files.
The easy-hugo
package makes creating new posts with easy-hugo-newpost
,
previewing the blog with easy=hugo=preview
, and publishing the blog with
easy-hugo-publish
convenient. The easy-hugo
mode doesn't really work well
inside spacemacs yet.
|
|
CFEngine
I am constantly working with CFEngine. These customizations improve my life.
CFEngine complains if files are writable by other users. This function is used to set permissions on CFEngine policy files correctly as they are edited.
|
|
progn | (add-hook (quote cfengine3-mode-hook) (lambda nil (linum-mode 1) (add-hook (quote after-save-hook) (quote nickanderson/cfengine-policy-perms) nil (quote make-it-local)))) |
|
|
(lambda nil (linum-mode 1) (add-hook (quote after-save-hook) (quote nickanderson/cfengine-policy-perms) nil (quote make-it-local))) | eldoc-mode |
I like line numbers when I am doing policy.
Turn on line numbers for cfengine3-mode and set permissions of saved files to owner only. The Masterfiles Policy Framework restricts policy file permissions down by default, this helps to stay in line with those defaults, additionally it helps to avoid errors when testing locally.
> $ cf-agent -Kf ./example.cf error: File ./example.cf (owner 1000) is writable by others (security exception)
Zooming
Add these keys in to support familiar zooming of text with Ctrl+
and Ctrl-
.
|
|
mu4e (Email)
All of my email accounts are currently hosted on google infrastructure (ewww i know). At any rate, changing the filename when moving messages is very important for mbsync to work correctly. Without this config option mbsync will begin to throw errors during sync.
|
|
Since mu4e 0.9.16 which I have begun using the builtin contexts to help manage multiple email accounts.
|
|
END of dotspacemacs/user-config
|
|
Custom set variables and faces
|
|