69 lines
1.7 KiB
Org Mode
69 lines
1.7 KiB
Org Mode
* orgmode-babel.nvim
|
|
|
|
An *experimental* plugin that evaluates and tangles code blocks in
|
|
[[https://github.com/nvim-orgmode/orgmode][nvim-orgmode]] using
|
|
[[https://orgmode.org/worg/org-contrib/babel/][babel]] itself.
|
|
|
|
It uses ~emacs~ under the hood for perfect compatibility, but does not require
|
|
you to add anything extra to your ~init.el~.
|
|
|
|
[[https://github.com/mrshmllow/BetterRecipeBook/assets/40532058/b1ca7384-4bb3-47d8-9148-b85f3a2ea54a][Demonstration]]
|
|
|
|
** Requirements
|
|
|
|
- [[https://github.com/nvim-orgmode/orgmode][nvim-orgmode]]
|
|
- [[https://github.com/nvim-treesitter/nvim-treesitter][nvim-treesitter]]
|
|
- Neovim v0.9.0 or later
|
|
- A working ~emacs~ installation (does not require configuration)
|
|
|
|
** Setup
|
|
|
|
*** lazy.nvim
|
|
|
|
#+begin_src lua
|
|
{
|
|
"mrshmllow/orgmode-babel.nvim",
|
|
dependencies = {
|
|
"nvim-orgmode/orgmode",
|
|
"nvim-treesitter/nvim-treesitter"
|
|
},
|
|
cmd = { "OrgExecute", "OrgTangle" },
|
|
opts = {
|
|
-- by default, none are enabled
|
|
langs = { "python", "lua", ... }
|
|
}
|
|
},
|
|
#+end_src
|
|
|
|
** Usage
|
|
|
|
All commands accept a ~!~ to skip confirmation.
|
|
|
|
*** ~:OrgE[xecute]~
|
|
|
|
Evaluates every block in buffer.
|
|
|
|
See [[https://orgmode.org/manual/Working-with-Source-Code.html][Working with
|
|
Source Code]] in the org manual.
|
|
|
|
*** ~:{range}OrgE[xecute]~
|
|
|
|
Evaluate every block in range.
|
|
|
|
*** ~:OrgE[xecute] [name]~
|
|
|
|
Evaluate ~[name]~ block.
|
|
|
|
*** ~:OrgT[angle]~
|
|
|
|
Tangles whole file.
|
|
|
|
See [[https://orgmode.org/manual/Extracting-Source-Code.html][Extracting Source
|
|
Code]] in the org manual.
|
|
|
|
*** ~:{range}OrgT[angle]~
|
|
|
|
Tangles all blocks in range. If the range is NOT ~%~, the tangled file will
|
|
likely only contain the contents of the last block, which is expected
|
|
behaviour.
|
|
|