Skip to content

Latest commit

Β 

History

History
46 lines (36 loc) Β· 1.05 KB

Extensions.md

File metadata and controls

46 lines (36 loc) Β· 1.05 KB
title Extensions
tags
developers
extensions

This is for developers

Example plugin of integrating: obsidian-markmap.nvim

Organize your plugin like

So that your command shows up in the command completion/menu.

β”œβ”€β”€ LICENSE
β”œβ”€β”€ lua
β”‚Β Β  └── obsidian
β”‚Β Β      └── commands
β”‚Β Β          └── map.lua # command name your want to add, should be minimal, requires the logic from map module
β”‚Β Β  └── map
β”‚Β Β      └── init.lua # actual logic
β”œβ”€β”€ plugin
β”‚Β Β  └── map.lua # register your command here
└── README.md
return {
   "obsidian-nvim/obsidian.nvim",
   dependencies = {
      "your/plugin", -- makes sure your plugin loads first
   },
}

Register your command

your-plugin-dir/plugin/map.lua:

require("obsidian").register_command("map", { nargs = 0 })

See commands/init.lua for usage.