retrovim 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.conda/retrovim.yaml +259 -0
- package/.conda/terax.icns +0 -0
- package/.conda/terax.ico +0 -0
- package/.conda/terax.png +0 -0
- package/.github/workflows/release.yml +95 -0
- package/.gitmodules +3 -0
- package/.npm/kanata_touchcursor.js +28 -0
- package/.npm/nvim.js +26 -0
- package/.npm/yazi.js +26 -0
- package/.npm/zsh.js +17 -0
- package/.pip/kanata_touchcursor/__init__.py +28 -0
- package/.pip/nvim/__init__.py +31 -0
- package/.pip/yazi/__init__.py +31 -0
- package/.pip/zsh/__init__.py +22 -0
- package/CHANGELOG.md +26 -0
- package/LICENSE +674 -0
- package/README.md +336 -0
- package/kanata/touchcursor.kbd +164 -0
- package/nvim/init.lua +813 -0
- package/nvim/plugins/mini.nvim/.github/DISCUSSION_TEMPLATE/q-a.yml +72 -0
- package/nvim/plugins/mini.nvim/.github/ISSUE_TEMPLATE/bug-report.yml +136 -0
- package/nvim/plugins/mini.nvim/.github/ISSUE_TEMPLATE/config.yml +5 -0
- package/nvim/plugins/mini.nvim/.github/ISSUE_TEMPLATE/feature-request.yml +75 -0
- package/nvim/plugins/mini.nvim/.github/PULL_REQUEST_TEMPLATE.md +2 -0
- package/nvim/plugins/mini.nvim/.github/workflows/quality-control.yml +150 -0
- package/nvim/plugins/mini.nvim/.pre-commit-config.yaml +20 -0
- package/nvim/plugins/mini.nvim/.stylua.toml +7 -0
- package/nvim/plugins/mini.nvim/.styluaignore +1 -0
- package/nvim/plugins/mini.nvim/CHANGELOG.md +1894 -0
- package/nvim/plugins/mini.nvim/CODE_OF_CONDUCT.md +132 -0
- package/nvim/plugins/mini.nvim/CONTRIBUTING.md +331 -0
- package/nvim/plugins/mini.nvim/LICENSE +21 -0
- package/nvim/plugins/mini.nvim/MAINTAINING.md +330 -0
- package/nvim/plugins/mini.nvim/Makefile +51 -0
- package/nvim/plugins/mini.nvim/README.md +261 -0
- package/nvim/plugins/mini.nvim/TESTING.md +1011 -0
- package/nvim/plugins/mini.nvim/benchmarks/starter/README.md +35 -0
- package/nvim/plugins/mini.nvim/benchmarks/starter/benchmark.sh +56 -0
- package/nvim/plugins/mini.nvim/benchmarks/starter/init-files/init_dashboard-alpha.lua +21 -0
- package/nvim/plugins/mini.nvim/benchmarks/starter/init-files/init_dashboard-original.lua +17 -0
- package/nvim/plugins/mini.nvim/benchmarks/starter/init-files/init_dashboard-starter.lua +18 -0
- package/nvim/plugins/mini.nvim/benchmarks/starter/init-files/init_empty.lua +4 -0
- package/nvim/plugins/mini.nvim/benchmarks/starter/init-files/init_starter-default.lua +7 -0
- package/nvim/plugins/mini.nvim/benchmarks/starter/init-files/init_startify-alpha.lua +10 -0
- package/nvim/plugins/mini.nvim/benchmarks/starter/init-files/init_startify-original.lua +7 -0
- package/nvim/plugins/mini.nvim/benchmarks/starter/init-files/init_startify-starter.lua +20 -0
- package/nvim/plugins/mini.nvim/benchmarks/starter/install.sh +10 -0
- package/nvim/plugins/mini.nvim/benchmarks/starter/make_summary.py +68 -0
- package/nvim/plugins/mini.nvim/benchmarks/starter/startup-summary.md +10 -0
- package/nvim/plugins/mini.nvim/colors/miniautumn.lua +55 -0
- package/nvim/plugins/mini.nvim/colors/minicyan.lua +95 -0
- package/nvim/plugins/mini.nvim/colors/minischeme.lua +95 -0
- package/nvim/plugins/mini.nvim/colors/minispring.lua +53 -0
- package/nvim/plugins/mini.nvim/colors/minisummer.lua +49 -0
- package/nvim/plugins/mini.nvim/colors/miniwinter.lua +51 -0
- package/nvim/plugins/mini.nvim/colors/randomhue.lua +16 -0
- package/nvim/plugins/mini.nvim/doc/mini-ai.txt +889 -0
- package/nvim/plugins/mini.nvim/doc/mini-align.txt +923 -0
- package/nvim/plugins/mini.nvim/doc/mini-animate.txt +937 -0
- package/nvim/plugins/mini.nvim/doc/mini-base16.txt +285 -0
- package/nvim/plugins/mini.nvim/doc/mini-basics.txt +359 -0
- package/nvim/plugins/mini.nvim/doc/mini-bracketed.txt +622 -0
- package/nvim/plugins/mini.nvim/doc/mini-bufremove.txt +123 -0
- package/nvim/plugins/mini.nvim/doc/mini-clue.txt +760 -0
- package/nvim/plugins/mini.nvim/doc/mini-cmdline.txt +392 -0
- package/nvim/plugins/mini.nvim/doc/mini-colors.txt +880 -0
- package/nvim/plugins/mini.nvim/doc/mini-comment.txt +230 -0
- package/nvim/plugins/mini.nvim/doc/mini-completion.txt +477 -0
- package/nvim/plugins/mini.nvim/doc/mini-cursorword.txt +105 -0
- package/nvim/plugins/mini.nvim/doc/mini-deps.txt +590 -0
- package/nvim/plugins/mini.nvim/doc/mini-diff.txt +661 -0
- package/nvim/plugins/mini.nvim/doc/mini-doc.txt +434 -0
- package/nvim/plugins/mini.nvim/doc/mini-extra.txt +856 -0
- package/nvim/plugins/mini.nvim/doc/mini-files.txt +1018 -0
- package/nvim/plugins/mini.nvim/doc/mini-fuzzy.txt +160 -0
- package/nvim/plugins/mini.nvim/doc/mini-git.txt +425 -0
- package/nvim/plugins/mini.nvim/doc/mini-hipatterns.txt +489 -0
- package/nvim/plugins/mini.nvim/doc/mini-hues.txt +420 -0
- package/nvim/plugins/mini.nvim/doc/mini-icons.txt +508 -0
- package/nvim/plugins/mini.nvim/doc/mini-indentscope.txt +485 -0
- package/nvim/plugins/mini.nvim/doc/mini-input.txt +932 -0
- package/nvim/plugins/mini.nvim/doc/mini-jump.txt +202 -0
- package/nvim/plugins/mini.nvim/doc/mini-jump2d.txt +525 -0
- package/nvim/plugins/mini.nvim/doc/mini-keymap.txt +449 -0
- package/nvim/plugins/mini.nvim/doc/mini-map.txt +717 -0
- package/nvim/plugins/mini.nvim/doc/mini-misc.txt +431 -0
- package/nvim/plugins/mini.nvim/doc/mini-move.txt +181 -0
- package/nvim/plugins/mini.nvim/doc/mini-notify.txt +434 -0
- package/nvim/plugins/mini.nvim/doc/mini-nvim.txt +431 -0
- package/nvim/plugins/mini.nvim/doc/mini-operators.txt +472 -0
- package/nvim/plugins/mini.nvim/doc/mini-pairs.txt +346 -0
- package/nvim/plugins/mini.nvim/doc/mini-pick.txt +1535 -0
- package/nvim/plugins/mini.nvim/doc/mini-sessions.txt +239 -0
- package/nvim/plugins/mini.nvim/doc/mini-snippets.txt +1291 -0
- package/nvim/plugins/mini.nvim/doc/mini-splitjoin.txt +536 -0
- package/nvim/plugins/mini.nvim/doc/mini-starter.txt +618 -0
- package/nvim/plugins/mini.nvim/doc/mini-statusline.txt +361 -0
- package/nvim/plugins/mini.nvim/doc/mini-surround.txt +863 -0
- package/nvim/plugins/mini.nvim/doc/mini-tabline.txt +151 -0
- package/nvim/plugins/mini.nvim/doc/mini-test.txt +966 -0
- package/nvim/plugins/mini.nvim/doc/mini-trailspace.txt +91 -0
- package/nvim/plugins/mini.nvim/doc/mini-visits.txt +937 -0
- package/nvim/plugins/mini.nvim/logo.png +0 -0
- package/nvim/plugins/mini.nvim/lua/mini/ai.lua +2244 -0
- package/nvim/plugins/mini.nvim/lua/mini/align.lua +2076 -0
- package/nvim/plugins/mini.nvim/lua/mini/animate.lua +2127 -0
- package/nvim/plugins/mini.nvim/lua/mini/base16.lua +1752 -0
- package/nvim/plugins/mini.nvim/lua/mini/basics.lua +772 -0
- package/nvim/plugins/mini.nvim/lua/mini/bracketed.lua +2013 -0
- package/nvim/plugins/mini.nvim/lua/mini/bufremove.lua +283 -0
- package/nvim/plugins/mini.nvim/lua/mini/clue.lua +2096 -0
- package/nvim/plugins/mini.nvim/lua/mini/cmdline.lua +1182 -0
- package/nvim/plugins/mini.nvim/lua/mini/colors.lua +2483 -0
- package/nvim/plugins/mini.nvim/lua/mini/comment.lua +586 -0
- package/nvim/plugins/mini.nvim/lua/mini/completion.lua +2094 -0
- package/nvim/plugins/mini.nvim/lua/mini/cursorword.lua +311 -0
- package/nvim/plugins/mini.nvim/lua/mini/deps.lua +1660 -0
- package/nvim/plugins/mini.nvim/lua/mini/diff.lua +1938 -0
- package/nvim/plugins/mini.nvim/lua/mini/doc.lua +1371 -0
- package/nvim/plugins/mini.nvim/lua/mini/extra.lua +2290 -0
- package/nvim/plugins/mini.nvim/lua/mini/files.lua +3145 -0
- package/nvim/plugins/mini.nvim/lua/mini/fuzzy.lua +356 -0
- package/nvim/plugins/mini.nvim/lua/mini/git.lua +1737 -0
- package/nvim/plugins/mini.nvim/lua/mini/hipatterns.lua +1042 -0
- package/nvim/plugins/mini.nvim/lua/mini/hues.lua +2088 -0
- package/nvim/plugins/mini.nvim/lua/mini/icons.lua +2254 -0
- package/nvim/plugins/mini.nvim/lua/mini/indentscope.lua +1158 -0
- package/nvim/plugins/mini.nvim/lua/mini/init.lua +427 -0
- package/nvim/plugins/mini.nvim/lua/mini/input.lua +2183 -0
- package/nvim/plugins/mini.nvim/lua/mini/jump.lua +609 -0
- package/nvim/plugins/mini.nvim/lua/mini/jump2d.lua +1244 -0
- package/nvim/plugins/mini.nvim/lua/mini/keymap.lua +880 -0
- package/nvim/plugins/mini.nvim/lua/mini/map.lua +1709 -0
- package/nvim/plugins/mini.nvim/lua/mini/misc.lua +969 -0
- package/nvim/plugins/mini.nvim/lua/mini/move.lua +509 -0
- package/nvim/plugins/mini.nvim/lua/mini/notify.lua +938 -0
- package/nvim/plugins/mini.nvim/lua/mini/operators.lua +1349 -0
- package/nvim/plugins/mini.nvim/lua/mini/pairs.lua +657 -0
- package/nvim/plugins/mini.nvim/lua/mini/pick.lua +3876 -0
- package/nvim/plugins/mini.nvim/lua/mini/sessions.lua +689 -0
- package/nvim/plugins/mini.nvim/lua/mini/snippets.lua +2828 -0
- package/nvim/plugins/mini.nvim/lua/mini/splitjoin.lua +1132 -0
- package/nvim/plugins/mini.nvim/lua/mini/starter.lua +1599 -0
- package/nvim/plugins/mini.nvim/lua/mini/statusline.lua +686 -0
- package/nvim/plugins/mini.nvim/lua/mini/surround.lua +2388 -0
- package/nvim/plugins/mini.nvim/lua/mini/tabline.lua +564 -0
- package/nvim/plugins/mini.nvim/lua/mini/test.lua +2516 -0
- package/nvim/plugins/mini.nvim/lua/mini/trailspace.lua +215 -0
- package/nvim/plugins/mini.nvim/lua/mini/visits.lua +1577 -0
- package/nvim/plugins/mini.nvim/readmes/mini-ai.md +190 -0
- package/nvim/plugins/mini.nvim/readmes/mini-align.md +203 -0
- package/nvim/plugins/mini.nvim/readmes/mini-animate.md +214 -0
- package/nvim/plugins/mini.nvim/readmes/mini-base16.md +198 -0
- package/nvim/plugins/mini.nvim/readmes/mini-basics.md +184 -0
- package/nvim/plugins/mini.nvim/readmes/mini-bracketed.md +193 -0
- package/nvim/plugins/mini.nvim/readmes/mini-bufremove.md +139 -0
- package/nvim/plugins/mini.nvim/readmes/mini-clue.md +260 -0
- package/nvim/plugins/mini.nvim/readmes/mini-cmdline.md +183 -0
- package/nvim/plugins/mini.nvim/readmes/mini-colors.md +169 -0
- package/nvim/plugins/mini.nvim/readmes/mini-comment.md +183 -0
- package/nvim/plugins/mini.nvim/readmes/mini-completion.md +217 -0
- package/nvim/plugins/mini.nvim/readmes/mini-cursorword.md +137 -0
- package/nvim/plugins/mini.nvim/readmes/mini-deps.md +271 -0
- package/nvim/plugins/mini.nvim/readmes/mini-diff.md +289 -0
- package/nvim/plugins/mini.nvim/readmes/mini-doc.md +198 -0
- package/nvim/plugins/mini.nvim/readmes/mini-extra.md +158 -0
- package/nvim/plugins/mini.nvim/readmes/mini-files.md +247 -0
- package/nvim/plugins/mini.nvim/readmes/mini-fuzzy.md +134 -0
- package/nvim/plugins/mini.nvim/readmes/mini-git.md +168 -0
- package/nvim/plugins/mini.nvim/readmes/mini-hipatterns.md +176 -0
- package/nvim/plugins/mini.nvim/readmes/mini-hues.md +285 -0
- package/nvim/plugins/mini.nvim/readmes/mini-icons.md +183 -0
- package/nvim/plugins/mini.nvim/readmes/mini-indentscope.md +191 -0
- package/nvim/plugins/mini.nvim/readmes/mini-input.md +163 -0
- package/nvim/plugins/mini.nvim/readmes/mini-jump.md +161 -0
- package/nvim/plugins/mini.nvim/readmes/mini-jump2d.md +197 -0
- package/nvim/plugins/mini.nvim/readmes/mini-keymap.md +205 -0
- package/nvim/plugins/mini.nvim/readmes/mini-map.md +191 -0
- package/nvim/plugins/mini.nvim/readmes/mini-misc.md +145 -0
- package/nvim/plugins/mini.nvim/readmes/mini-move.md +163 -0
- package/nvim/plugins/mini.nvim/readmes/mini-notify.md +175 -0
- package/nvim/plugins/mini.nvim/readmes/mini-operators.md +193 -0
- package/nvim/plugins/mini.nvim/readmes/mini-pairs.md +158 -0
- package/nvim/plugins/mini.nvim/readmes/mini-pick.md +340 -0
- package/nvim/plugins/mini.nvim/readmes/mini-sessions.md +164 -0
- package/nvim/plugins/mini.nvim/readmes/mini-snippets.md +373 -0
- package/nvim/plugins/mini.nvim/readmes/mini-splitjoin.md +194 -0
- package/nvim/plugins/mini.nvim/readmes/mini-starter.md +176 -0
- package/nvim/plugins/mini.nvim/readmes/mini-statusline.md +155 -0
- package/nvim/plugins/mini.nvim/readmes/mini-surround.md +190 -0
- package/nvim/plugins/mini.nvim/readmes/mini-tabline.md +156 -0
- package/nvim/plugins/mini.nvim/readmes/mini-test.md +175 -0
- package/nvim/plugins/mini.nvim/readmes/mini-trailspace.md +137 -0
- package/nvim/plugins/mini.nvim/readmes/mini-visits.md +243 -0
- package/nvim/plugins/mini.nvim/scripts/dual_log.sh +13 -0
- package/nvim/plugins/mini.nvim/scripts/dual_push.sh +15 -0
- package/nvim/plugins/mini.nvim/scripts/dual_release.sh +102 -0
- package/nvim/plugins/mini.nvim/scripts/dual_sync.sh +115 -0
- package/nvim/plugins/mini.nvim/scripts/init-deps-example.lua +59 -0
- package/nvim/plugins/mini.nvim/scripts/lint-filename-length.sh +16 -0
- package/nvim/plugins/mini.nvim/scripts/lintcommit-ci.sh +18 -0
- package/nvim/plugins/mini.nvim/scripts/lintcommit.lua +393 -0
- package/nvim/plugins/mini.nvim/scripts/minidoc.lua +57 -0
- package/nvim/plugins/mini.nvim/scripts/minimal_init.lua +28 -0
- package/nvim/plugins/mini.nvim/scripts/minitest.lua +4 -0
- package/package.json +16 -0
- package/pyproject.toml +43 -0
- package/yazi/init.lua +12 -0
- package/yazi/keymap.toml +114 -0
- package/yazi/lesskey +5 -0
- package/yazi/plugins/bookmarks.yazi/main.lua +86 -0
- package/yazi/plugins/cd-git-root.yazi/main.lua +31 -0
- package/yazi/plugins/smart-enter.yazi/main.lua +11 -0
- package/yazi/theme.toml +26 -0
- package/yazi/yazi.toml +15 -0
- package/zsh/.zshrc +145 -0
- package/zsh/starship.toml +20 -0
- package/zsh/zsh-patina.toml +2 -0
|
@@ -0,0 +1,434 @@
|
|
|
1
|
+
*mini.notify* Show notifications
|
|
2
|
+
|
|
3
|
+
MIT License Copyright (c) 2024 Evgeni Chasnovski
|
|
4
|
+
|
|
5
|
+
------------------------------------------------------------------------------
|
|
6
|
+
*MiniNotify*
|
|
7
|
+
Features:
|
|
8
|
+
|
|
9
|
+
- Show one or more highlighted notifications in a single floating window.
|
|
10
|
+
|
|
11
|
+
- Manage notifications (add, update, remove, clear).
|
|
12
|
+
|
|
13
|
+
- Custom |vim.notify()| implementation. To adjust, use |MiniNotify.make_notify()|
|
|
14
|
+
or save-restore `vim.notify` manually after calling |MiniNotify.setup()|.
|
|
15
|
+
|
|
16
|
+
- Automated show of LSP progress report.
|
|
17
|
+
|
|
18
|
+
- Track history which can be accessed with |MiniNotify.get_all()|
|
|
19
|
+
and shown with |MiniNotify.show_history()|.
|
|
20
|
+
|
|
21
|
+
# Setup ~
|
|
22
|
+
|
|
23
|
+
This module needs a setup with `require('mini.notify').setup({})` (replace
|
|
24
|
+
`{}` with your `config` table). It will create global Lua table `MiniNotify`
|
|
25
|
+
which you can use for scripting or manually (with `:lua MiniNotify.*`).
|
|
26
|
+
|
|
27
|
+
See |MiniNotify.config| for `config` structure and default values.
|
|
28
|
+
|
|
29
|
+
You can override runtime config settings locally to buffer inside
|
|
30
|
+
`vim.b.mininotify_config` which should have same structure as
|
|
31
|
+
`MiniNotify.config`. See |mini.nvim-buffer-local-config| for more details.
|
|
32
|
+
|
|
33
|
+
# Comparisons ~
|
|
34
|
+
|
|
35
|
+
- [j-hui/fidget.nvim](https://github.com/j-hui/fidget.nvim):
|
|
36
|
+
- Basic goals of providing interface for notifications are similar.
|
|
37
|
+
- Has more configuration options and visual effects, while this module
|
|
38
|
+
does not (by design).
|
|
39
|
+
|
|
40
|
+
- [rcarriga/nvim-notify](https://github.com/rcarriga/nvim-notify):
|
|
41
|
+
- Similar to `j-hui/fidget.nvim`.
|
|
42
|
+
|
|
43
|
+
# Highlight groups ~
|
|
44
|
+
*MiniNotify-hl-groups*
|
|
45
|
+
|
|
46
|
+
- `MiniNotifyBorder` - window border.
|
|
47
|
+
- `MiniNotifyLspProgress` - notifications from built-in LSP progress report.
|
|
48
|
+
- `MiniNotifyNormal` - basic foreground/background highlighting.
|
|
49
|
+
- `MiniNotifyTitle` - window title.
|
|
50
|
+
|
|
51
|
+
To change any highlight group, set it directly with |nvim_set_hl()|.
|
|
52
|
+
|
|
53
|
+
NOTE: |vim.notify()| override after |MiniNotify.make_notify()| uses own
|
|
54
|
+
highlight groups per notification level.
|
|
55
|
+
|
|
56
|
+
# Disabling ~
|
|
57
|
+
|
|
58
|
+
To disable showing notifications, set `vim.g.mininotify_disable` (globally) or
|
|
59
|
+
`vim.b.mininotify_disable` (for a buffer) to `true`. Considering high number
|
|
60
|
+
of different scenarios and customization intentions, writing exact rules
|
|
61
|
+
for disabling module's functionality is left to user. See
|
|
62
|
+
|mini.nvim-disabling-recipes| for common recipes.
|
|
63
|
+
|
|
64
|
+
------------------------------------------------------------------------------
|
|
65
|
+
*MiniNotify-specification*
|
|
66
|
+
# Notification specification ~
|
|
67
|
+
|
|
68
|
+
Notification is a table with the following keys:
|
|
69
|
+
|
|
70
|
+
- <msg> `(string)` - single string with notification message.
|
|
71
|
+
Use `\n` to delimit several lines.
|
|
72
|
+
- <level> `(string)` - notification level as key of |vim.log.levels|.
|
|
73
|
+
Like "ERROR", "WARN", "INFO", etc.
|
|
74
|
+
- <hl_group> `(string)` - highlight group with which notification is shown.
|
|
75
|
+
- <data> `(table)` - extra data to store in notification (like `source`, etc.).
|
|
76
|
+
- <ts_add> `(number)` - timestamp of when notification is added.
|
|
77
|
+
- <ts_update> `(number)` - timestamp of the latest notification update.
|
|
78
|
+
- <ts_remove> `(number|nil)` - timestamp of when notification is removed.
|
|
79
|
+
It is `nil` if notification was never removed and thus considered "active".
|
|
80
|
+
|
|
81
|
+
Notes:
|
|
82
|
+
- Timestamps are compatible with |strftime()| and have fractional part.
|
|
83
|
+
|
|
84
|
+
------------------------------------------------------------------------------
|
|
85
|
+
*MiniNotify.setup()*
|
|
86
|
+
`MiniNotify.setup`({config})
|
|
87
|
+
Module setup
|
|
88
|
+
|
|
89
|
+
This will also:
|
|
90
|
+
- Set |vim.notify()| custom implementation (see |MiniNotify.make_notify()|).
|
|
91
|
+
- Clean the history. Use `MiniNotify.setup(MiniNotify.config)` to force
|
|
92
|
+
clean history while preserving the config.
|
|
93
|
+
|
|
94
|
+
Parameters ~
|
|
95
|
+
{config} `(table|nil)` Module config table. See |MiniNotify.config|.
|
|
96
|
+
|
|
97
|
+
Usage ~
|
|
98
|
+
>lua
|
|
99
|
+
require('mini.notify').setup() -- use default config
|
|
100
|
+
-- OR
|
|
101
|
+
require('mini.notify').setup({}) -- replace {} with your config table
|
|
102
|
+
<
|
|
103
|
+
------------------------------------------------------------------------------
|
|
104
|
+
*MiniNotify.config*
|
|
105
|
+
`MiniNotify.config`
|
|
106
|
+
Defaults ~
|
|
107
|
+
>lua
|
|
108
|
+
MiniNotify.config = {
|
|
109
|
+
-- Content management
|
|
110
|
+
content = {
|
|
111
|
+
-- Function which formats the notification message
|
|
112
|
+
-- By default prepends message with notification time
|
|
113
|
+
format = nil,
|
|
114
|
+
|
|
115
|
+
-- Function which orders notification array from most to least important
|
|
116
|
+
-- By default orders first by level and then by update timestamp
|
|
117
|
+
sort = nil,
|
|
118
|
+
},
|
|
119
|
+
|
|
120
|
+
-- Notifications about LSP progress
|
|
121
|
+
lsp_progress = {
|
|
122
|
+
-- Whether to enable showing
|
|
123
|
+
enable = true,
|
|
124
|
+
|
|
125
|
+
-- Notification level
|
|
126
|
+
level = 'INFO',
|
|
127
|
+
|
|
128
|
+
-- Duration (in ms) of how long last message should be shown
|
|
129
|
+
duration_last = 1000,
|
|
130
|
+
},
|
|
131
|
+
|
|
132
|
+
-- Window options
|
|
133
|
+
window = {
|
|
134
|
+
-- Floating window config
|
|
135
|
+
config = {},
|
|
136
|
+
|
|
137
|
+
-- Maximum window width as share (between 0 and 1) of available columns
|
|
138
|
+
max_width_share = 0.382,
|
|
139
|
+
|
|
140
|
+
-- Value of 'winblend' option
|
|
141
|
+
winblend = 25,
|
|
142
|
+
},
|
|
143
|
+
}
|
|
144
|
+
<
|
|
145
|
+
# Content ~
|
|
146
|
+
|
|
147
|
+
`config.content` defines how notifications are shown.
|
|
148
|
+
|
|
149
|
+
`content.format` is a function which takes single notification object
|
|
150
|
+
(see |MiniNotify-specification|) and returns a string to be used directly
|
|
151
|
+
when showing notification.
|
|
152
|
+
Default: `nil` for |MiniNotify.default_format()|.
|
|
153
|
+
|
|
154
|
+
`content.sort` is a function which takes array of notification objects
|
|
155
|
+
(see |MiniNotify-specification|) and returns an array of such objects.
|
|
156
|
+
It can be used to define custom order and/or filter for notifications which
|
|
157
|
+
are shown simultaneously.
|
|
158
|
+
Note: Input contains notifications before applying `content.format`.
|
|
159
|
+
Default: `nil` for |MiniNotify.default_sort()|.
|
|
160
|
+
|
|
161
|
+
Example: >lua
|
|
162
|
+
|
|
163
|
+
require('mini.notify').setup({
|
|
164
|
+
content = {
|
|
165
|
+
-- Use notification message as is for LSP progress
|
|
166
|
+
format = function(notif)
|
|
167
|
+
if notif.data.source == 'lsp_progress' then return notif.msg end
|
|
168
|
+
return MiniNotify.default_format(notif)
|
|
169
|
+
end,
|
|
170
|
+
|
|
171
|
+
-- Show more recent notifications first
|
|
172
|
+
sort = function(notif_arr)
|
|
173
|
+
table.sort(
|
|
174
|
+
notif_arr,
|
|
175
|
+
function(a, b) return a.ts_update > b.ts_update end
|
|
176
|
+
)
|
|
177
|
+
return notif_arr
|
|
178
|
+
end,
|
|
179
|
+
},
|
|
180
|
+
})
|
|
181
|
+
<
|
|
182
|
+
# LSP progress ~
|
|
183
|
+
|
|
184
|
+
`config.lsp_progress` defines automated notifications for LSP progress.
|
|
185
|
+
It is implemented as a single updating notification per progress with all
|
|
186
|
+
information about it.
|
|
187
|
+
Setting up is done inside |MiniNotify.setup()| via scheduled (|vim.schedule()|)
|
|
188
|
+
setting of |lsp-handler| for "$/progress" method.
|
|
189
|
+
|
|
190
|
+
`lsp_progress.enable` is a boolean indicating whether LSP progress should
|
|
191
|
+
be shown in notifications. Can be disabled in current session.
|
|
192
|
+
Default: `true`. Note: Should be `true` during |MiniNotify.setup()| call to be able
|
|
193
|
+
to enable it in current session.
|
|
194
|
+
|
|
195
|
+
`lsp_progress.level` is a level to be used in |MiniNotify.add()|.
|
|
196
|
+
Default: `'INFO'`.
|
|
197
|
+
|
|
198
|
+
`lsp_progress.duration_last` is a number of milliseconds for the last progress
|
|
199
|
+
report to be shown on screen before removing it.
|
|
200
|
+
Default: 1000.
|
|
201
|
+
|
|
202
|
+
Notes:
|
|
203
|
+
- This respects previously set handler by saving and calling it.
|
|
204
|
+
- Overriding "$/progress" method of `vim.lsp.handlers` disables notifications.
|
|
205
|
+
- All LSP progress notifications set the following fields in `data`:
|
|
206
|
+
- <source> is `"lsp_progress"`.
|
|
207
|
+
- <client_name> is set to client's name (provided by client or inferred).
|
|
208
|
+
- <context> is the latest LSP request context (`ctx` arg of |lsp-handler|).
|
|
209
|
+
- <response> is the latest LSP response (`result` arg of |lsp-handler|).
|
|
210
|
+
|
|
211
|
+
# Window ~
|
|
212
|
+
|
|
213
|
+
`config.window` defines behavior of notification window.
|
|
214
|
+
|
|
215
|
+
`window.config` is a table defining floating window characteristics
|
|
216
|
+
or a callable returning such table (will be called with identifier of
|
|
217
|
+
window's buffer already showing notifications). It should have the same
|
|
218
|
+
structure as in |nvim_open_win()|. It has the following default values
|
|
219
|
+
which show notifications in the upper right corner with upper limit on width:
|
|
220
|
+
- `width` is chosen to fit buffer content but at most `window.max_width_share`
|
|
221
|
+
share of |'columns'|.
|
|
222
|
+
To have higher maximum width, use function in `config.window` which computes
|
|
223
|
+
dimensions inside of it (based on buffer content).
|
|
224
|
+
- `height` is chosen to fit buffer content with enabled |'wrap'| (assuming
|
|
225
|
+
default value of `width`).
|
|
226
|
+
- `anchor`, `col`, and `row` are "NE", |'columns'|, and 0 or 1 (depending on tabline).
|
|
227
|
+
- `border` is "single".
|
|
228
|
+
- `zindex` is 999 to be as much on top as reasonably possible.
|
|
229
|
+
|
|
230
|
+
`window.max_width_share` defines maximum window width as a share of |'columns'|.
|
|
231
|
+
Should be a number between 0 (not included) and 1.
|
|
232
|
+
Default: 0.382.
|
|
233
|
+
|
|
234
|
+
Example for showing notifications in bottom right corner: >lua
|
|
235
|
+
|
|
236
|
+
local win_config = function()
|
|
237
|
+
local has_statusline = vim.o.laststatus > 0
|
|
238
|
+
local pad = vim.o.cmdheight + (has_statusline and 1 or 0)
|
|
239
|
+
return { anchor = 'SE', col = vim.o.columns, row = vim.o.lines - pad }
|
|
240
|
+
end
|
|
241
|
+
require('mini.notify').setup({ window = { config = win_config } })
|
|
242
|
+
<
|
|
243
|
+
`window.winblend` defines |'winblend'| value for notification window.
|
|
244
|
+
Default: 25.
|
|
245
|
+
|
|
246
|
+
------------------------------------------------------------------------------
|
|
247
|
+
*MiniNotify.make_notify()*
|
|
248
|
+
`MiniNotify.make_notify`({opts})
|
|
249
|
+
Make vim.notify wrapper
|
|
250
|
+
|
|
251
|
+
Calling this function creates an implementation of |vim.notify()| powered by
|
|
252
|
+
this module. General idea is to show notification as soon as safely possible
|
|
253
|
+
(see |vim.schedule_wrap()|) and remove it after a configurable amount of time.
|
|
254
|
+
|
|
255
|
+
All notifications set `source = "vim.notify"` in their `data` field.
|
|
256
|
+
|
|
257
|
+
This is used with default options inside |MiniNotify.setup()|. To adjust,
|
|
258
|
+
call manually after `setup()`. For example, to show errors longer: >lua
|
|
259
|
+
|
|
260
|
+
require('mini.notify').setup()
|
|
261
|
+
vim.notify = MiniNotify.make_notify({ ERROR = { duration = 10000 } })
|
|
262
|
+
<
|
|
263
|
+
To preserve original `vim.notify`: >lua
|
|
264
|
+
|
|
265
|
+
local notify_orig = vim.notify
|
|
266
|
+
require('mini.notify').setup()
|
|
267
|
+
vim.notify = notify_orig
|
|
268
|
+
<
|
|
269
|
+
Parameters ~
|
|
270
|
+
{opts} `(table|nil)` Options to configure behavior of notification `level`
|
|
271
|
+
(as in |MiniNotify.add()|). Fields are the same as names of `vim.log.levels`
|
|
272
|
+
with values being tables with possible fields:
|
|
273
|
+
- <duration> `(number)` - duration (in ms) of how much a notification
|
|
274
|
+
should be shown. If 0 or negative, notification is not shown at all.
|
|
275
|
+
- <hl_group> `(string)` - highlight group of notification.
|
|
276
|
+
Only data different to default can be supplied.
|
|
277
|
+
|
|
278
|
+
Default: >lua
|
|
279
|
+
|
|
280
|
+
{
|
|
281
|
+
ERROR = { duration = 5000, hl_group = 'DiagnosticError' },
|
|
282
|
+
WARN = { duration = 5000, hl_group = 'DiagnosticWarn' },
|
|
283
|
+
INFO = { duration = 5000, hl_group = 'DiagnosticInfo' },
|
|
284
|
+
DEBUG = { duration = 0, hl_group = 'DiagnosticHint' },
|
|
285
|
+
TRACE = { duration = 0, hl_group = 'DiagnosticOk' },
|
|
286
|
+
OFF = { duration = 0, hl_group = 'MiniNotifyNormal' },
|
|
287
|
+
}
|
|
288
|
+
<
|
|
289
|
+
------------------------------------------------------------------------------
|
|
290
|
+
*MiniNotify.add()*
|
|
291
|
+
`MiniNotify.add`({msg}, {level}, {hl_group}, {data})
|
|
292
|
+
Add notification
|
|
293
|
+
|
|
294
|
+
Add notification to history. It is considered "active" and is shown.
|
|
295
|
+
To hide, call |MiniNotify.remove()| with identifier this function returns.
|
|
296
|
+
|
|
297
|
+
Example: >lua
|
|
298
|
+
|
|
299
|
+
local id = MiniNotify.add('Hello', 'WARN', 'Comment')
|
|
300
|
+
vim.defer_fn(function() MiniNotify.remove(id) end, 1000)
|
|
301
|
+
<
|
|
302
|
+
Parameters ~
|
|
303
|
+
{msg} `(string)` Notification message.
|
|
304
|
+
{level} `(string|nil)` Notification level as key of |vim.log.levels|.
|
|
305
|
+
Default: `'INFO'`.
|
|
306
|
+
{hl_group} `(string|nil)` Notification highlight group.
|
|
307
|
+
Default: `'MiniNotifyNormal'`.
|
|
308
|
+
{data} `(table|nil)` Extra data to store in the notification.
|
|
309
|
+
Default: `{}`.
|
|
310
|
+
|
|
311
|
+
Return ~
|
|
312
|
+
`(number)` Notification identifier.
|
|
313
|
+
|
|
314
|
+
------------------------------------------------------------------------------
|
|
315
|
+
*MiniNotify.update()*
|
|
316
|
+
`MiniNotify.update`({id}, {new})
|
|
317
|
+
Update active notification
|
|
318
|
+
|
|
319
|
+
Modify contents of active notification.
|
|
320
|
+
|
|
321
|
+
Parameters ~
|
|
322
|
+
{id} `(number)` Identifier of currently active notification as returned
|
|
323
|
+
by |MiniNotify.add()|.
|
|
324
|
+
{new} `(table)` Table with contents to update. Keys should be as non-timestamp
|
|
325
|
+
fields of |MiniNotify-specification| and values - new content values.
|
|
326
|
+
If present, field `data` is updated as is. Use |MiniNotify.get()| together
|
|
327
|
+
with |vim.tbl_deep_extend()| to change only part of it.
|
|
328
|
+
|
|
329
|
+
------------------------------------------------------------------------------
|
|
330
|
+
*MiniNotify.remove()*
|
|
331
|
+
`MiniNotify.remove`({id})
|
|
332
|
+
Remove notification
|
|
333
|
+
|
|
334
|
+
If notification is active, make it not active (by setting `ts_remove` field).
|
|
335
|
+
If not active, do nothing.
|
|
336
|
+
|
|
337
|
+
Parameters ~
|
|
338
|
+
{id} `(number|nil)` Identifier of previously added notification.
|
|
339
|
+
If it is not, nothing is done (silently).
|
|
340
|
+
|
|
341
|
+
------------------------------------------------------------------------------
|
|
342
|
+
*MiniNotify.clear()*
|
|
343
|
+
`MiniNotify.clear`()
|
|
344
|
+
Remove all active notifications
|
|
345
|
+
|
|
346
|
+
Hide all active notifications and stop showing window (if shown).
|
|
347
|
+
|
|
348
|
+
------------------------------------------------------------------------------
|
|
349
|
+
*MiniNotify.refresh()*
|
|
350
|
+
`MiniNotify.refresh`()
|
|
351
|
+
Refresh notification window
|
|
352
|
+
|
|
353
|
+
Make notification window show relevant information:
|
|
354
|
+
- Create an array of active notifications (see |MiniNotify-specification|).
|
|
355
|
+
- Apply `config.content.sort` to an array. If output has zero notifications,
|
|
356
|
+
make notification window to not show.
|
|
357
|
+
- Apply `config.content.format` to each element of notification array and
|
|
358
|
+
update its message.
|
|
359
|
+
- Construct content from notifications and show them in a window.
|
|
360
|
+
|
|
361
|
+
Note: effects are delayed if inside fast event (|vim.in_fast_event()|).
|
|
362
|
+
|
|
363
|
+
------------------------------------------------------------------------------
|
|
364
|
+
*MiniNotify.get()*
|
|
365
|
+
`MiniNotify.get`({id})
|
|
366
|
+
Get previously added notification by id
|
|
367
|
+
|
|
368
|
+
Parameters ~
|
|
369
|
+
{id} `(number)` Identifier of notification.
|
|
370
|
+
|
|
371
|
+
Return ~
|
|
372
|
+
`(table)` Notification object (see |MiniNotify-specification|).
|
|
373
|
+
|
|
374
|
+
------------------------------------------------------------------------------
|
|
375
|
+
*MiniNotify.get_all()*
|
|
376
|
+
`MiniNotify.get_all`()
|
|
377
|
+
Get all previously added notifications
|
|
378
|
+
|
|
379
|
+
Get map of used notifications with keys being notification identifiers.
|
|
380
|
+
|
|
381
|
+
Can be used to get only active notification objects. Example: >lua
|
|
382
|
+
|
|
383
|
+
-- Get active notifications
|
|
384
|
+
vim.tbl_filter(
|
|
385
|
+
function(notif) return notif.ts_remove == nil end,
|
|
386
|
+
MiniNotify.get_all()
|
|
387
|
+
)
|
|
388
|
+
<
|
|
389
|
+
Return ~
|
|
390
|
+
`(table)` Map with notification object values (see |MiniNotify-specification|).
|
|
391
|
+
Note: messages are taken from last valid update.
|
|
392
|
+
|
|
393
|
+
------------------------------------------------------------------------------
|
|
394
|
+
*MiniNotify.show_history()*
|
|
395
|
+
`MiniNotify.show_history`()
|
|
396
|
+
Show history
|
|
397
|
+
|
|
398
|
+
Open or reuse a scratch buffer with all previously shown notifications.
|
|
399
|
+
|
|
400
|
+
Notes:
|
|
401
|
+
- Content is ordered from oldest to newest based on latest update time.
|
|
402
|
+
- Message is formatted with `config.content.format`.
|
|
403
|
+
|
|
404
|
+
------------------------------------------------------------------------------
|
|
405
|
+
*MiniNotify.default_format()*
|
|
406
|
+
`MiniNotify.default_format`({notif})
|
|
407
|
+
Default content format
|
|
408
|
+
|
|
409
|
+
Used by default as `config.content.format`. Prepends notification message
|
|
410
|
+
with the human readable update time and a separator.
|
|
411
|
+
|
|
412
|
+
Parameters ~
|
|
413
|
+
{notif} `(table)` Notification object (see |MiniNotify-specification|).
|
|
414
|
+
|
|
415
|
+
Return ~
|
|
416
|
+
`(string)` Formatted notification message.
|
|
417
|
+
|
|
418
|
+
------------------------------------------------------------------------------
|
|
419
|
+
*MiniNotify.default_sort()*
|
|
420
|
+
`MiniNotify.default_sort`({notif_arr})
|
|
421
|
+
Default content sort
|
|
422
|
+
|
|
423
|
+
Used by default as `config.content.sort`. First sorts by notification's `level`
|
|
424
|
+
("ERROR" > "WARN" > "INFO" > "DEBUG" > "TRACE" > "OFF"; the bigger the more
|
|
425
|
+
important); if draw - by latest update time (the later the more important).
|
|
426
|
+
|
|
427
|
+
Parameters ~
|
|
428
|
+
{notif_arr} `(table)` Array of notifications (see |MiniNotify-specification|).
|
|
429
|
+
|
|
430
|
+
Return ~
|
|
431
|
+
`(table)` Sorted array of notifications.
|
|
432
|
+
|
|
433
|
+
|
|
434
|
+
vim:tw=78:ts=8:noet:ft=help:norl:
|