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,485 @@
|
|
|
1
|
+
*mini.indentscope* Visualize and work with indent scope
|
|
2
|
+
|
|
3
|
+
MIT License Copyright (c) 2022 Evgeni Chasnovski
|
|
4
|
+
|
|
5
|
+
------------------------------------------------------------------------------
|
|
6
|
+
*MiniIndentscope*
|
|
7
|
+
Indent scope (or just "scope") is a maximum set of consecutive lines which
|
|
8
|
+
contains certain reference line (cursor line by default) and every member
|
|
9
|
+
has indent not less than certain reference indent ("indent at cursor" by
|
|
10
|
+
default: minimum between cursor column and indent of cursor line).
|
|
11
|
+
|
|
12
|
+
Features:
|
|
13
|
+
- Visualize scope with animated vertical line. It is very fast and done
|
|
14
|
+
automatically in a non-blocking way (other operations can be performed,
|
|
15
|
+
like moving cursor). You can customize debounce delay and animation rule.
|
|
16
|
+
|
|
17
|
+
- Customization of scope computation options can be done on global level
|
|
18
|
+
(in |MiniIndentscope.config|), for a certain buffer (using
|
|
19
|
+
`vim.b.miniindentscope_config` buffer variable), or within a call (using
|
|
20
|
+
`opts` variable in |MiniIndentscope.get_scope()|).
|
|
21
|
+
|
|
22
|
+
- Customizable notion of a border: which adjacent lines with strictly lower
|
|
23
|
+
indent are recognized as such. This is useful for a certain filetypes
|
|
24
|
+
(for example, Python or plain text).
|
|
25
|
+
|
|
26
|
+
- Customizable way of line to be considered "border first". This is useful
|
|
27
|
+
if you want to place cursor on function header and get scope of its body.
|
|
28
|
+
|
|
29
|
+
- There are textobjects and motions to operate on scope. Support |count|
|
|
30
|
+
and dot-repeat (in operator pending mode).
|
|
31
|
+
|
|
32
|
+
# Setup ~
|
|
33
|
+
|
|
34
|
+
This module needs a setup with `require('mini.indentscope').setup({})`
|
|
35
|
+
(replace `{}` with your `config` table). It will create global Lua table
|
|
36
|
+
`MiniIndentscope` which you can use for scripting or manually (with
|
|
37
|
+
`:lua MiniIndentscope.*`).
|
|
38
|
+
|
|
39
|
+
See |MiniIndentscope.config| for available config settings.
|
|
40
|
+
|
|
41
|
+
You can override runtime config settings locally to buffer inside
|
|
42
|
+
`vim.b.miniindentscope_config` which should have same structure as
|
|
43
|
+
`MiniIndentscope.config`. See |mini.nvim-buffer-local-config| for more
|
|
44
|
+
details.
|
|
45
|
+
|
|
46
|
+
# Comparisons ~
|
|
47
|
+
|
|
48
|
+
- [lukas-reineke/indent-blankline.nvim](https://github.com/lukas-reineke/indent-blankline.nvim):
|
|
49
|
+
- Its main functionality is about showing static guides of indent levels.
|
|
50
|
+
- Implementation of |mini.indentscope| is similar to
|
|
51
|
+
`indent-blankline.nvim` (using |extmarks| on first column to be shown
|
|
52
|
+
even on blank lines). They can be used simultaneously, but it will
|
|
53
|
+
lead to one of the visualizations being on top (hiding) of another.
|
|
54
|
+
|
|
55
|
+
# Highlight groups ~
|
|
56
|
+
*MiniIndentscope-hl-groups*
|
|
57
|
+
|
|
58
|
+
- `MiniIndentscopeSymbol` - symbol showing on every line of scope if its
|
|
59
|
+
indent is multiple of |'shiftwidth'|.
|
|
60
|
+
- `MiniIndentscopeSymbolOff` - symbol showing on every line of scope if its
|
|
61
|
+
indent is not multiple of |'shiftwidth'|.
|
|
62
|
+
Default: links to `MiniIndentscopeSymbol`.
|
|
63
|
+
|
|
64
|
+
To change any highlight group, set it directly with |nvim_set_hl()|.
|
|
65
|
+
|
|
66
|
+
# Disabling ~
|
|
67
|
+
|
|
68
|
+
To disable autodrawing, set `vim.g.miniindentscope_disable` (globally) or
|
|
69
|
+
`vim.b.miniindentscope_disable` (for a buffer) to `true`. Considering high
|
|
70
|
+
number of different scenarios and customization intentions, writing exact
|
|
71
|
+
rules for disabling module's functionality is left to user. See
|
|
72
|
+
|mini.nvim-disabling-recipes| for common recipes.
|
|
73
|
+
|
|
74
|
+
------------------------------------------------------------------------------
|
|
75
|
+
*MiniIndentscope-drawing*
|
|
76
|
+
Draw of scope indicator is done as iterative animation. It has the
|
|
77
|
+
following design:
|
|
78
|
+
- Draw indicator on origin line (where cursor is at) immediately. Indicator
|
|
79
|
+
is visualized as `MiniIndentscope.config.symbol` placed to the right of
|
|
80
|
+
scope's border indent. This creates a line from top to bottom scope edges.
|
|
81
|
+
- Draw upward and downward concurrently per one line. Progression by one
|
|
82
|
+
line in both direction is considered to be one step of animation.
|
|
83
|
+
- Before each step wait certain amount of time, which is decided by
|
|
84
|
+
"animation function". It takes next and total step numbers (both are one
|
|
85
|
+
or bigger) and returns number of milliseconds to wait before drawing next
|
|
86
|
+
step. Comparing to a more popular "easing functions" in animation (input:
|
|
87
|
+
duration since animation start; output: percent of animation done), it is
|
|
88
|
+
a discrete inverse version of its derivative. Such interface proved to be
|
|
89
|
+
more appropriate for kind of task at hand.
|
|
90
|
+
|
|
91
|
+
# Special cases ~
|
|
92
|
+
|
|
93
|
+
- When scope to be drawn intersects (same indent, ranges overlap) currently
|
|
94
|
+
visible one (at process or finished drawing), drawing is done immediately
|
|
95
|
+
without animation. With most common example being typing new text, this
|
|
96
|
+
feels more natural.
|
|
97
|
+
- Scope for the whole buffer is not drawn as it is isually redundant.
|
|
98
|
+
Technically, it can be thought as drawn at column 0 (because border
|
|
99
|
+
indent is -1) which is not visible.
|
|
100
|
+
|
|
101
|
+
------------------------------------------------------------------------------
|
|
102
|
+
*MiniIndentscope.setup()*
|
|
103
|
+
`MiniIndentscope.setup`({config})
|
|
104
|
+
Module setup
|
|
105
|
+
|
|
106
|
+
Parameters ~
|
|
107
|
+
{config} `(table|nil)` Module config table. See |MiniIndentscope.config|.
|
|
108
|
+
|
|
109
|
+
Usage ~
|
|
110
|
+
>lua
|
|
111
|
+
require('mini.indentscope').setup() -- use default config
|
|
112
|
+
-- OR
|
|
113
|
+
require('mini.indentscope').setup({}) -- replace {} with your config table
|
|
114
|
+
<
|
|
115
|
+
------------------------------------------------------------------------------
|
|
116
|
+
*MiniIndentscope.config*
|
|
117
|
+
`MiniIndentscope.config`
|
|
118
|
+
Defaults ~
|
|
119
|
+
>lua
|
|
120
|
+
MiniIndentscope.config = {
|
|
121
|
+
-- Draw options
|
|
122
|
+
draw = {
|
|
123
|
+
-- Delay (in ms) between event and start of drawing scope indicator
|
|
124
|
+
delay = 100,
|
|
125
|
+
|
|
126
|
+
-- Animation rule for scope's first drawing. A function which, given
|
|
127
|
+
-- next and total step numbers, returns wait time (in ms). See
|
|
128
|
+
-- |MiniIndentscope.gen_animation| for builtin options. To disable
|
|
129
|
+
-- animation, use `require('mini.indentscope').gen_animation.none()`.
|
|
130
|
+
animation = --<function: implements constant 20ms between steps>,
|
|
131
|
+
|
|
132
|
+
-- Whether to auto draw scope: return `true` to draw, `false` otherwise.
|
|
133
|
+
-- Default draws only fully computed scope (see `options.n_lines`).
|
|
134
|
+
predicate = function(scope) return not scope.body.is_incomplete end,
|
|
135
|
+
|
|
136
|
+
-- Symbol priority. Increase to display on top of more symbols.
|
|
137
|
+
priority = 2,
|
|
138
|
+
},
|
|
139
|
+
|
|
140
|
+
-- Module mappings. Use `''` (empty string) to disable one.
|
|
141
|
+
mappings = {
|
|
142
|
+
-- Textobjects
|
|
143
|
+
object_scope = 'ii',
|
|
144
|
+
object_scope_with_border = 'ai',
|
|
145
|
+
|
|
146
|
+
-- Motions (jump to respective border line; if not present - body line)
|
|
147
|
+
goto_top = '[i',
|
|
148
|
+
goto_bottom = ']i',
|
|
149
|
+
},
|
|
150
|
+
|
|
151
|
+
-- Options which control scope computation
|
|
152
|
+
options = {
|
|
153
|
+
-- Type of scope's border: which line(s) with smaller indent to
|
|
154
|
+
-- categorize as border. Can be one of: 'both', 'top', 'bottom', 'none'.
|
|
155
|
+
border = 'both',
|
|
156
|
+
|
|
157
|
+
-- Whether to use cursor column when computing reference indent.
|
|
158
|
+
-- Useful to see incremental scopes with horizontal cursor movements.
|
|
159
|
+
indent_at_cursor = true,
|
|
160
|
+
|
|
161
|
+
-- Maximum number of lines above or below within which scope is computed
|
|
162
|
+
n_lines = 10000,
|
|
163
|
+
|
|
164
|
+
-- Whether to first check input line to be a border of adjacent scope.
|
|
165
|
+
-- Use it if you want to place cursor on function header to get scope of
|
|
166
|
+
-- its body.
|
|
167
|
+
try_as_border = false,
|
|
168
|
+
},
|
|
169
|
+
|
|
170
|
+
-- Which character to use for drawing scope indicator
|
|
171
|
+
symbol = '╎',
|
|
172
|
+
}
|
|
173
|
+
<
|
|
174
|
+
# Options ~
|
|
175
|
+
|
|
176
|
+
## Border ~
|
|
177
|
+
|
|
178
|
+
Field `border` controls which line(s) with smaller indent to categorize
|
|
179
|
+
as border. This matters for textobjects and motions.
|
|
180
|
+
It also controls how empty lines are treated: they are included in scope
|
|
181
|
+
only if followed by a border. Another way of looking at it is that indent
|
|
182
|
+
of blank line is computed based on value of `border` option.
|
|
183
|
+
Here is an illustration of how `border` works in presence of empty lines: >
|
|
184
|
+
|
|
185
|
+
|both|bottom|top|none|
|
|
186
|
+
1|function foo() | 0 | 0 | 0 | 0 |
|
|
187
|
+
2| | 4 | 0 | 4 | 0 |
|
|
188
|
+
3| print('Hello world') | 4 | 4 | 4 | 4 |
|
|
189
|
+
4| | 4 | 4 | 2 | 2 |
|
|
190
|
+
5| end | 2 | 2 | 2 | 2 |
|
|
191
|
+
<
|
|
192
|
+
Numbers inside a table are indent values of a line computed with certain
|
|
193
|
+
value of `border`. So, for example, a scope with reference line 3 and
|
|
194
|
+
right-most column has body range depending on value of `border` option:
|
|
195
|
+
- `border` is "both": range is 2-4, border is 1 and 5 with indent 2.
|
|
196
|
+
- `border` is "top": range is 2-3, border is 1 with indent 0.
|
|
197
|
+
- `border` is "bottom": range is 3-4, border is 5 with indent 0.
|
|
198
|
+
- `border` is "none": range is 3-3, border is empty with indent `nil`.
|
|
199
|
+
|
|
200
|
+
## Indent at cursor ~
|
|
201
|
+
|
|
202
|
+
Field `indent_at_cursor` controls if cursor position should affect computation
|
|
203
|
+
of scope. If `true`, reference indent is a minimum of reference line's indent
|
|
204
|
+
and cursor column. In main example, here how scope's body range differs
|
|
205
|
+
depending on cursor column and `indent_at_cursor` value (assuming cursor is
|
|
206
|
+
on line 3 and it is whole buffer): >
|
|
207
|
+
|
|
208
|
+
Column\Option true|false
|
|
209
|
+
1 and 2 2-5 | 2-4
|
|
210
|
+
3 and more 2-4 | 2-4
|
|
211
|
+
<
|
|
212
|
+
## Number of lines ~
|
|
213
|
+
|
|
214
|
+
Field `n_lines` defines |MiniIndentscope.get_scope()| behavior for how many
|
|
215
|
+
lines above/below to check before iteration is stopped. Scope that reached
|
|
216
|
+
computation limit has <is_incomplete> field set to `true`. It will also not
|
|
217
|
+
be auto drawn with default `config.draw.predicate`.
|
|
218
|
+
|
|
219
|
+
Lower values will result in better overall performance in exchange for more
|
|
220
|
+
frequent incomplete scope computation. Set to `math.huge` for no restriction.
|
|
221
|
+
|
|
222
|
+
## Try as border ~
|
|
223
|
+
|
|
224
|
+
Field `try_as_border` controls how to act when input line can be recognized
|
|
225
|
+
as a border of some neighbor indent scope. In main example, when input line
|
|
226
|
+
is 1 and can be recognized as border for inner scope, value `try_as_border=true`
|
|
227
|
+
means that inner scope will be returned. Similar, for input line 5 inner scope
|
|
228
|
+
will be returned if it is recognized as border.
|
|
229
|
+
|
|
230
|
+
------------------------------------------------------------------------------
|
|
231
|
+
*MiniIndentscope.get_scope()*
|
|
232
|
+
`MiniIndentscope.get_scope`({line}, {col}, {opts})
|
|
233
|
+
Compute indent scope
|
|
234
|
+
|
|
235
|
+
Indent scope (or just "scope") is a maximum set of consecutive lines which
|
|
236
|
+
contains certain reference line (cursor line by default) and every member
|
|
237
|
+
has indent not less than certain reference indent ("indent at column" by
|
|
238
|
+
default). Here "indent at column" means minimum between input column value
|
|
239
|
+
and indent of reference line. When using cursor column, this allows for a
|
|
240
|
+
useful interactive view of nested indent scopes by making horizontal
|
|
241
|
+
movements within line.
|
|
242
|
+
|
|
243
|
+
Options controlling actual computation is taken from these places in order:
|
|
244
|
+
- Argument `opts`. Use it to ensure independence from other sources.
|
|
245
|
+
- Buffer local variable `vim.b.miniindentscope_config` (`options` field).
|
|
246
|
+
Useful to define local behavior (for example, for a certain filetype).
|
|
247
|
+
- Global options from |MiniIndentscope.config|.
|
|
248
|
+
|
|
249
|
+
# Algorithm overview ~
|
|
250
|
+
|
|
251
|
+
- Compute reference "indent at column". Reference line is an input `line`
|
|
252
|
+
which might be modified to one of its neighbors if `try_as_border` option
|
|
253
|
+
is `true`: if it can be viewed as border of some neighbor scope, it will.
|
|
254
|
+
- Process upwards and downwards from reference line searching for line with
|
|
255
|
+
indent strictly less than reference one. This is like casting rays up and
|
|
256
|
+
down from reference line and reference indent until meeting "a wall"
|
|
257
|
+
(character to the right of indent or buffer edge). Latest line before
|
|
258
|
+
meeting a wall is a respective end of scope body. It always exists because
|
|
259
|
+
reference line is a such one.
|
|
260
|
+
Casting ray is forced to stop if it goes over `opts.n_lines` lines.
|
|
261
|
+
- Based on top and bottom lines with strictly lower indent, construct
|
|
262
|
+
scopes's border. The way it is computed is decided based on `border`
|
|
263
|
+
option (see |MiniIndentscope.config| for more information).
|
|
264
|
+
- Compute border indent as maximum indent of border lines (or reference
|
|
265
|
+
indent minus one in case of no border). This is used during drawing
|
|
266
|
+
visual indicator.
|
|
267
|
+
|
|
268
|
+
# Indent computation ~
|
|
269
|
+
|
|
270
|
+
For every line indent is intended to be computed unambiguously:
|
|
271
|
+
- For "normal" lines indent is an output of |indent()|.
|
|
272
|
+
- Indent is `-1` for imaginary lines 0 and past last line.
|
|
273
|
+
- For blank and empty lines indent is computed based on previous
|
|
274
|
+
(|prevnonblank()|) and next (|nextnonblank()|) non-blank lines. The way
|
|
275
|
+
it is computed is decided based on `border` in order to not include blank
|
|
276
|
+
lines at edge of scope's body if there is no border there. See
|
|
277
|
+
|MiniIndentscope.config| for a details example.
|
|
278
|
+
|
|
279
|
+
Parameters ~
|
|
280
|
+
{line} `(number|nil)` Input line number (starts from 1). Can be modified to a
|
|
281
|
+
neighbor if `try_as_border` is `true`. Default: cursor line.
|
|
282
|
+
{col} `(number|nil)` Column number (starts from 1). Default: if
|
|
283
|
+
`indent_at_cursor` option is `true` - cursor column from `curswant` of
|
|
284
|
+
|getcurpos()| (allows for more natural behavior on empty lines);
|
|
285
|
+
`math.huge` otherwise in order to not incorporate cursor in computation.
|
|
286
|
+
{opts} `(table|nil)` Options to override global or buffer local ones (see
|
|
287
|
+
|MiniIndentscope.config|).
|
|
288
|
+
|
|
289
|
+
Return ~
|
|
290
|
+
`(table)` Table with scope information:
|
|
291
|
+
- <body> - table with <top> (top line of scope, inclusive), <bottom>
|
|
292
|
+
(bottom line of scope, inclusive), and <indent> (minimum indent within
|
|
293
|
+
scope) keys. Line numbers start at 1. Can also have <is_incomplete> key
|
|
294
|
+
set to `true` if computation was stopped due to `opts.n_lines` restriction.
|
|
295
|
+
- <border> - table with <top> (line of top border, might be `nil`),
|
|
296
|
+
<bottom> (line of bottom border, might be `nil`), and <indent> (indent
|
|
297
|
+
of border) keys. Line numbers start at 1.
|
|
298
|
+
- <buf_id> - identifier of current buffer.
|
|
299
|
+
- <reference> - table with <line> (reference line), <column> (reference
|
|
300
|
+
column), and <indent> ("indent at column") keys.
|
|
301
|
+
|
|
302
|
+
------------------------------------------------------------------------------
|
|
303
|
+
*MiniIndentscope.draw()*
|
|
304
|
+
`MiniIndentscope.draw`({scope}, {opts})
|
|
305
|
+
Draw scope manually
|
|
306
|
+
|
|
307
|
+
Scope is visualized as a vertical line within scope's body range at column
|
|
308
|
+
equal to border indent plus one (or body indent if border is absent).
|
|
309
|
+
Numbering starts from one.
|
|
310
|
+
|
|
311
|
+
Parameters ~
|
|
312
|
+
{scope} `(table|nil)` Scope. Default: output of |MiniIndentscope.get_scope()|
|
|
313
|
+
with default arguments.
|
|
314
|
+
{opts} `(table|nil)` Options. Currently supported:
|
|
315
|
+
- <animation_fun> - animation function for drawing. See
|
|
316
|
+
|MiniIndentscope-drawing| and |MiniIndentscope.gen_animation|.
|
|
317
|
+
- <priority> - priority number for visualization. See `priority` option
|
|
318
|
+
for |nvim_buf_set_extmark()|.
|
|
319
|
+
|
|
320
|
+
------------------------------------------------------------------------------
|
|
321
|
+
*MiniIndentscope.undraw()*
|
|
322
|
+
`MiniIndentscope.undraw`()
|
|
323
|
+
Undraw currently visible scope manually
|
|
324
|
+
|
|
325
|
+
------------------------------------------------------------------------------
|
|
326
|
+
*MiniIndentscope.gen_animation*
|
|
327
|
+
`MiniIndentscope.gen_animation`
|
|
328
|
+
Generate builtin animation function
|
|
329
|
+
|
|
330
|
+
This is a builtin source to generate animation function for usage in
|
|
331
|
+
`MiniIndentscope.config.draw.animation`. Most of them are variations of
|
|
332
|
+
common easing functions, which provide certain type of progression for
|
|
333
|
+
revealing scope visual indicator.
|
|
334
|
+
|
|
335
|
+
Each field corresponds to one family of progression which can be customized
|
|
336
|
+
further by supplying appropriate arguments.
|
|
337
|
+
|
|
338
|
+
Examples:
|
|
339
|
+
- Don't use animation: `MiniIndentscope.gen_animation.none()`
|
|
340
|
+
- Use quadratic "out" easing with total duration of 1000 ms: >lua
|
|
341
|
+
|
|
342
|
+
gen_animation.quadratic({ easing = 'out', duration = 1000, unit = 'total' })
|
|
343
|
+
<
|
|
344
|
+
See also ~
|
|
345
|
+
|MiniIndentscope-drawing| for more information about how drawing is done.
|
|
346
|
+
|
|
347
|
+
------------------------------------------------------------------------------
|
|
348
|
+
*MiniIndentscope.gen_animation.none()*
|
|
349
|
+
`MiniIndentscope.gen_animation.none`()
|
|
350
|
+
Generate no animation
|
|
351
|
+
|
|
352
|
+
Show indicator immediately. Same as animation function always returning 0.
|
|
353
|
+
|
|
354
|
+
------------------------------------------------------------------------------
|
|
355
|
+
*MiniIndentscope.gen_animation.linear()*
|
|
356
|
+
`MiniIndentscope.gen_animation.linear`({opts})
|
|
357
|
+
Generate linear progression
|
|
358
|
+
|
|
359
|
+
Parameters ~
|
|
360
|
+
{opts} `(table|nil)` Options that control progression. Possible keys:
|
|
361
|
+
- <easing> `(string)` - a subtype of progression. One of "in"
|
|
362
|
+
(accelerating from zero speed), "out" (decelerating to zero speed),
|
|
363
|
+
"in-out" (default; accelerating halfway, decelerating after).
|
|
364
|
+
- <duration> `(number)` - duration (in ms) of a unit. Default: 20.
|
|
365
|
+
- <unit> `(string)` - which unit's duration `opts.duration` controls. One
|
|
366
|
+
of "step" (default; ensures average duration of step to be `opts.duration`)
|
|
367
|
+
or "total" (ensures fixed total duration regardless of scope's range).
|
|
368
|
+
|
|
369
|
+
Return ~
|
|
370
|
+
`(function)` Animation function (see |MiniIndentscope-drawing|).
|
|
371
|
+
|
|
372
|
+
------------------------------------------------------------------------------
|
|
373
|
+
*MiniIndentscope.gen_animation.quadratic()*
|
|
374
|
+
`MiniIndentscope.gen_animation.quadratic`({opts})
|
|
375
|
+
Generate quadratic progression
|
|
376
|
+
|
|
377
|
+
Parameters ~
|
|
378
|
+
{opts} `(table|nil)` Options that control progression. Possible keys:
|
|
379
|
+
- <easing> `(string)` - a subtype of progression. One of "in"
|
|
380
|
+
(accelerating from zero speed), "out" (decelerating to zero speed),
|
|
381
|
+
"in-out" (default; accelerating halfway, decelerating after).
|
|
382
|
+
- <duration> `(number)` - duration (in ms) of a unit. Default: 20.
|
|
383
|
+
- <unit> `(string)` - which unit's duration `opts.duration` controls. One
|
|
384
|
+
of "step" (default; ensures average duration of step to be `opts.duration`)
|
|
385
|
+
or "total" (ensures fixed total duration regardless of scope's range).
|
|
386
|
+
|
|
387
|
+
Return ~
|
|
388
|
+
`(function)` Animation function (see |MiniIndentscope-drawing|).
|
|
389
|
+
|
|
390
|
+
------------------------------------------------------------------------------
|
|
391
|
+
*MiniIndentscope.gen_animation.cubic()*
|
|
392
|
+
`MiniIndentscope.gen_animation.cubic`({opts})
|
|
393
|
+
Generate cubic progression
|
|
394
|
+
|
|
395
|
+
Parameters ~
|
|
396
|
+
{opts} `(table|nil)` Options that control progression. Possible keys:
|
|
397
|
+
- <easing> `(string)` - a subtype of progression. One of "in"
|
|
398
|
+
(accelerating from zero speed), "out" (decelerating to zero speed),
|
|
399
|
+
"in-out" (default; accelerating halfway, decelerating after).
|
|
400
|
+
- <duration> `(number)` - duration (in ms) of a unit. Default: 20.
|
|
401
|
+
- <unit> `(string)` - which unit's duration `opts.duration` controls. One
|
|
402
|
+
of "step" (default; ensures average duration of step to be `opts.duration`)
|
|
403
|
+
or "total" (ensures fixed total duration regardless of scope's range).
|
|
404
|
+
|
|
405
|
+
Return ~
|
|
406
|
+
`(function)` Animation function (see |MiniIndentscope-drawing|).
|
|
407
|
+
|
|
408
|
+
------------------------------------------------------------------------------
|
|
409
|
+
*MiniIndentscope.gen_animation.quartic()*
|
|
410
|
+
`MiniIndentscope.gen_animation.quartic`({opts})
|
|
411
|
+
Generate quartic progression
|
|
412
|
+
|
|
413
|
+
Parameters ~
|
|
414
|
+
{opts} `(table|nil)` Options that control progression. Possible keys:
|
|
415
|
+
- <easing> `(string)` - a subtype of progression. One of "in"
|
|
416
|
+
(accelerating from zero speed), "out" (decelerating to zero speed),
|
|
417
|
+
"in-out" (default; accelerating halfway, decelerating after).
|
|
418
|
+
- <duration> `(number)` - duration (in ms) of a unit. Default: 20.
|
|
419
|
+
- <unit> `(string)` - which unit's duration `opts.duration` controls. One
|
|
420
|
+
of "step" (default; ensures average duration of step to be `opts.duration`)
|
|
421
|
+
or "total" (ensures fixed total duration regardless of scope's range).
|
|
422
|
+
|
|
423
|
+
Return ~
|
|
424
|
+
`(function)` Animation function (see |MiniIndentscope-drawing|).
|
|
425
|
+
|
|
426
|
+
------------------------------------------------------------------------------
|
|
427
|
+
*MiniIndentscope.gen_animation.exponential()*
|
|
428
|
+
`MiniIndentscope.gen_animation.exponential`({opts})
|
|
429
|
+
Generate exponential progression
|
|
430
|
+
|
|
431
|
+
Parameters ~
|
|
432
|
+
{opts} `(table|nil)` Options that control progression. Possible keys:
|
|
433
|
+
- <easing> `(string)` - a subtype of progression. One of "in"
|
|
434
|
+
(accelerating from zero speed), "out" (decelerating to zero speed),
|
|
435
|
+
"in-out" (default; accelerating halfway, decelerating after).
|
|
436
|
+
- <duration> `(number)` - duration (in ms) of a unit. Default: 20.
|
|
437
|
+
- <unit> `(string)` - which unit's duration `opts.duration` controls. One
|
|
438
|
+
of "step" (default; ensures average duration of step to be `opts.duration`)
|
|
439
|
+
or "total" (ensures fixed total duration regardless of scope's range).
|
|
440
|
+
|
|
441
|
+
Return ~
|
|
442
|
+
`(function)` Animation function (see |MiniIndentscope-drawing|).
|
|
443
|
+
|
|
444
|
+
------------------------------------------------------------------------------
|
|
445
|
+
*MiniIndentscope.move_cursor()*
|
|
446
|
+
`MiniIndentscope.move_cursor`({side}, {use_border}, {scope})
|
|
447
|
+
Move cursor within scope
|
|
448
|
+
|
|
449
|
+
Cursor is placed on a first non-blank character of target line.
|
|
450
|
+
|
|
451
|
+
Parameters ~
|
|
452
|
+
{side} `(string)` One of "top" or "bottom".
|
|
453
|
+
{use_border} `(boolean|nil)` Whether to move to border or within scope's body.
|
|
454
|
+
If particular border is absent, body is used.
|
|
455
|
+
{scope} `(table|nil)` Scope to use. Default: output of |MiniIndentscope.get_scope()|.
|
|
456
|
+
|
|
457
|
+
------------------------------------------------------------------------------
|
|
458
|
+
*MiniIndentscope.operator()*
|
|
459
|
+
`MiniIndentscope.operator`({side}, {add_to_jumplist})
|
|
460
|
+
Function for motion mappings
|
|
461
|
+
|
|
462
|
+
Move to a certain side of border. Respects |count| and dot-repeat (in
|
|
463
|
+
operator-pending mode). Doesn't move cursor for scope that is not shown
|
|
464
|
+
(drawing indent less that zero).
|
|
465
|
+
|
|
466
|
+
Parameters ~
|
|
467
|
+
{side} `(string)` One of "top" or "bottom".
|
|
468
|
+
{add_to_jumplist} `(boolean|nil)` Whether to add movement to jump list. It is
|
|
469
|
+
`true` only for Normal mode mappings.
|
|
470
|
+
|
|
471
|
+
------------------------------------------------------------------------------
|
|
472
|
+
*MiniIndentscope.textobject()*
|
|
473
|
+
`MiniIndentscope.textobject`({use_border})
|
|
474
|
+
Function for textobject mappings
|
|
475
|
+
|
|
476
|
+
Respects |count| and dot-repeat (in operator-pending mode). Doesn't work
|
|
477
|
+
for scope that is not shown (drawing indent less that zero).
|
|
478
|
+
|
|
479
|
+
Parameters ~
|
|
480
|
+
{use_border} `(boolean|nil)` Whether to include border in textobject. When
|
|
481
|
+
`true` and `try_as_border` option is `false`, allows "chaining" calls for
|
|
482
|
+
incremental selection.
|
|
483
|
+
|
|
484
|
+
|
|
485
|
+
vim:tw=78:ts=8:noet:ft=help:norl:
|