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,431 @@
|
|
|
1
|
+
*mini.misc* Miscellaneous functions
|
|
2
|
+
|
|
3
|
+
MIT License Copyright (c) 2021 Evgeni Chasnovski
|
|
4
|
+
|
|
5
|
+
------------------------------------------------------------------------------
|
|
6
|
+
*MiniMisc*
|
|
7
|
+
Features the following functions:
|
|
8
|
+
- |MiniMisc.bench_time()| to benchmark function execution time.
|
|
9
|
+
Useful in combination with `stat_summary()`.
|
|
10
|
+
|
|
11
|
+
- |MiniMisc.log_add()|, |MiniMisc.log_show()| and other helper functions to work
|
|
12
|
+
with a special in-memory log array. Useful when debugging Lua code.
|
|
13
|
+
|
|
14
|
+
- |MiniMisc.put()| and |MiniMisc.put_text()| to pretty print its arguments
|
|
15
|
+
into command line and current buffer respectively.
|
|
16
|
+
|
|
17
|
+
- |MiniMisc.resize_window()| to resize current window to its editable width.
|
|
18
|
+
|
|
19
|
+
- |MiniMisc.safely()| to execute a function on a condition and warn on error.
|
|
20
|
+
Useful to organize |init.lua| in fail-safe sections with simple lazy loading.
|
|
21
|
+
|
|
22
|
+
- |MiniMisc.setup_auto_root()| to set up automated change of current directory.
|
|
23
|
+
|
|
24
|
+
- |MiniMisc.setup_termbg_sync()| to set up terminal background synchronization
|
|
25
|
+
(removes possible "frame" around current Neovim instance).
|
|
26
|
+
|
|
27
|
+
- |MiniMisc.setup_restore_cursor()| to set up automated restoration of
|
|
28
|
+
cursor position on file reopen.
|
|
29
|
+
|
|
30
|
+
- |MiniMisc.stat_summary()| to compute summary statistics of numerical array.
|
|
31
|
+
Useful in combination with `bench_time()`.
|
|
32
|
+
|
|
33
|
+
- |MiniMisc.tbl_head()| and |MiniMisc.tbl_tail()| to return "first" and "last"
|
|
34
|
+
elements of table.
|
|
35
|
+
|
|
36
|
+
- |MiniMisc.zoom()| to zoom in and out of a buffer, making it full screen
|
|
37
|
+
in a floating window.
|
|
38
|
+
|
|
39
|
+
- And more.
|
|
40
|
+
|
|
41
|
+
# Setup ~
|
|
42
|
+
|
|
43
|
+
This module doesn't need setup, but it can be done to improve usability.
|
|
44
|
+
Setup with `require('mini.misc').setup({})` (replace `{}` with your
|
|
45
|
+
`config` table). It will create global Lua table `MiniMisc` which you can
|
|
46
|
+
use for scripting or manually (with `:lua MiniMisc.*`).
|
|
47
|
+
|
|
48
|
+
See |MiniMisc.config| for `config` structure and default values.
|
|
49
|
+
|
|
50
|
+
This module doesn't have runtime options, so using `vim.b.minimisc_config`
|
|
51
|
+
will have no effect here.
|
|
52
|
+
|
|
53
|
+
------------------------------------------------------------------------------
|
|
54
|
+
*MiniMisc.setup()*
|
|
55
|
+
`MiniMisc.setup`({config})
|
|
56
|
+
Module setup
|
|
57
|
+
|
|
58
|
+
Parameters ~
|
|
59
|
+
{config} `(table|nil)` Module config table. See |MiniMisc.config|.
|
|
60
|
+
|
|
61
|
+
Usage ~
|
|
62
|
+
>lua
|
|
63
|
+
require('mini.misc').setup() -- use default config
|
|
64
|
+
-- OR
|
|
65
|
+
require('mini.misc').setup({}) -- replace {} with your config table
|
|
66
|
+
<
|
|
67
|
+
------------------------------------------------------------------------------
|
|
68
|
+
*MiniMisc.config*
|
|
69
|
+
`MiniMisc.config`
|
|
70
|
+
Defaults ~
|
|
71
|
+
>lua
|
|
72
|
+
MiniMisc.config = {
|
|
73
|
+
-- Array of fields to make global (to be used as independent variables)
|
|
74
|
+
make_global = { 'put', 'put_text' },
|
|
75
|
+
}
|
|
76
|
+
<
|
|
77
|
+
------------------------------------------------------------------------------
|
|
78
|
+
*MiniMisc.bench_time()*
|
|
79
|
+
`MiniMisc.bench_time`({f}, {n}, {...})
|
|
80
|
+
Execute `f` several times and time how long it took
|
|
81
|
+
|
|
82
|
+
Parameters ~
|
|
83
|
+
{f} `(function)` Function which execution to benchmark.
|
|
84
|
+
{n} `(number|nil)` Number of times to execute `f(...)`. Default: 1.
|
|
85
|
+
{...} `(any)` Arguments when calling `f`.
|
|
86
|
+
|
|
87
|
+
Return ~
|
|
88
|
+
`(...)` Table with durations (in seconds; up to nanoseconds) and
|
|
89
|
+
output of (last) function execution.
|
|
90
|
+
|
|
91
|
+
------------------------------------------------------------------------------
|
|
92
|
+
*MiniMisc.get_gutter_width()*
|
|
93
|
+
`MiniMisc.get_gutter_width`({win_id})
|
|
94
|
+
Compute width of gutter (info column on the left of the window)
|
|
95
|
+
|
|
96
|
+
Parameters ~
|
|
97
|
+
{win_id} `(number|nil)` Window identifier (see |win_getid()|) for which gutter
|
|
98
|
+
width is computed. Default: 0 for current.
|
|
99
|
+
|
|
100
|
+
------------------------------------------------------------------------------
|
|
101
|
+
*MiniMisc.log_add()*
|
|
102
|
+
`MiniMisc.log_add`({desc}, {state}, {opts})
|
|
103
|
+
Add an entry to the in-memory log array
|
|
104
|
+
|
|
105
|
+
Useful when trying to debug a Lua code (like Neovim config or plugin).
|
|
106
|
+
Use this instead of ad-hoc `print()` statements.
|
|
107
|
+
|
|
108
|
+
Each entry is a table with the following fields:
|
|
109
|
+
- <desc> `(any)` - entry description. Usually a string describing a place
|
|
110
|
+
in the code.
|
|
111
|
+
- <state> `(any)` - data about current state. Usually a table.
|
|
112
|
+
- <timestamp> `(number)` - a timestamp of when the entry was added. A number of
|
|
113
|
+
milliseconds since the in-memory log was initiated (after |MiniMisc.setup()|
|
|
114
|
+
or |MiniMisc.log_clear()|). Useful during profiling.
|
|
115
|
+
|
|
116
|
+
Parameters ~
|
|
117
|
+
{desc} `(any)` Entry description.
|
|
118
|
+
{state} `(any)` Data about current state.
|
|
119
|
+
{opts} `(table|nil)` Options. Possible fields:
|
|
120
|
+
- <deepcopy> - (boolean) Whether to create a copy of tables in {state}.
|
|
121
|
+
Usually helpful to record the exact state during code execution and avoid
|
|
122
|
+
side effects of tables being changed in-place. Default `true`.
|
|
123
|
+
|
|
124
|
+
Usage ~
|
|
125
|
+
>lua
|
|
126
|
+
local t = { a = 1 }
|
|
127
|
+
MiniMisc.log_add('before', { t = t }) -- Will show `t = { a = 1 }` state
|
|
128
|
+
t.a = t.a + 1
|
|
129
|
+
MiniMisc.log_add('after', { t = t }) -- Will show `t = { a = 2 }` state
|
|
130
|
+
|
|
131
|
+
-- Use `:lua MiniMisc.log_show()` or `:=MiniMisc.log_get()` to see the log
|
|
132
|
+
<
|
|
133
|
+
See also ~
|
|
134
|
+
- |MiniMisc.log_get()| to get log array
|
|
135
|
+
- |MiniMisc.log_show()| to show log array in the dedicated buffer
|
|
136
|
+
- |MiniMisc.log_clear()| to clear the log array
|
|
137
|
+
|
|
138
|
+
------------------------------------------------------------------------------
|
|
139
|
+
*MiniMisc.log_get()*
|
|
140
|
+
`MiniMisc.log_get`()
|
|
141
|
+
Get log array
|
|
142
|
+
|
|
143
|
+
Return ~
|
|
144
|
+
`(table[])` Log array. Returned as is, without |vim.deepcopy()|.
|
|
145
|
+
|
|
146
|
+
See also ~
|
|
147
|
+
- |MiniMisc.log_add()| to add to the log array
|
|
148
|
+
|
|
149
|
+
------------------------------------------------------------------------------
|
|
150
|
+
*MiniMisc.log_show()*
|
|
151
|
+
`MiniMisc.log_show`()
|
|
152
|
+
Show log array in a scratch buffer
|
|
153
|
+
|
|
154
|
+
See also ~
|
|
155
|
+
- |MiniMisc.log_add()| to add to the log array
|
|
156
|
+
|
|
157
|
+
------------------------------------------------------------------------------
|
|
158
|
+
*MiniMisc.log_clear()*
|
|
159
|
+
`MiniMisc.log_clear`()
|
|
160
|
+
Clear log array
|
|
161
|
+
|
|
162
|
+
This also sets a new starting point for entry timestamps.
|
|
163
|
+
|
|
164
|
+
See also ~
|
|
165
|
+
- |MiniMisc.log_add()| to add to the log array
|
|
166
|
+
|
|
167
|
+
------------------------------------------------------------------------------
|
|
168
|
+
*MiniMisc.put()*
|
|
169
|
+
`MiniMisc.put`({...})
|
|
170
|
+
Print Lua objects in command line
|
|
171
|
+
|
|
172
|
+
Parameters ~
|
|
173
|
+
{...} `(any)` Any number of objects to be printed each on separate line.
|
|
174
|
+
|
|
175
|
+
------------------------------------------------------------------------------
|
|
176
|
+
*MiniMisc.put_text()*
|
|
177
|
+
`MiniMisc.put_text`({...})
|
|
178
|
+
Print Lua objects in current buffer
|
|
179
|
+
|
|
180
|
+
Parameters ~
|
|
181
|
+
{...} `(any)` Any number of objects to be printed each on separate line.
|
|
182
|
+
|
|
183
|
+
------------------------------------------------------------------------------
|
|
184
|
+
*MiniMisc.resize_window()*
|
|
185
|
+
`MiniMisc.resize_window`({win_id}, {text_width})
|
|
186
|
+
Resize window to have exact number of editable columns
|
|
187
|
+
|
|
188
|
+
Parameters ~
|
|
189
|
+
{win_id} `(number|nil)` Window identifier (see |win_getid()|) to be resized.
|
|
190
|
+
Default: 0 for current.
|
|
191
|
+
{text_width} `(number|nil)` Number of editable columns resized window will
|
|
192
|
+
display. Default: first element of |'colorcolumn'| or otherwise |'textwidth'|
|
|
193
|
+
(using screen width as its default but not more than 79).
|
|
194
|
+
|
|
195
|
+
------------------------------------------------------------------------------
|
|
196
|
+
*MiniMisc.safely()*
|
|
197
|
+
`MiniMisc.safely`({when}, {f})
|
|
198
|
+
Execute a function on a condition and warn on error
|
|
199
|
+
|
|
200
|
+
Input function is executed exactly once. Its possible error is captured and is
|
|
201
|
+
shown as a |vim.notify()| warning.
|
|
202
|
+
|
|
203
|
+
Useful to organize |init.lua| in fail-safe sections with simple lazy loading.
|
|
204
|
+
|
|
205
|
+
Parameters ~
|
|
206
|
+
{when} `(string)` When to execute a function. One of:
|
|
207
|
+
- `'now'` - immediately.
|
|
208
|
+
- `'later'` - queue to be executed soon without blocking the execution of next
|
|
209
|
+
code in file. Queued functions are executed in order they are added.
|
|
210
|
+
- `'delay:<number>'` - after a specified delay with |vim.defer_fn()|.
|
|
211
|
+
- `'event:<events>'` - on whichever specified event is triggered first.
|
|
212
|
+
- `'event:<events>~<patterns>` - same as above, but events must match
|
|
213
|
+
specified |autocmd-pattern|.
|
|
214
|
+
- `'filetype:<filetypes>'` - same as `'event:FileType~<filetypes>'`, but follow
|
|
215
|
+
successful function execution with |filetype-detect| for all normal buffers
|
|
216
|
+
(if new |ftdetect| scripts were added) and sourcing |ftplugin| (for buffers
|
|
217
|
+
matching `<filetypes>`). Intended to be used for loading "language plugins".
|
|
218
|
+
{f} `(function)` Function to execute (without arguments).
|
|
219
|
+
|
|
220
|
+
Usage ~
|
|
221
|
+
>lua
|
|
222
|
+
MiniMisc.safely('later', function()
|
|
223
|
+
vim.notify('This will be executed after the next "now" call')
|
|
224
|
+
end)
|
|
225
|
+
MiniMisc.safely('now', function() error('This will be a warning') end)
|
|
226
|
+
|
|
227
|
+
MiniMisc.safely('event:InsertEnter', function()
|
|
228
|
+
require('mini.completion').setup()
|
|
229
|
+
end)
|
|
230
|
+
MiniMisc.safely('event:CmdlineEnter~/', function()
|
|
231
|
+
vim.notify('Start searching for the first time')
|
|
232
|
+
end)
|
|
233
|
+
|
|
234
|
+
MiniMisc.safely('filetype:tex,plaintex', function()
|
|
235
|
+
-- Load plugin to improve writing LaTeX
|
|
236
|
+
end)
|
|
237
|
+
<
|
|
238
|
+
------------------------------------------------------------------------------
|
|
239
|
+
*MiniMisc.setup_auto_root()*
|
|
240
|
+
`MiniMisc.setup_auto_root`({names}, {fallback})
|
|
241
|
+
Set up automated change of current directory
|
|
242
|
+
|
|
243
|
+
What it does:
|
|
244
|
+
- Creates autocommand which on every |BufEnter| event with |MiniMisc.find_root()|
|
|
245
|
+
finds root directory for current buffer file and sets |current-directory|
|
|
246
|
+
to it (using |chdir()|).
|
|
247
|
+
- Resets |'autochdir'| to `false`.
|
|
248
|
+
|
|
249
|
+
Parameters ~
|
|
250
|
+
{names} `(table|function|nil)` Forwarded to |MiniMisc.find_root()|.
|
|
251
|
+
{fallback} `(function|nil)` Forwarded to |MiniMisc.find_root()|.
|
|
252
|
+
|
|
253
|
+
Usage ~
|
|
254
|
+
>lua
|
|
255
|
+
require('mini.misc').setup()
|
|
256
|
+
MiniMisc.setup_auto_root()
|
|
257
|
+
<
|
|
258
|
+
------------------------------------------------------------------------------
|
|
259
|
+
*MiniMisc.find_root()*
|
|
260
|
+
`MiniMisc.find_root`({buf_id}, {names}, {fallback})
|
|
261
|
+
Find root directory
|
|
262
|
+
|
|
263
|
+
Based on a buffer name (full path to file opened in a buffer) find a root
|
|
264
|
+
directory. If buffer is not associated with file, returns `nil`.
|
|
265
|
+
|
|
266
|
+
Root directory is a directory containing at least one of pre-defined files.
|
|
267
|
+
It is searched using |vim.fs.find()| with `upward = true` starting from
|
|
268
|
+
directory of current buffer file until first occurrence of root file(s).
|
|
269
|
+
|
|
270
|
+
Notes:
|
|
271
|
+
- Uses directory path caching to speed up computations. This means that no
|
|
272
|
+
changes in root directory will be detected after directory path was already
|
|
273
|
+
used in this function. Reload Neovim to account for that.
|
|
274
|
+
|
|
275
|
+
Parameters ~
|
|
276
|
+
{buf_id} `(number|nil)` Buffer identifier (see |bufnr()|) to use.
|
|
277
|
+
Default: 0 for current.
|
|
278
|
+
{names} `(table|function|nil)` Array of file names or a callable used to
|
|
279
|
+
identify a root directory. Forwarded to |vim.fs.find()|.
|
|
280
|
+
Default: `{ '.git', 'Makefile' }`.
|
|
281
|
+
{fallback} `(function|nil)` Callable fallback to use if no root is found
|
|
282
|
+
with |vim.fs.find()|. Will be called with a buffer path and should return
|
|
283
|
+
a valid directory path.
|
|
284
|
+
|
|
285
|
+
------------------------------------------------------------------------------
|
|
286
|
+
*MiniMisc.setup_termbg_sync()*
|
|
287
|
+
`MiniMisc.setup_termbg_sync`({opts})
|
|
288
|
+
Set up terminal background synchronization
|
|
289
|
+
|
|
290
|
+
What it does:
|
|
291
|
+
- Checks if terminal emulator supports OSC 11 control sequence through
|
|
292
|
+
appropriate `stdout`. Stops if not.
|
|
293
|
+
- Creates autocommands for |ColorScheme| and |VimResume| events, which
|
|
294
|
+
change terminal background to have same color as |guibg| of |hl-Normal|.
|
|
295
|
+
- Creates autocommands for |VimLeavePre| and |VimSuspend| events which set
|
|
296
|
+
terminal background back to its original color.
|
|
297
|
+
- Synchronizes background immediately to allow not depend on loading order.
|
|
298
|
+
|
|
299
|
+
Primary use case is to remove possible "frame" around current Neovim instance
|
|
300
|
+
which appears if Neovim's |hl-Normal| background color differs from what is
|
|
301
|
+
used by terminal emulator itself.
|
|
302
|
+
|
|
303
|
+
Works only on Neovim>=0.10.
|
|
304
|
+
|
|
305
|
+
Parameters ~
|
|
306
|
+
{opts} `(table|nil)` Options. Possible fields:
|
|
307
|
+
- <explicit_reset> `(boolean)` - whether to reset terminal background by
|
|
308
|
+
explicitly setting it to the color it had when this function was called.
|
|
309
|
+
Set to `true` if terminal emulator doesn't support OSC 111 control sequence.
|
|
310
|
+
Default: `false`.
|
|
311
|
+
|
|
312
|
+
------------------------------------------------------------------------------
|
|
313
|
+
*MiniMisc.setup_restore_cursor()*
|
|
314
|
+
`MiniMisc.setup_restore_cursor`({opts})
|
|
315
|
+
Restore cursor position on file open
|
|
316
|
+
|
|
317
|
+
When reopening a file this will make sure the cursor is placed back to the
|
|
318
|
+
position where you left before. This implements |restore-cursor| in a nicer way.
|
|
319
|
+
File should have a recognized file type (see |'filetype'|) and be opened in
|
|
320
|
+
a normal buffer (see |'buftype'|).
|
|
321
|
+
|
|
322
|
+
Note: it relies on file mark data stored in |'shadafile'| (see |shada-f|).
|
|
323
|
+
Be sure to enable it.
|
|
324
|
+
|
|
325
|
+
Parameters ~
|
|
326
|
+
{opts} `(table|nil)` Options. Possible fields:
|
|
327
|
+
- <center> - (boolean) Center the window after we restored the cursor.
|
|
328
|
+
Default: `true`.
|
|
329
|
+
- <ignore_filetype> - Array with file types to be ignored (see |'filetype'|).
|
|
330
|
+
Default: `{ "gitcommit", "gitrebase" }`.
|
|
331
|
+
|
|
332
|
+
Usage ~
|
|
333
|
+
>lua
|
|
334
|
+
require('mini.misc').setup_restore_cursor()
|
|
335
|
+
<
|
|
336
|
+
------------------------------------------------------------------------------
|
|
337
|
+
*MiniMisc.stat_summary()*
|
|
338
|
+
`MiniMisc.stat_summary`({t})
|
|
339
|
+
Compute summary statistics of numerical array
|
|
340
|
+
|
|
341
|
+
This might be useful to compute summary of time benchmarking with
|
|
342
|
+
|MiniMisc.bench_time()|.
|
|
343
|
+
|
|
344
|
+
Parameters ~
|
|
345
|
+
{t} `(table)` Array (table suitable for `ipairs`) of numbers.
|
|
346
|
+
|
|
347
|
+
Return ~
|
|
348
|
+
`(table)` Table with summary values under following keys (may be
|
|
349
|
+
extended in the future): <maximum>, <mean>, <median>, <minimum>, <n>
|
|
350
|
+
(number of elements), <sd> (sample standard deviation).
|
|
351
|
+
|
|
352
|
+
------------------------------------------------------------------------------
|
|
353
|
+
*MiniMisc.tbl_head()*
|
|
354
|
+
`MiniMisc.tbl_head`({t}, {n})
|
|
355
|
+
Return "first" elements of table as decided by `pairs`
|
|
356
|
+
|
|
357
|
+
Note: order of elements might vary.
|
|
358
|
+
|
|
359
|
+
Parameters ~
|
|
360
|
+
{t} `(table)` Input table.
|
|
361
|
+
{n} `(number|nil)` Maximum number of first elements. Default: 5.
|
|
362
|
+
|
|
363
|
+
Return ~
|
|
364
|
+
`(table)` Table with at most `n` first elements of `t` (with same keys).
|
|
365
|
+
|
|
366
|
+
------------------------------------------------------------------------------
|
|
367
|
+
*MiniMisc.tbl_tail()*
|
|
368
|
+
`MiniMisc.tbl_tail`({t}, {n})
|
|
369
|
+
Return "last" elements of table as decided by `pairs`
|
|
370
|
+
|
|
371
|
+
This function makes two passes through elements of `t`:
|
|
372
|
+
- First to count number of elements.
|
|
373
|
+
- Second to construct result.
|
|
374
|
+
|
|
375
|
+
Note: order of elements might vary.
|
|
376
|
+
|
|
377
|
+
Parameters ~
|
|
378
|
+
{t} `(table)` Input table.
|
|
379
|
+
{n} `(number|nil)` Maximum number of last elements. Default: 5.
|
|
380
|
+
|
|
381
|
+
Return ~
|
|
382
|
+
`(table)` Table with at most `n` last elements of `t` (with same keys).
|
|
383
|
+
|
|
384
|
+
------------------------------------------------------------------------------
|
|
385
|
+
*MiniMisc.use_nested_comments()*
|
|
386
|
+
`MiniMisc.use_nested_comments`({buf_id})
|
|
387
|
+
Add possibility of nested comment leader
|
|
388
|
+
|
|
389
|
+
This works by parsing |'commentstring'| buffer option, extracting
|
|
390
|
+
non-whitespace comment leader (symbols on the left of commented line), and
|
|
391
|
+
locally modifying |'comments'| option (by prepending `n:<leader>`). Does
|
|
392
|
+
nothing if |'commentstring'| is empty or has comment symbols both in front
|
|
393
|
+
and back (like `/*%s*/`).
|
|
394
|
+
|
|
395
|
+
Nested comment leader added with this function is useful for formatting
|
|
396
|
+
nested comments. For example, have in Lua "first-level" comments with `--`
|
|
397
|
+
and "second-level" comments with `----`. With nested comment leader second
|
|
398
|
+
type can be formatted with `gq` in the same way as first one.
|
|
399
|
+
|
|
400
|
+
Recommended usage is with |autocmd|: >lua
|
|
401
|
+
|
|
402
|
+
local use_nested_comments = function() MiniMisc.use_nested_comments() end
|
|
403
|
+
vim.api.nvim_create_autocmd('BufEnter', { callback = use_nested_comments })
|
|
404
|
+
<
|
|
405
|
+
Note: for most filetypes |'commentstring'| option is added only when buffer
|
|
406
|
+
with this filetype is entered, so using non-current `buf_id` can not lead
|
|
407
|
+
to desired effect.
|
|
408
|
+
|
|
409
|
+
Parameters ~
|
|
410
|
+
{buf_id} `(number|nil)` Buffer identifier (see |bufnr()|) in which function
|
|
411
|
+
will operate. Default: 0 for current.
|
|
412
|
+
|
|
413
|
+
------------------------------------------------------------------------------
|
|
414
|
+
*MiniMisc.zoom()*
|
|
415
|
+
`MiniMisc.zoom`({buf_id}, {config})
|
|
416
|
+
Zoom in and out of a buffer, making it full screen in a floating window
|
|
417
|
+
|
|
418
|
+
This function is useful when working with multiple windows but temporarily
|
|
419
|
+
needing to zoom into one to see more of the code from that buffer. Call it
|
|
420
|
+
again (without arguments) to zoom out.
|
|
421
|
+
|
|
422
|
+
Parameters ~
|
|
423
|
+
{buf_id} `(number|nil)` Buffer identifier (see |bufnr()|) to be zoomed.
|
|
424
|
+
Default: 0 for current.
|
|
425
|
+
{config} `(table|nil)` Optional config for window (as for |nvim_open_win()|).
|
|
426
|
+
|
|
427
|
+
Return ~
|
|
428
|
+
`(boolean)` Whether current buffer is zoomed in.
|
|
429
|
+
|
|
430
|
+
|
|
431
|
+
vim:tw=78:ts=8:noet:ft=help:norl:
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
*mini.move* Move any selection in any direction
|
|
2
|
+
|
|
3
|
+
MIT License Copyright (c) 2023 Evgeni Chasnovski
|
|
4
|
+
|
|
5
|
+
------------------------------------------------------------------------------
|
|
6
|
+
*MiniMove*
|
|
7
|
+
Features:
|
|
8
|
+
- Works in two modes:
|
|
9
|
+
- Visual mode. Select text (charwise with |v|, linewise with |V|, and
|
|
10
|
+
blockwise with |CTRL-V|) and press customizable mapping to move in
|
|
11
|
+
all four directions (left, right, down, up). It keeps Visual mode.
|
|
12
|
+
- Normal mode. Press customizable mapping to move current line in all
|
|
13
|
+
four directions (left, right, down, up).
|
|
14
|
+
- Special handling of linewise movement:
|
|
15
|
+
- Vertical movement gets reindented with |=|.
|
|
16
|
+
- Horizontal movement is improved indent/dedent with |>| / |<|.
|
|
17
|
+
- Cursor moves along with selection.
|
|
18
|
+
|
|
19
|
+
- Provides both mappings and Lua functions for motions. See
|
|
20
|
+
|MiniMove.move_selection()| and |MiniMove.move_line()|.
|
|
21
|
+
|
|
22
|
+
- Respects |v:count|. Movement mappings can be preceded by a number which
|
|
23
|
+
multiplies command effect.
|
|
24
|
+
|
|
25
|
+
- All consecutive moves (regardless of direction) can be undone by a single |u|.
|
|
26
|
+
|
|
27
|
+
- Respects preferred column for vertical movement. It will vertically move
|
|
28
|
+
selection as how cursor is moving (not strictly vertically if target
|
|
29
|
+
column is not present in target line).
|
|
30
|
+
|
|
31
|
+
Notes:
|
|
32
|
+
- Doesn't allow moving selection outside of current lines (by design).
|
|
33
|
+
|
|
34
|
+
# Setup ~
|
|
35
|
+
|
|
36
|
+
This module needs a setup with `require('mini.move').setup({})` (replace
|
|
37
|
+
`{}` with your `config` table). It will create global Lua table `MiniMove`
|
|
38
|
+
which you can use for scripting or manually (with `:lua MiniMove.*`).
|
|
39
|
+
|
|
40
|
+
See |MiniMove.config| for available config settings.
|
|
41
|
+
|
|
42
|
+
You can override runtime config settings (but not `config.mappings`) locally
|
|
43
|
+
to buffer inside `vim.b.minimove_config` which should have same structure
|
|
44
|
+
as `MiniMove.config`. See |mini.nvim-buffer-local-config| for more details.
|
|
45
|
+
|
|
46
|
+
# Comparisons ~
|
|
47
|
+
|
|
48
|
+
- [matze/vim-move](https://github.com/matze/vim-move):
|
|
49
|
+
- Doesn't support vertical movement of charwise and blockwise selections.
|
|
50
|
+
While |mini.move| does.
|
|
51
|
+
- Doesn't support horizontal movement of current line in favor of
|
|
52
|
+
horizontal movement of current character. While |mini.move| supports
|
|
53
|
+
horizontal movement of current line and doesn't support such movement
|
|
54
|
+
of current character.
|
|
55
|
+
- Has extra functionality for certain moves (like move by half page).
|
|
56
|
+
While |mini.move| does not (by design).
|
|
57
|
+
- [booperlv/nvim-gomove](https://github.com/booperlv/nvim-gomove):
|
|
58
|
+
- Doesn't support movement in charwise visual selection.
|
|
59
|
+
While |mini.move| does.
|
|
60
|
+
- Has extra functionality beyond moving text, like duplication.
|
|
61
|
+
While |mini.move| concentrates only on moving functionality.
|
|
62
|
+
|
|
63
|
+
# Disabling ~
|
|
64
|
+
|
|
65
|
+
To disable, set `vim.g.minimove_disable` (globally) or `vim.b.minimove_disable`
|
|
66
|
+
(for a buffer) to `true`. Considering high number of different scenarios
|
|
67
|
+
and customization intentions, writing exact rules for disabling module's
|
|
68
|
+
functionality is left to user. See |mini.nvim-disabling-recipes| for common
|
|
69
|
+
recipes.
|
|
70
|
+
|
|
71
|
+
------------------------------------------------------------------------------
|
|
72
|
+
*MiniMove.setup()*
|
|
73
|
+
`MiniMove.setup`({config})
|
|
74
|
+
Module setup
|
|
75
|
+
|
|
76
|
+
Parameters ~
|
|
77
|
+
{config} `(table|nil)` Module config table. See |MiniMove.config|.
|
|
78
|
+
|
|
79
|
+
Usage ~
|
|
80
|
+
>lua
|
|
81
|
+
require('mini.move').setup() -- use default config
|
|
82
|
+
-- OR
|
|
83
|
+
require('mini.move').setup({}) -- replace {} with your config table
|
|
84
|
+
<
|
|
85
|
+
------------------------------------------------------------------------------
|
|
86
|
+
*MiniMove.config*
|
|
87
|
+
`MiniMove.config`
|
|
88
|
+
Defaults ~
|
|
89
|
+
>lua
|
|
90
|
+
MiniMove.config = {
|
|
91
|
+
-- Module mappings. Use `''` (empty string) to disable one.
|
|
92
|
+
mappings = {
|
|
93
|
+
-- Move visual selection in Visual mode. Defaults are Alt (Meta) + hjkl.
|
|
94
|
+
left = '<M-h>',
|
|
95
|
+
right = '<M-l>',
|
|
96
|
+
down = '<M-j>',
|
|
97
|
+
up = '<M-k>',
|
|
98
|
+
|
|
99
|
+
-- Move current line in Normal mode
|
|
100
|
+
line_left = '<M-h>',
|
|
101
|
+
line_right = '<M-l>',
|
|
102
|
+
line_down = '<M-j>',
|
|
103
|
+
line_up = '<M-k>',
|
|
104
|
+
},
|
|
105
|
+
|
|
106
|
+
-- Options which control moving behavior
|
|
107
|
+
options = {
|
|
108
|
+
-- Automatically reindent selection during linewise vertical move
|
|
109
|
+
reindent_linewise = true,
|
|
110
|
+
},
|
|
111
|
+
}
|
|
112
|
+
<
|
|
113
|
+
# Mappings ~
|
|
114
|
+
|
|
115
|
+
Other possible choices of mappings: >lua
|
|
116
|
+
|
|
117
|
+
-- `HJKL` for moving visual selection (overrides H, L, J in Visual mode)
|
|
118
|
+
require('mini.move').setup({
|
|
119
|
+
mappings = {
|
|
120
|
+
left = 'H',
|
|
121
|
+
right = 'L',
|
|
122
|
+
down = 'J',
|
|
123
|
+
up = 'K',
|
|
124
|
+
}
|
|
125
|
+
})
|
|
126
|
+
|
|
127
|
+
-- Shift + arrows
|
|
128
|
+
require('mini.move').setup({
|
|
129
|
+
mappings = {
|
|
130
|
+
left = '<S-left>',
|
|
131
|
+
right = '<S-right>',
|
|
132
|
+
down = '<S-down>',
|
|
133
|
+
up = '<S-up>',
|
|
134
|
+
|
|
135
|
+
line_left = '<S-left>',
|
|
136
|
+
line_right = '<S-right>',
|
|
137
|
+
line_down = '<S-down>',
|
|
138
|
+
line_up = '<S-up>',
|
|
139
|
+
}
|
|
140
|
+
})
|
|
141
|
+
<
|
|
142
|
+
------------------------------------------------------------------------------
|
|
143
|
+
*MiniMove.move_selection()*
|
|
144
|
+
`MiniMove.move_selection`({direction}, {opts})
|
|
145
|
+
Move visually selected region in any direction within present lines
|
|
146
|
+
|
|
147
|
+
Main function powering visual selection move in Visual mode.
|
|
148
|
+
|
|
149
|
+
Notes:
|
|
150
|
+
- Vertical movement in linewise mode is followed up by reindent with |v_=|.
|
|
151
|
+
- Horizontal movement in linewise mode is same as |v_<| and |v_>|.
|
|
152
|
+
|
|
153
|
+
Parameters ~
|
|
154
|
+
{direction} `(string)` One of "left", "down", "up", "right".
|
|
155
|
+
{opts} `(table|nil)` Options. Same structure as `options` in |MiniMove.config|
|
|
156
|
+
(with its values as defaults) plus these allowed extra fields:
|
|
157
|
+
- <n_times> (number) - number of times to try to make a move.
|
|
158
|
+
Default: |v:count1|.
|
|
159
|
+
|
|
160
|
+
------------------------------------------------------------------------------
|
|
161
|
+
*MiniMove.move_line()*
|
|
162
|
+
`MiniMove.move_line`({direction}, {opts})
|
|
163
|
+
Move current line in any direction
|
|
164
|
+
|
|
165
|
+
Main function powering current line move in Normal mode.
|
|
166
|
+
|
|
167
|
+
Notes:
|
|
168
|
+
- Vertical movement is followed up by reindent with |v_=|.
|
|
169
|
+
- Horizontal movement is almost the same as |<<| and |>>| with a different
|
|
170
|
+
handling of |v:count| (multiplies shift effect instead of modifying that
|
|
171
|
+
number of lines).
|
|
172
|
+
|
|
173
|
+
Parameters ~
|
|
174
|
+
{direction} `(string)` One of "left", "down", "up", "right".
|
|
175
|
+
{opts} `(table|nil)` Options. Same structure as `options` in |MiniMove.config|
|
|
176
|
+
(with its values as defaults) plus these allowed extra fields:
|
|
177
|
+
- <n_times> (number) - number of times to try to make a move.
|
|
178
|
+
Default: |v:count1|.
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
vim:tw=78:ts=8:noet:ft=help:norl:
|