You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If =true=, whenever the attachments directory itself is a symlink, and it
1234
+
is copied due to the [[https://orgmode.org/manual/Attachment-defaults-and-dispatcher.html*index-C_002dc-C_002da-s][set_directory]] or [[https://orgmode.org/manual/Attachment-defaults-and-dispatcher.html*index-C_002dc-C_002da-S][unset_directory]] action, copy the
1235
+
symlink itself. The default is to treat the symlink transparently as
1236
+
a directory.
1237
+
1238
+
*** =org_attach_visit_command=
1239
+
:PROPERTIES:
1240
+
:CUSTOM_ID: org_attach_visit_command
1241
+
:END:
1242
+
- Type: =string|fun(path: string)=
1243
+
- Default: ='edit'=
1244
+
1245
+
Command or function used to open a directory. The default opens NetRW if it
1246
+
is available.
1247
+
1248
+
*** =org_attach_use_inheritance=
1249
+
:PROPERTIES:
1250
+
:CUSTOM_ID: org_attach_use_inheritance
1251
+
:END:
1252
+
- Type: ='always'|'selective'|'never'=
1253
+
- Default: ='selective'=
1254
+
1255
+
Attachment inheritance for the outline.
1256
+
1257
+
Enabling inheritance implies two things:
1258
+
1. Attachment links will look through all parent headlines until they find
1259
+
the linked attachment.
1260
+
2. Running =attach= inside a node without attachments will operate on the
1261
+
first parent headline that has an attachment.
1262
+
1263
+
Possible values are:
1264
+
1265
+
- =always= - inherit attachments
1266
+
- =selective= - respect [[#org_use_property_inheritance][org_use_property_inheritance]] for the properties =DIR= and =ID=
List of functions that are tried sequentially to derive an attachment path
1300
+
from an =ID= property. The functions are called with a single =id= argument
1301
+
until the return value is an existing folder. The ID format passed to the
1302
+
functions is usually defined by [[#org_id_method][org_id_method]].
1303
+
1304
+
If no folder has been created yet for the given ID, then the first truthy
1305
+
value defines the path of the folder to be created.
1306
+
1307
+
The default functions avoid putting all attachment directories directly
1308
+
inside [[#org_attach_id_dir][org_attach_id_dir]]. Some file systems have performance issues in
1309
+
such scenarios.
1310
+
1311
+
Be careful when changing this setting. If you remove a function, previously
1312
+
created attachment folders may be no longer mapped correctly and Org may be
1313
+
unable to detect them.
1314
+
1315
+
*** =org_attach_sync_delete_empty_dir=
1316
+
:PROPERTIES:
1317
+
:CUSTOM_ID: org_attach_sync_delete_empty_dir
1318
+
:END:
1319
+
- Type: ='always'|'ask'|'never'=
1320
+
- Default: ='ask'=
1321
+
1322
+
Determines whether to delete empty directories during [[https://orgmode.org/manual/Attachment-defaults-and-dispatcher.html*index-C_002dc-C_002da-z][org_attach_sync]].
1323
+
1324
+
- =never= - never delete empty directories
1325
+
- =ask= - ask the user whether to delete
1326
+
- =always= - delete empty directories without asking
1327
+
1162
1328
** Mappings
1163
1329
:PROPERTIES:
1164
1330
:CUSTOM_ID: mappings
@@ -2069,6 +2235,13 @@ See [[#clocking][Clocking]] for more details.
2069
2235
- Mapped to: =<leader>obt=
2070
2236
Tangle current file. See [[#extract-source-code-tangle][Extract source code (tangle)]] for more details.
2071
2237
2238
+
**** =org_attach=
2239
+
:PROPERTIES:
2240
+
:CUSTOM_ID: org_attach
2241
+
:END:
2242
+
- Mapped to: =<Leader>o<C-A>=
2243
+
Open the attach dispatcher. See [[#attachments][Attachments]] for more details.
2244
+
2072
2245
**** =org_show_help=
2073
2246
:PROPERTIES:
2074
2247
:CUSTOM_ID: org_show_help
@@ -2753,6 +2926,43 @@ Running [[#org_babel_tangle][org_babel_tangle]] will create file =~/org/my_tangl
2753
2926
=print('Headline 1')=
2754
2927
=#+end_src=
2755
2928
2929
+
*** Attachments
2930
+
:PROPERTIES:
2931
+
:CUSTOM_ID: attachments
2932
+
:END:
2933
+
2934
+
There is almost complete support for file attachments (Orgmode link:
2935
+
[[https://orgmode.org/manual/Attachments.html][Attachments]]). You can use [[#org_attach][org_attach]] to open the dispatcher and attach
2936
+
files to an "attachment node" (either a headline or an entire org
2937
+
file).
2938
+
2939
+
Attaching a file puts it in a directory associated with the attachment node.
2940
+
Based on [[#org_attach_preferred_new_method][org_attach_preferred_new_method]], this either uses the =ID= or
2941
+
the =DIR= property. See also [[#org_attach_id_dir][org_attach_id_dir]],
2942
+
[[#org_attach_dir_relative][org_attach_dir_relative]], [[#org_attach_id_to_path_function_list][org_attach_id_to_path_function_list]] and
2943
+
[[#org_attach_use_inheritance][org_attach_use_inheritance]] on how to further customize the attachments
2944
+
directory.
2945
+
2946
+
Attachment links are supported. A link like =[[attachment:file.txt]]=
2947
+
looks up =file.txt= in the current node's attachments directory and opens
2948
+
it. Attaching a file stores a link to the attachment. See
2949
+
[[#org_attach_store_link_p][org_attach_store_link_p]] on how to configure this behavior.
2950
+
2951
+
You can also attach files from a different buffer. The following
2952
+
mapping attaches the path under the cursor to the current headline of the
2953
+
most recently open org file:
2954
+
2955
+
#+begin_src lua
2956
+
vim.keymap.set('n', '<Leader>o+', function()
2957
+
local file = vim.fn.expand('<cfile>')
2958
+
local org = require('orgmode')
2959
+
org.attach:attach_to_other_buffer(file)
2960
+
end)
2961
+
#+end_src
2962
+
2963
+
The only missing feature is expansion of attachment links before exporting
0 commit comments