Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kristijanhusak/vim-simple-notifications
https://github.com/kristijanhusak/vim-simple-notifications
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/kristijanhusak/vim-simple-notifications
- Owner: kristijanhusak
- License: mit
- Created: 2020-09-05T17:13:21.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-05-12T13:19:54.000Z (over 3 years ago)
- Last Synced: 2024-06-10T02:32:47.347Z (3 months ago)
- Language: Vim script
- Size: 9.77 KB
- Stars: 25
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vim-simple-notifications
Simple notification plugin to be used mostly by plugin developers.
Uses floating/popup window if available, and falls back to `echo` if popups are not available.Can be used as a standalone plugin:
```vimL
" Vim packager
call packager#add('kristijanhusak/vim-simple-notifications')
" Vim Plug
Plug 'kristijanhusak/vim-simple-notifications'
```or just copy `autoload/notifications.vim` file to your `autoload` folder, adapt public function names and you're good to go.
## Example usage
All options provided via 2nd argument have default options. Check [autoload/notifications.vim](autoload/notifications.vim#L7)### notifications#info(msg: [List|String], opts: Dictionary)
```vimL
call notifications#info(['This is an info notification', 'that spans multiple lines'])
```
![screenshot-info](https://i.imgur.com/7dstZFc.png)### notifications#warning(msg: [List|String], opts: Dictionary)
```vimL
call notifications#warning(['This is a warning', 'in the top left corner'], {'pos': 'topleft'})
```
![screenshot-warning](https://i.imgur.com/hN47hhx.png)### notifications#error(msg: [List|String], opts: Dictionary)
```vimL
call notifications#error(['Something went wrong', 'Please check your logs'], {'pos': 'top', 'width': 30, 'delay': 10000 })
```
![screenshot-error](https://i.imgur.com/3cQJiiB.png)With title
```vimL
call notifications#error(['Something went wrong', 'Please check your logs'], {'title': '[MyAwesomePlugin]'})
```
![screenshot-error-title](https://i.imgur.com/BxegSKz.png)