Spacemacs, Emacs, and Org-mode tips

Spacemacs

James Adam has written a very useful blog about his experience with Spacemacs.

Eivind Fonn has a very methodical set of YouTube videos for learning Spacemacs.

Projects

To define a directory or folder as a project, create an empty .projectile file within it.

To create this file in your current folder do SPC f f (find or create file).
Type .projectile ENTER then SPC f s and then SPC b d to create and close the file.
Spacemacs needs to be restarted to recognize this folder as a project SPC q r

SPC p t to open a file explorer view of a project.

Neotree

You can navigate with the mouse or the j and k keys. ENTER opens the file under the cursor. Switch back and forth between your editing window and Neotree with SPC 0 and SPC 1

q to quit NeoTree

Search within project

Searching for instances of text within a project (on my system SPC s p does not work)

can be done with SPC /

but requires that you install ag (the silver searcher). Install with

brew install the_silver_searcher

SPACE * to find text under cursor in project or selected with visual-mode.

SPACE s l to resume last search (yes, that's the letter L).

SPC p f to find a file within a project.

Matt Nedrich has a good Introduction to Spacemacs and searching in projects.

 

Search in Vi mode

(assuming you chose the Vi editing style on installation of Spacemacs)

/ to find text in buffer. Type in your text, press ENTER

n to find next instance; N previous.

* to find the next instance of the word under your cursor.

# to find the previous instance the word under your cursor.

Take a look at Emacs nifty tricks from the Emacs Wiki


Org-mode

This is a fairly in-depth configuration. Check out the rest of this informative site.

Excellent video demonstrating org-mode’s capabilities from John Kitchin.

Another video demonstrating his org-ref.

Aizan Fahri describes his experience with org-mode in Spacemacs.

Ignore

The :ignore: feature of org-mode is pretty handy when writing long documents. It can be used to emulate one of Scrivener’s features: use of non-printing headers for text snippets.

As Daniel says, on his blog about writing a thesis with org-mode, it’s not a part of Org core, but rather a contribution to be found in ox-extra.el.

To activate the :ignore: feature, add the following to your .spacemacs file: Open the file with SPC f e d

and scroll or search to find the line

(defun dotspacemacs/user-config ()

copy and paste the following directly below that line.
;; Use :ignore: on headings so that they are not exported
(require 'ox-extra)
(ox-extras-activate '(ignore-headlines))

Do SPC f s
and SPC b d

to save and close your .spacemacs
and SPC q r to restart.

Now you can use :ignore: in an org file by appending :ignore: to any heading you do not wish to be exported.

Ignore

Bonus tip

Emacs Lisp

Just enough Emacs Lisp from John Ballantyne

An Introduction to Programming in Emacs Lisp – beautifully written by Robert J. Chassell

Note that these guides refer to the Emacs keystrokes. I hope to edit the latter for Spacemacs and post it here soon.

License

Copyright © 2016 Christopher J Poor. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.

Code in this document is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This document and its code are distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details <http://www.gnu.org/licenses/>.

Share this:

6 thoughts on “Part 2”

  1. haff112 December 2, 2016 at 6:42 pm Edit Thanks for this post. I’ve been using Spacemacs for programming/academic writing but I’ve recently gone through some pretty miserable experiences getting .org files into .odt/.docx. What I love about this approach is: – Working in Spacemacs is incredibly faster than any word processor
    – You can embed images in .org that render in .odt/.docx
    – Organizing a paper into sections is way easy
    – Pandoc seems to work pretty well What I’m still having a hard time with is: – Altering figure/table number and styles.
    – Centering images
    – Creating tables. I know that this is possible with .org tables, but org’s functionality here seems lacking. E.g. I can’t seem to create merged/nested columns.
    – Changing font/pitch. It seems as though most (not the table stuff) has to do with LibreOffice settings rather than org/spacemacs. Do you have any tips on how to deal with these issues? Like Reply
    1. cjpoor December 4, 2016 at 3:46 am Edit I’m afraid I don’t use these features of org.mode so I have to refer you to their forum. You can also ask on Reddit and Stackexchange. I will have a look at it when I get back home. I’m currently in Shanghai. Like Reply
      1. haff112 December 8, 2016 at 3:30 pm Edit I hadn’t seen that. Thanks for sharing! Like
    2. cjpoor December 6, 2016 at 6:43 am Edit Did you find this on stackexchange?
      http://emacs.stackexchange.com/questions/7299/multicolumn-cells-in-org-mode-tables Like Reply
  2. baftigualta January 4, 2017 at 9:51 pm Edit This is a great beginner series, thank you for sharing. Will there be third part with focus on Auctex and advanced editing within spacemacs (snippets, surround etc)? Like Reply
    1. cjpoor January 5, 2017 at 2:22 am Edit That’s a good idea. I was thinking of making part 3 mainly about using org and git.
      Thanks for the comment. Like Reply

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Cheat Sheets

Cheat Sheet 1

One-page Spacemacs cheat sheet

Updated cheat sheet with live links

For more org-mode key bindings see
Org Layer documentation

Not exactly a cheat sheet
Command Line Tips


Tweet

Blogroll