Table of Contents

Next: , Previous: Tag inheritance, Up: Tags

6.2 Setting tags

Tags can simply be typed into the buffer at the end of a headline. After a colon, M-<TAB> offers completion on tags. There is also a special command for inserting tags:

C-c C-q
Enter new tags for the current headline. Org mode will either offer completion or a special single-key interface for setting tags, see below. After pressing <RET>, the tags will be inserted and aligned to org-tags-column. When called with a C-u prefix, all tags in the current buffer will be aligned to that column, just to make things look nice.
C-c C-c
When the cursor is in a headline, this does the same as C-c C-q.

Org will support tag insertion based on a list of tags. By default this list is constructed dynamically, containing all tags currently used in the buffer. You may also globally specify a hard list of tags with the variable org-tag-alist. Finally you can set the default tags for a given file with lines like

     #+TAGS: @work @home @tennisclub
     #+TAGS: laptop car pc sailboat

By default Org mode uses the standard minibuffer completion facilities for entering tags. However, it also implements another, quicker, tag selection method called fast tag selection. This allows you to select and deselect tags with just a single key press. For this to work well you should assign unique letters to most of your commonly used tags. You can do this globally by configuring the variable org-tag-alist in your .emacs file. For example, you may find the need to tag many items in different files with ‘:@home:’. In this case you can set something like:

     (setq org-tag-alist '(("@work" . ?w) ("@home" . ?h) ("laptop" . ?l)))

If the tag is only relevant to the file you are working on, then you can instead set the TAGS option line as:

     #+TAGS: @work(w)  @home(h)  @tennisclub(t)  laptop(l)  pc(p)