Emacs' Org Mode and Productivity Systems

We talked about Vim in another thread, and Emacs has been mentioned a few times.

I’ve been experimenting with Org Mode for a while. It’s an extension for Emacs (a programming editor) that is very convoluted and interesting. My goal is to pull my notes out of Google Docs, Dropbox, Evernote, Trello, and all the other programs I’ve tried and put them in Org Mode. Has anyone else here used it (or similar productivity systems)?

So far, I like it. :slight_smile:

Everything is stored as plain text, so my notes aren’t tied to Emacs or any other software. The notes can be kept in version control (e.g., Git) and/or synced with something like Dropbox.

Here is an overview of how it works:

1 Like

I’m using it too. There is also an SRS extension : drill-mode, that can be used for flash cards (including cloze deletion, multi-sided cards, etc.) but I don’t used it.

The feature I use the most is the tables. Just for that, I can’t do without emacs/org-mode.
The calendar is very useful too.
And you can also export the notes to html/markdown/pdf/…

Oh, and I use that for my bookmarks too (with org-protocole).

Anyway, I’m a huge fan, and all my notes are kept in org-mode, synced with git.

Thanks for the links. I’m usually a Vim user, but I’m using Spacemacs to handle org mode. Are there any other Emacs packages I should check out?

I would switch to Spacemacs entirely, but I don’t know how to function without tabs, and I couldn’t find any way to do that in Emacs. In Vim you can have layouts of buffers (as “windows” in Emacs) like this example which has an HTML file, CSS file, and JS file in one tab view:

Vim buffers

At the top there are tabs like this which let you switch between layouts of buffer windows:

Vim tabs

In that screenshot, I have frontend files (HTML, CSS, JS) in one tab and backend (Python) in another tab. Switching between tabs/layouts is a quick keyboard command (gt or gT).

I would like to use Emacs more, but that’s the main reason I haven’t switched to it when programming. Maybe there is a way to use multiple arrangements of buffers in Emacs (or an entirely different workflow), but I haven’t figured it out yet. :slight_smile:

I’m not a vi user, but there is evil-mode that I think you will like: https://www.emacswiki.org/emacs/Evil

I know that a lot of vi user that go to emacs use Evil-mode. It seems that there is an option for the tab feature you are looking for (https://juanjoalvarez.net/en/detail/2014/sep/19/vim-emacsevil-chaotic-migration-guide/).

However, what I do for a similar behavior (I am using vanilla emacs, not spacemacs, so keys are probably differents, but using C-h f (describe-function) thename-of-the-function, you should have the right shortcut):

  • split the frame in several buffers, using C-x 4 f (find-file-other-window), C-x 4 b (switch-to-buffer-other-window) or just C-x 3 (split-window-below), C-x 2 (split-window-below)
  • store the configuration into a register with C-x r w (window-configuration-to-register) +a letter/number
  • then, you undo the splitting, open some other files/buffers
  • to go back to your config: C-x r j (jump-to-register) + the register letter/number

You could also use different frames and navigate through these frames :

  • C-x 5 f (find-file-other-frame) to open a new frame
  • M-x set-frame-name, to give it a name
  • M-x select-frame-by-name, to navigate between the frames.
    There is also C-x r f to store a frameset, and C-x r j to jump to it.

Which programming languages are you using ?
For python (based on your screenshot ;]) there is a lot of things, that you can find in elpy: https://github.com/jorgenschaefer/elpy
When doing html/css/php/js, I like http://web-mode.org/, but some people prefer multi-web-mode (other options here: https://emacswiki.org/emacs/MultipleModes).

Some other modes that I use:

  • ace-jump
  • helm-mode (similar : ido-mode)
  • rainbow-delimiters
  • company
  • yasnippet
  • projectile
  • magit (a must have)

There is also multiple-cursors that is famous, but I prefer shortcuts, regex-query-replace or macro to achieve the same things.

Hope it helps !

1 Like

Thanks – I’ll check those out. I’m mostly writing Python, JS, PHP, HTML, CSS, etc. at the moment.

I have Evil installed, and Spacemacs comes with some of those, I think. There is a .spacemacs file, where you can add new packages to install, something like this:

dotspacemacs-configuration-layers
  '(
    ;; ----------------------------------------------------------------
    ;; Example of useful layers you may want to use right away.
    ;; Uncomment some layer names and press  (Vim style) or
    ;;  (Emacs style) to install them.
    ;; ----------------------------------------------------------------
    auto-completion
    better-defaults
    emacs-lisp
    git
    xkcd
    shell
    markdown
    ;; etc...
  )

I was thinking that I would learn Emacs through Spacemacs (which is configured for Vim users) and then switch over to plain Emacs + Evil…

1 Like

I just switched from Spacemacs to regular Emacs. I’ll start installing some of your recommended extensions as I experiment with it.

So far I have:

  • Evil
  • Org Mode
  • Rainbow Delimiters

And I found a tabs extension that gives me exactly the workflow that I like. :slight_smile:

Glad you could find how to set up emacs to your convenience :slight_smile:

I think a lot of emacs users like emacs because it’s highly customizable and you can set it up to work exactly how you need.

I found a lot of useful things at the beginning on the emacs wiki, and looking at others configurations. Some “famous/useful” are :

And some blogs with lot of info:

2 Likes

Thanks, I’ll check out those links. :slight_smile:

1 Like

I´m also using Emacs and Spacemacs :stuck_out_tongue: I have been playing with org-mode, it´s cool!!!

2 Likes

I’m finding a lot of interesting things in Emacs, like magit and helm.

This post was helpful with a few things: Vim Within Emacs: An Anecdotal Guide.

