Skip to content

Commit 84979da

Browse files
committed
feat(minimax): sync
1 parent 6cd67d6 commit 84979da

File tree

3 files changed

+43
-32
lines changed

3 files changed

+43
-32
lines changed

MiniMax/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
_Generated from the `main` branch of 'MiniMax'_
22

3+
## 2025-10-16 {#2025-10-16}
4+
5+
- Move `now_if_args` startup helper to 'init.lua' as `_G.Config.now_if_args` to be directly usable from other config files.
6+
7+
- Enable 'mini.misc' behind `now_if_args` instead of `now`. Otherwise `setup_auto_root()` and `setup_restore_cursor()` don't work on initial file(s) if Neovim is started as `nvim -- path/to/file`.
8+
39
## 2025-10-13 {#2025-10-13}
410

511
- Initial release.

MiniMax/configs/nvim-0.11/index.qmd

Lines changed: 36 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ _G.Config.new_autocmd = function(event, pattern, callback, desc)
9494
local opts = { group = gr, pattern = pattern, callback = callback, desc = desc }
9595
vim.api.nvim_create_autocmd(event, opts)
9696
end
97+
98+
-- Some plugins only and 'mini.nvim' modules need setup during startup if Neovim
99+
-- is started like `nvim -- path/to/file`, otherwise delaying startup is fine
100+
_G.Config.now_if_args = vim.fn.argc(-1) > 0 and MiniDeps.now or MiniDeps.later
97101
```
98102

99103
</details>
@@ -383,7 +387,6 @@ nmap_leader('fL', '<Cmd>Pick buf_lines scope="current"<CR>', 'Lines (buf)')
383387
nmap_leader('fm', '<Cmd>Pick git_hunks<CR>', 'Modified hunks (all)')
384388
nmap_leader('fM', '<Cmd>Pick git_hunks path="%"<CR>', 'Modified hunks (buf)')
385389
nmap_leader('fr', '<Cmd>Pick resume<CR>', 'Resume')
386-
nmap_leader('fp', '<Cmd>Pick projects<CR>', 'Projects')
387390
nmap_leader('fR', '<Cmd>Pick lsp scope="references"<CR>', 'References (LSP)')
388391
nmap_leader('fs', '<Cmd>Pick lsp scope="workspace_symbol"<CR>', 'Symbols workspace')
389392
nmap_leader('fS', '<Cmd>Pick lsp scope="document_symbol"<CR>', 'Symbols document')
@@ -515,8 +518,10 @@ nmap_leader('vL', '<Cmd>lua MiniVisits.remove_label()<CR>', 'Remove label'
515518

516519
-- To minimize the time until first screen draw, modules are enabled in two steps:
517520
-- - Step one enables everything that is needed for first draw with `now()`.
521+
-- Sometimes is needed only if Neovim is started as `nvim -- path/to/file`.
518522
-- - Everything else is delayed until the first draw with `later()`.
519523
local now, later = MiniDeps.now, MiniDeps.later
524+
local now_if_args = _G.Config.now_if_args
520525

521526
-- Step one ===================================================================
522527
-- Enable 'miniwinter' color scheme. It comes with 'mini.nvim' and uses 'mini.hues'.
@@ -578,6 +583,33 @@ now(function()
578583
later(MiniIcons.tweak_lsp_kind)
579584
end)
580585

586+
-- Miscellaneous small but useful functions. Example usage:
587+
-- - `<Leader>oz` - toggle between "zoomed" and regular view of current buffer
588+
-- - `<Leader>or` - resize window to its "editable width"
589+
-- - `:lua put_text(vim.lsp.get_clients())` - put output of a function below
590+
-- cursor in current buffer. Useful for a detailed exploration.
591+
-- - `:lua put(MiniMisc.stat_summary(MiniMisc.bench_time(f, 100)))` - run
592+
-- function `f` 100 times and report statistical summary of execution times
593+
--
594+
-- Uses `now()` for `setup_xxx()` to work when started like `nvim -- path/to/file`
595+
now_if_args(function()
596+
-- Makes `:h MiniMisc.put()` and `:h MiniMisc.put_text()` public
597+
require('mini.misc').setup()
598+
599+
-- Change current working directory based on the current file path. It
600+
-- searches up the file tree until the first root marker ('.git' or 'Makefile')
601+
-- and sets their parent directory as a current directory.
602+
-- This is helpful when simultaneously dealing with files from several projects.
603+
MiniMisc.setup_auto_root()
604+
605+
-- Restore latest cursor position on file open
606+
MiniMisc.setup_restore_cursor()
607+
608+
-- Synchronize terminal emulator background with Neovim's background to remove
609+
-- possibly different color padding around Neovim instance
610+
MiniMisc.setup_termbg_sync()
611+
end)
612+
581613
-- Notifications provider. Shows all kinds of notifications in the upper right
582614
-- corner (by default). Example usage:
583615
-- - `:h vim.notify()` - show notification (hides automatically)
@@ -1052,31 +1084,6 @@ later(function()
10521084
end
10531085
end)
10541086

1055-
-- Miscellaneous small but useful functions. Example usage:
1056-
-- - `<Leader>oz` - toggle between "zoomed" and regular view of current buffer
1057-
-- - `<Leader>or` - resize window to its "editable width"
1058-
-- - `:lua put_text(vim.lsp.get_clients())` - put output of a function below
1059-
-- cursor in current buffer. Useful for a detailed exploration.
1060-
-- - `:lua put(MiniMisc.stat_summary(MiniMisc.bench_time(f, 100)))` - run
1061-
-- function `f` 100 times and report statistical summary of execution times
1062-
later(function()
1063-
-- Makes `:h MiniMisc.put()` and `:h MiniMisc.put_text()` public
1064-
require('mini.misc').setup()
1065-
1066-
-- Change current working directory based on the current file path. It
1067-
-- searches up the file tree until the first root marker ('.git' or 'Makefile')
1068-
-- and sets their parent directory as a current directory.
1069-
-- This is helpful when simultaneously dealing with files from several projects.
1070-
MiniMisc.setup_auto_root()
1071-
1072-
-- Restore latest cursor position on file open
1073-
MiniMisc.setup_restore_cursor()
1074-
1075-
-- Synchronize terminal emulator background with Neovim's background to remove
1076-
-- possibly different color padding around Neovim instance
1077-
MiniMisc.setup_termbg_sync()
1078-
end)
1079-
10801087
-- Move any selection in any direction. Example usage in Normal mode:
10811088
-- - `<M-j>`/`<M-k>` - move current line down / up
10821089
-- - `<M-h>`/`<M-l>` - decrease / increase indent of current line
@@ -1308,11 +1315,9 @@ later(function() require('mini.visits').setup() end)
13081315
--
13091316
-- Use this file to install and configure other such plugins.
13101317

1311-
-- Make concise helpers for installing/adding plugins in two stages.
1312-
-- Add some plugins now if Neovim is started like `nvim -- some-file` because
1313-
-- they are needed during startup to work correctly.
1314-
local add, now, later = MiniDeps.add, MiniDeps.now, MiniDeps.later
1315-
local now_if_args = vim.fn.argc(-1) > 0 and now or later
1318+
-- Make concise helpers for installing/adding plugins in two stages
1319+
local add, later = MiniDeps.add, MiniDeps.later
1320+
local now_if_args = _G.Config.now_if_args
13161321

13171322
-- Tree-sitter ================================================================
13181323

MiniMax/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ It is not a comprehensive guide on how to set up and use every Neovim feature an
4444
- Operating system: any OS supported by Neovim.
4545
- Internet connection for downloading plugins.
4646
- (Optional, but recommended) [`ripgrep`](https://github.com/BurntSushi/ripgrep#installation).
47-
- (Optional, but recommended) Terminal emulator or GUI with true colors and [Nerd Font icons](https://www.nerdfonts.com/) support. No need for full Nerd font, using `Symbols Only` nerd font as a fallback is usually enough.
47+
- (Optional, but recommended) Terminal emulator (or GUI) with [true colors](https://github.com/termstandard/colors#truecolor-support-in-output-devices) and [Nerd Font icons](https://www.nerdfonts.com/) support. No need for a full Nerd font, using [`NerdFontsSymbolsOnly`](https://github.com/ryanoasis/nerd-fonts/releases/latest) as a fallback is usually enough.
4848

4949
#### Knowledge
5050

0 commit comments

Comments
 (0)