Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
10

You can achieve what you want by defining a custom function that returns the target location for template expansion: (defun org-find-heading-in-datetree () (org-datetree-find-date-create (calendar-current-date)) (goto-char (point-at-eol)) (when (not (re-search-forward (format org-complex-heading-regexp-format (...


9

You can just type a time, eg 9am, or 1:30pm in the minibuffer.


8

Credits to awalker4 from reddit! (add-hook 'org-capture-mode-hook 'evil-insert-state)


8

From the Org-Mode Manual, you can add the following template element to your custom captures: :prepend t Normally new captured information will be appended at the target location (last child, last table line, last list item...). Setting this property will change that. See the related post Using properties in org-mode capture templates, where for ...


6

You should be able to use the function target form to do this: (defun my/org-file-by-date () "Create an Org file with current time as name." (find-file (format-time-string "~/org/%Y-%m-%d--%H-%M-%S.org"))) (add-to-list 'org-capture-templates '("x" "Template Name" plain (function my/org-file-by-date) "Capture ...


6

From the org-capture help: When called with a ‘C-0’ (zero) prefix, insert a template at point. So C-0 C-c c does what want (assuming C-c c is bound to org-capture).


6

I think you might consider this to be a partial solution to your question. If you include :step day in your clocktable line then you'll get several clock tables emitted -- one per day for the current week in your example. While this answers the first part of your question of showing what tasks were worked on per day, you'll still see those tasks under a ...


6

Yes, it is. For example, with this org file: * my table | blah | blah | And this elisp: (custom-set-variables '(org-capture-templates (quote (("t" "Table" table-line (file+headline "" "my table") "|%?| Blah |"))))) I can run org-capture and it appends a line to the table. If it doesn't find your org file, you may need to replace ...


5

Make sure you have the line (require 'org) before you set the location. This will ensure that the package org where org-directory is defined is loaded before it is used. Also, if you are adding concating a path to org-directory, I think that the path you provide should be relative to org-directory, not an absolute path. In your case you might want to set: ...


5

The default capture templates are only available if you haven't set a value fororg-capture-templates, which means @Dan's suggestion of using add-to-list won't work in this case. If you want to continue using the default tasks template in addition to your own templates, you need to add it explicitly. It takes a bit of digging to find it, hidden in the code of ...


4

You'll want to take a look at Agenda Views, Org-Mode Capture Templates and / or YASnippet. With Org-Mode you can set up capture templates for various tasks and for different target locations, and consolidate all that information in Agenda Views. Morever you can quickly store notes with little interruption to your workflow. There's a wealth of information ...


4

You have to change the third element the template ("entry type"). From the help: type The type of entry. Valid types are: entry an Org node, with a headline. Will be filed as the child of the target entry or as a top-level entry. item a plain list ...


4

Okay, figured it out! Because the template was quoted '(("j"... the concat expression was not being evaluated. What I needed to do was use backquote and then insert a , before the concat statement to allow this part to evaluate: (setq org-capture-templates `(("j" "Journal" entry (file+datetree "~/org/journal.org") ,(concat "* " (format-time-string ...


3

In the capture window you can use standard Org commands. So at any point you could hit C-c C-q (the default binding for org-set-tags-command) to add tags. Refer to the Setting Tags section in the Org manual for more details about tag completion. Update: As noted in the comments, this doesn't quite work. By default tag completion is derived from the ...


3

The best option here would be to configure your capture templates to add entries under a certain heading (e.g Tasks or Notes). That way the other content of the target file is not affected. See the examples in the Org manual: ("t" "Todo" entry (file+headline "~/org/gtd.org" "Tasks") "* TODO %?\n %i\n %a") Another option would be to customize org-...


3

To my overwhelming exasperation, the problem has turned out to be: emoji-cheat-sheet-plus-display-mode, and the order in which it was activated in org mode. I had a hook like so: (defun text-settings () (emoji-cheat-sheet-plus-display-mode)) (add-hook 'org-mode-hook 'text-settings) Somehow -- and I have no idea how -- this was causing the horrible ...


3

The org-capture function puts some properties into the org-capture-plist, i. a. :original-buffer, :original-file and :original-file-nondirectory, which all point to the buffer/file where the capture has been initiated from. The following addition to your capture template will insert the line-number at point in the original buffer: %(with-current-buffer (org-...


3

You may be looking for this, from the org-capture doc: When called with a ‘C-0’ (zero) prefix, insert a template at point. So if you have org-capture bound to for example C-c c, then you could use C-0 C-c c to choose a capture template and insert in the current buffer. You can always bind this to some other key sequence, if using a prefix isn't ...


3

A capture template can contain arbitrary elisp code using the %(...) syntax. We just need a function that takes a string (which will be the region you are capturing) and strips the comment characters. The only fussy thing is learning what the comment start character is. This function runs in the capture buffer, not the original one so we have to jump back ...


3

org-capture already calls org-store-link and puts the information into a property list: (plist-get org-store-link-plist :annotation)


3

This binds SPC m c to opening the ~/capture.org file: (spacemacs/set-leader-keys "mc" (lambda () (interactive) (find-file "~/capture.org"))) The spacemacs manual explains how spacemacs/set-leader-keys works: https://github.com/syl20bnr/spacemacs/blob/master/doc/DOCUMENTATION.org#binding-keys


3

Org provides a couple ways to jump to the most recent captured item. The org-capture command can be called with a C-u C-u prefix to jump to the last entry. For example if you have bound org-capture to C-c c you should be able to use C-u C-u C-c c. By default org-capture will also set a bookmark org-capture-last-stored so you can jump there using standard ...


3

If you look at the org-capture code, there's a :default-time property which by default uses the current time or the value of org-overriding-default-time. What the advice does is it shifts today's date by one day and assigns the new date to that variable, which is obviously a workaround so use it with caution: (advice-add 'org-capture :around (...


3

On the page you linked, it says you can reuse a prompt value with %\1. Instead of %^{Name of Job} twice, use %\\1 for the second occurrence in your template. You'll need the extra \ because it's inside a string and needs to be escaped. ("J" "Jobs" entry (file+headline "~/org/NOTES.org" "Jobs") ; jobs "* TODO %^{Name of Job}\nSCHEDULED: %(org-insert-time-...


2

The documentation I linked to in my original question mentions that if no template string is specified "an appropriate default template will be used." Apparently that default template must be where the unwanted link was coming from. I resolved the issue by adding a template string, * %?. So now my template customization looks like this: '(org-capture-...


2

Here's how you can get the properties from the "parent" in a tree. Does this help you with what you're trying to achieve? * foo :PROPERTIES: :CATEGORY: awesome :END: ** bar Run commands like these #+BEGIN_SRC emacs-lisp (org-set-property "CATEGORY" (save-excursion (org-up-heading-safe) (org-entry-get (point) "CATEGORY"))...


2

I modified the screenshot function to adapt to take a screenshot in Org-capture buffer. (defun org-insert-clipboard (&optional caption) (interactive "P") (let* ((image-dir (if (not (buffer-file-name)) (let ((buffer-name (replace-regexp-in-string "CAPTURE-[0-9-]*" "" (buffer-name)))) (concat (file-name-directory (buffer-file-...


2

org-set-tags won't recognize :NOTE: as a tag, because the heading doesn't exist yet. the following should do it: (setq org-capture-templates `(("n" "Add a note to abc.org file " entry (file+headline "p.abc.org" "logg") ,(concat "* %^{Logg} " "%(flet ((org-get-tags-string () \":NOTE:\")) (org-set-...


2

I had (global-linum-mode 1) on my init.el, and that conflicts with org-capture somehow. I've changed it to (add-hook 'prog-mode-hook 'linum-mode) and the issue was gone. Apparently linum-mode is not compatible with org-capture.


2

There is no hook for org-refile that could usefully save the buffer (there's org-after-refile-insert-hook but it won't help). Since you're capturing you can use org-capture-after-finalize-hook to save. Since you're refiling you don't know which file needs to be save, so just save them all: (add-hook 'org-capture-after-finalize-hook #'org-save-all-org-...


Only top voted, non community-wiki answers of a minimum length are eligible