Also this: My Workflow with Org-Agenda

And this video on Emacs as a writing tool:

I’m using Vim for most programming, but Emacs keeps looking more interesting (with Vim keybindings).

1 Like

Here’s another Emacs configuration called Doom that someone told me about. I only tried it briefly before going back to my custom Emacs config, because I couldn’t get my capture templates working quickly and didn’t have time to look more closely.

I went back to Vim for coding because everything is familiar. I only use Emacs for Org Mode at the moment.

1 Like

I use Emacs with Evil Spacemacs and Ivy.
“Ivy” is for navigating files and buffers, it is much faster than using tabs.
Org-mode “agenda view” is good for keeping track of todo lists.
Magit is a nice Emacs interface to git.

2 Likes

It looks interesting. I think I’m too used to tabs to switch to another system at this point though. :slight_smile:

I use a vim plugin called denite that lets me fuzzy search for files in a project by name with ctrl-p or for open buffers with space-s – maybe it’s similar to Ivy?

I think if I didn’t have tabs, I wouldn’t know the spatial position of everything and would have to mentally keep track of what was open. I like my tabs system, because most parts of the desktop UI work in similar ways (vim, tmux, modified i3wm). Everything is keyboard controlled and doesn’t need the mouse, so it’s pretty fast.

1 Like

Ivy is better than fuzzy.
Ivy lists file names with paths.
The directory paths provide a kind of spacial positioning.
To narrow the list of files, type path fragments in order, delineated by space
For example, to open “path/to/file_name.org”, type:

pa file na

I usually don’t have to type that much of the path, but you get the idea.

Tabs are OK for a few files, but it doesn’t work so well with more files.

In vim, I always managed buffer lists. Emacs also has a buffer list, but I almost never use it, I just open the files with Ivy.

1 Like

Denite works the same way – maybe the feature was copied from Emacs. :slight_smile:

I think I’m using something called helm-mini to get similar functionality in Emacs.

In most editors, a tab is just a single file. Vim’s tabs are more like “arrangements of splits”. So I might have frontend code in tab 1 (HTML, CSS, and a JS file), and backend code in tab 2 (maybe two Python files, or whatever). I wouldn’t have to disturb the layout of files A, B, and C to switch to the layout for files D and E. To switch between the layouts, gt (right) or gT (left), or something like 3gt (to move 3 tabs to the right).

 tab #1                    tab #2
 +----------+---------+    +----------+---------+
 |          |    B    |    |          |         |
 |          |         |    |          |         |
 |    A     +---------+    |    D     |    E    |
 |          |    C    |    |          |         |
 |          |         |    |          |         |
 +----------+---------+    +----------+---------+

My whole desktop works in a similar way with splits and tabs. Using i3wm, I have two layers of 10 virtual desktops that can be accessed with alt-num (layer 1) or ctrl-alt-num (layer 2).

|----+----+----+----+----|    |----+----+----+----+----|
|  1 |  2 |  3 |  4 |  5 |    | 11 | 12 | 13 | 14 | 15 |
|----+----+----+----+----|    |----+----+----+----+----|
|  6 |  7 |  8 |  9 | 10 |    | 16 | 17 | 18 | 19 | 20 |
|----+----+----+----+----|    |----+----+----+----+----|

Each desktop then has tiles and tabs, kind of like how my vim is setup.

  • Within each virtual desktop are tiles (splits) and tabs of GUI applications and terminals. (The virtual desktops are the layouts here. The i3 tabs just squeeze extra applications into a single virtual desktop, even in tiling mode.)
  • Within each terminal there are splits and layers (tabs/layouts) of tmux panes and sessions.
  • Within tmux panes there are splits and tabs (layouts) of vim.

I tried learning the Emacs way a few times, but it looked like it was going to take a long time to adjust, and this system works well for me. :slight_smile:

1 Like

There is probably a way to do that in Emacs.
Unfortunately Emacs has a steep learning curve.

It looks like there are some ways to save layouts here. Evil-tabs + helm works for me for now when using Org Mode, but I’ll check out Ivy at some point. :slight_smile:

My thoughts after using Org Mode for more than two years:

I really like Org Mode, but the only things I really use it for for are taking notes and capture templates. (Capture templates let you define keybindings to capture different kinds of notes and send them to specific destinations in the filesystem.)

Lately, I’ve been thinking that I might be able to do all of that in [neo]vim along with command line tools.

  • To-do lists: Taskbook or Taskwarrior
  • Notes: write markdown files in Vim (or any text editor), using bash aliases or simple scripts to simulate capture templates.
  • Org Mode is great for managing text-based tables, but there is a table plugin for Vim that might work.
  • Calendar: something like calcurse or gcalcli
  • Export to any format: pandoc

My main frustration with Emacs is that Emacs’ vim emulation (Evil Mode) doesn’t always work consistently across all buffers. It’s also hard for me to keep the configurations in sync. Example: space-b in my Vim closes a buffer, and space-b in my Emacs opens up a list of recent buffers. The two programs have slightly different behavior, and I think it’s harder to switch back and forth than to just pick one.

(Either program is a good choice – I would recommend them over other text editors for anyone whose brain enjoys processing symbols.)

2 Likes

What is the advantage over other spreadsheets like Open Office Calc or Google stuff? Is it mainly to use Emacs key bindings?

Spreadsheets have more features for doing calculations, but I think that plain text has advantages for regular content, note-taking, or other documents. Emacs and Vim can do basic formulas in tables, but not to the extent of a full spreadsheet program.

I installed that table plugin in Vim, and it works well, so I’m going to start taking notes in Vim, using markdown format, instead of Org Mode. I’ll post an update if the new system works out.

1 Like