Org Mode Completion

By far the most useful weapon in my Emacs efficiency arsenal is abo-abo’s Ivy library and associated utilities. Everything from simple string searches with swiper to finding files with counsel-M-x is easier and faster than before. Therefore, when abo-abo suggests a way of improving efficiency, I pay close attention.

In a recent blog post, abo-abo writes about extending completion-at-point for Org mode. It turns out that there is a general purpose command, complete-symbol (bound to Ctrl+Meta+i by default), that will complete the symbol at point depending on context. To do this you need a function that completes symbols in the current major mode. Some modes, like Elisp mode, have functions provided by default but, sadly, Org mode does not have any predefined.

Abo-abo’s post provides three functions that ease his workflow. The first completes ASCII marked-up symbols like this. The second takes care of completing file names and the third handles references. These functions are all pretty simple and offer excellent go-bys if you want to write one to optimize your work flow.

This is a great post and definitely worth the 5 minutes of your time that it will take to read it.

This entry was posted in General and tagged , . Bookmark the permalink.
  • NoonianAtall

    At least some of these can already be done without any custom functions. For example, when I type "=blah= =b" in an Org buffer and then press M-/, it runs hippie-expand, which runs, among other expansion functions in my config, try-expand-dabbrev-visible, which completes it to "=blah= =blah=", like the first custom function he describes.