In Org-mode, when creating internal links, we have to type full name of the section heading to which we want to link.

Is it possible that the heading name gets automatically filled in when we are creating a new internal link? When creating a new link, we type a few characters and headings matching the characters are shown, and then we can choose from the list.

Maybe some way using helm?


The Org mode info manual has a footnote on (org) Internal links web link:

(1) To insert a link targeting a headline, in-buffer completion can be used. Just type a star followed by a few optional letters into the buffer and press `M-<TAB>'. All headlines in the current buffer will be offered as completions.

In case your desktop environment intercepts M-TAB before it reaches Emacs you can instead type <ESC> <TAB>.

  • Thanks for the answer. I didn't realize it was right there in the official documentation!! But this doesn't work for my setup. I'm using Spacemacs, so that may be the reason. I'll try it on a bare-bones emacs setup and then revert back. – shivams Dec 25 '16 at 11:06
  • For me, the M-<TAB> completion only works when I create links by writing literal markup, i.e. [[<link target>]]. If I use C-c C-l to insert a link, then completion for the link target using M-<TAB> does not work. So, I can type [[*M-<TAB> to complete section titles, but C-C C-l *M-<TAB> does not complete section titles. – ntc2 Oct 10 '17 at 23:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.