From 69dec0fe7e7c22689bc8d619cf3e5b743d1c0c6d Mon Sep 17 00:00:00 2001 From: Pocco81 Date: Mon, 23 Aug 2021 21:42:12 -0500 Subject: [PATCH] dev: added info about hooks usage --- README.md | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 49e36d9..26dc7bd 100644 --- a/README.md +++ b/README.md @@ -122,7 +122,7 @@ Plugin 'Pocco81/Catppuccino.nvim' NeoBundleFetch 'Pocco81/Catppuccino.nvim' ``` -## Setup (configuration) +## Setup There are already some sane defaults that you may like, however you can change them to match your taste. These are the defaults: @@ -452,6 +452,25 @@ diff = { -- also used for gitsigns
+## Hooks + +Use them to execute code at certain events [described by their names]. These are the ones available: + +| Function | Description | +|--------------------|------------------------------| +| `before_loading()` | Before loading a colorscheme | +| `after_loading()` | After loading a colorscheme | + +They can be used like so: + +``` +local catppuccino = require("catppuccino") + +catppuccino.before_loading = function () + print("I ran before setting a colorscheme!") +end +``` + # 🙋 FAQ - Q: **_"How can I view the doc from NeoVim?"_**