link to the video
original essay
- Write in past tense so you don’t have to re-edit when mailing
- cource code blocks can be created with
<s<TAB>
C-c C-c
executes:exports [code|results|both|none]
to export code/:dir <dir>
relative path for cwdC-c '
to open code block in its own buffer:tangle <filename>
to export code block to file- code block attributes can be put in a section property, like
:PROPERTIES: :dir: <relative dir> :END:
- name blocks with
#+NAME: <name>
(shortcut:<n<TAB>
)
#+BEGIN_SRC :var VARNAME=<something>
Note that something
can be the name of a code block, then the value will be
the output of that code block.
:results table
returns a table that can be indexed liketable[2,3]
You can use tramp filenames and it will execute remotely
:dir: /scp:my.server.com:mydir
Create another code block that uses a variable, call this function from the
first block with the :post
command:
\#+BEGIN_SRC :results value list :post column1(data=*this*)
bla
\#+END_SRC
\#+BEGIN_SRC elisp :var data="" :results value
(mapcar 'car data)
\#+END_SRC
Source code blocks that can be used in multiple projects can be put into the org-mode “tower of babel”. (Personal note: It is debatable whether this is a good idea, since now everything depends on your local setup.)
Add a :session: <label>
property. This also creates a buffer with a remote
eshell in it.
Use a tramp-style link to reference remote files, which you can then click and edit in-place.
Route through multiple hosts like this:
/ssh:bastion.mydomain.com|jumpbox.mydomain.com|dest-host:some-file.org
Also, change protocol:
/ssh:bastion.mydomain.com|sudo:bastion.mydomain.com:/etc/passwd
First of all, thx a lot for this.
Second, because of (what I think are) some Org 9 syntax changes, the correct procedure to assign code block attributes to a section are now:
And to ssh multi-hop:
/ssh:user@domain.com|ssh:user@otherdomain.com:/path/to/whatever
Took me quite a while to find that out, so I'm putting it out here.
Also, things won't work if you have them within a
shell
SRC_BLOCK. Only within ash
SRC_BLOCK.