1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-24 02:20:03 +08:00
SpaceVim/docs/api/notify.md

37 lines
1.1 KiB
Markdown

---
title: "notify API"
description: "notify API provides some basic functions for generating notifications"
---
# [Available APIs](../) >> notify
<!-- vim-markdown-toc GFM -->
- [Intro](#intro)
- [Functions and variables](#functions-and-variables)
- [Usage](#usage)
<!-- vim-markdown-toc -->
## Intro
This api provides some basic Functions for generating notifications.
## Functions and variables
| function name | description |
| --------------------------- | -------------------------------------------------------- |
| `notify(string)` | generate notification with default color |
| `notify(string, highlight)` | generate notification with custom highlight group |
| `notify.notify_max_width` | set the max width of notify windows |
| `notify.timeout` | set the time in milliseconds to close the notify windows |
## Usage
```vim
let s:NOTIFY = SpaceVim#api#import('notify')
let s:NOTIFY.notify_max_width = 40
let s:NOTIFY.timeout = 3000
call s:NOTIFY.notify('This is a simple notification!')
```