Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughUpdated plugin lockfile entries and added two plugins; registered Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
🧹 Nitpick comments (1)
lua/custom/plugins/init.lua (1)
5-7: Consider adding lazy-loading forcord.nvim.The plugin will load eagerly at startup. For a Discord presence plugin, consider adding
event = "VeryLazy"to defer loading and improve startup time.Suggested improvement
return { - { 'vyfor/cord.nvim' } + { 'vyfor/cord.nvim', event = "VeryLazy" } }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@lua/custom/plugins/init.lua` around lines 5 - 7, The plugin spec for 'vyfor/cord.nvim' is loading eagerly; update the table entry for the plugin (the object containing 'vyfor/cord.nvim') to include lazy-loading by adding event = "VeryLazy" (e.g., { 'vyfor/cord.nvim', event = "VeryLazy" }) so the Discord presence is deferred until the VeryLazy event and startup time improves; keep the same table shape and add any needed config fields after adding the event key.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@lua/custom/plugins/languages/markdown.lua`:
- Around line 27-37: The custom init currently creates user commands (via
vim.api.nvim_create_user_command) for "MarkdownPreview", "MarkdownPreviewStop",
and "MarkdownPreviewToggle" which is redundant and can error because the plugin
is filetype-lazy-loaded; remove those vim.api.nvim_create_user_command blocks
from init and instead declare the plugin to lazy-load by command by adding cmd =
{ "MarkdownPreview", "MarkdownPreviewStop", "MarkdownPreviewToggle" } to the
plugin specification so Neovim will load the plugin when any of those commands
are invoked; keep the init function only for truly necessary setup not related
to these commands.
In `@lua/kickstart/plugins/cmp.lua`:
- Around line 103-109: The "<C-k>" mapping passes an invalid opts object to
cmp.select_prev_item; replace the incorrect { select = true } with the proper
nvim-cmp option object, e.g., use { behavior = cmp.SelectBehavior.Select } when
calling cmp.select_prev_item inside the "<C-k>" mapping so it matches the cmp
API (reference cmp.select_prev_item and cmp.SelectBehavior in the mapping).
- Around line 95-101: The mapping for "<C-j>" uses an invalid parameter { select
= true } when calling cmp.select_next_item; update the function to call
cmp.select_next_item() without the unsupported argument (mirror the fix used for
the "<S-Tab>" mapping), so inside the anonymous function replace
cmp.select_next_item({ select = true }) with cmp.select_next_item().
- Around line 79-85: The keymaps calling cmp.select_prev_item() and
cmp.select_next_item() (specifically the "<S-Tab>" mapping using
cmp.select_prev_item, the "<C-j>" mapping using cmp.select_next_item, and the
"<C-k>" mapping using cmp.select_prev_item) are passing an invalid `{ select =
true }` argument; remove that argument or replace it with the proper behavior
option `{ behavior = cmp.SelectBehavior.Select }` if you intend to auto-select
items. Update the three calls to either call the functions with no parameter or
with `{ behavior = cmp.SelectBehavior.Select }` accordingly.
- Around line 87-93: Remove the redundant "<C-i>" key mapping in the cmp setup:
locate the mapping that binds ["<C-i>"] to the function that checks
cmp.visible() and calls cmp.mapping.confirm({ select = true })() or fallback(),
and either delete that mapping entry entirely or change it to a different,
intentional key/action; keep the existing "<Tab>" mapping as the primary confirm
behavior to avoid terminal keycode collisions and ensure only one key handles
completion confirmation.
---
Nitpick comments:
In `@lua/custom/plugins/init.lua`:
- Around line 5-7: The plugin spec for 'vyfor/cord.nvim' is loading eagerly;
update the table entry for the plugin (the object containing 'vyfor/cord.nvim')
to include lazy-loading by adding event = "VeryLazy" (e.g., { 'vyfor/cord.nvim',
event = "VeryLazy" }) so the Discord presence is deferred until the VeryLazy
event and startup time improves; keep the same table shape and add any needed
config fields after adding the event key.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: c8196a41-c3f7-4dd0-b2ee-f1ab2bc098eb
📒 Files selected for processing (6)
lazy-lock.jsonlua/custom/plugins/init.lualua/custom/plugins/languages/markdown.lualua/keymaps.lualua/kickstart/plugins/cmp.lualua/options.lua
| init = function() | ||
| vim.api.nvim_create_user_command("MarkdownPreview", function() | ||
| vim.fn["mkdp#util#open_preview_page"]() | ||
| end, {}) | ||
| vim.api.nvim_create_user_command("MarkdownPreviewStop", function() | ||
| vim.fn["mkdp#util#stop_preview"]() | ||
| end, {}) | ||
| vim.api.nvim_create_user_command("MarkdownPreviewToggle", function() | ||
| vim.fn["mkdp#util#toggle_preview"]() | ||
| end, {}) | ||
| end, |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
markdown-preview.nvim built-in commands lazy.nvim
💡 Result:
The markdown-preview.nvim plugin (by iamcco) provides the following built-in commands: :MarkdownPreview - Start the preview in a browser. :MarkdownPreviewStop - Stop the preview. :MarkdownPreviewToggle - Toggle the preview on/off. It also exposes plugs for mappings: MarkdownPreview, MarkdownPreviewStop, MarkdownPreviewToggle. For lazy.nvim integration, use this spec (without yarn/npm): lua { "iamcco/markdown-preview.nvim", cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, ft = { "markdown" }, build = function vim.fn["mkdp#util#install"] end, } Or with yarn/npm: lua { "iamcco/markdown-preview.nvim", cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, build = "cd app && yarn install", init = function vim.g.mkdp_filetypes = { "markdown" } end, ft = { "markdown" }, } The cmd array makes these commands available only when loaded on-demand for markdown files.
Citations:
- 1: https://github.com/iamcco/markdown-preview.nvim/blob/master/README.md
- 2: https://github.com/iamcco/markdown-preview.nvim
Remove redundant command definitions and use lazy loading with cmd.
The markdown-preview.nvim plugin natively provides :MarkdownPreview, :MarkdownPreviewStop, and :MarkdownPreviewToggle commands. The current custom command definitions in init are redundant and will fail if invoked before a markdown file is opened (since init runs at startup but the plugin only loads when ft = "markdown").
Use cmd for proper lazy-loading:
Proposed fix
{
"iamcco/markdown-preview.nvim",
build = function()
vim.fn["mkdp#util#install"]()
end,
- ft = "markdown",
- init = function()
- vim.api.nvim_create_user_command("MarkdownPreview", function()
- vim.fn["mkdp#util#open_preview_page"]()
- end, {})
- vim.api.nvim_create_user_command("MarkdownPreviewStop", function()
- vim.fn["mkdp#util#stop_preview"]()
- end, {})
- vim.api.nvim_create_user_command("MarkdownPreviewToggle", function()
- vim.fn["mkdp#util#toggle_preview"]()
- end, {})
- end,
+ ft = { "markdown" },
+ cmd = { "MarkdownPreview", "MarkdownPreviewStop", "MarkdownPreviewToggle" },
},🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@lua/custom/plugins/languages/markdown.lua` around lines 27 - 37, The custom
init currently creates user commands (via vim.api.nvim_create_user_command) for
"MarkdownPreview", "MarkdownPreviewStop", and "MarkdownPreviewToggle" which is
redundant and can error because the plugin is filetype-lazy-loaded; remove those
vim.api.nvim_create_user_command blocks from init and instead declare the plugin
to lazy-load by command by adding cmd = { "MarkdownPreview",
"MarkdownPreviewStop", "MarkdownPreviewToggle" } to the plugin specification so
Neovim will load the plugin when any of those commands are invoked; keep the
init function only for truly necessary setup not related to these commands.
| ["<S-Tab>"] = function(fallback) | ||
| if cmp.visible() then | ||
| cmp.select_prev_item({ select = true }) | ||
| else | ||
| fallback() | ||
| end | ||
| end, |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
nvim-cmp select_prev_item select_next_item parameters API
💡 Result:
The nvim-cmp API provides cmp.select_next_item and cmp.select_prev_item functions, typically used within key mappings like cmp.mapping.select_next_item(options). These functions accept an optional table parameter with the following fields: - behavior: Specifies selection behavior. Values are cmp.SelectBehavior.Insert (inserts the text at cursor) or cmp.SelectBehavior.Select (selects the text, potentially adds ghost_text). Default is cmp.SelectBehavior (likely Insert based on usage). - count: Number of items to select (default: 1). Use a large number for page-like navigation (e.g., page down/up). Example usage in mappings: [''] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Select }), [''] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Select }), These are documented in the official doc/cmp.txt and source code (lua/cmp/types/cmp.lua). The functions are called via cmp.mapping.* wrappers in configuration, which handle fallback behavior.
Citations:
- 1: https://github.com/hrsh7th/nvim-cmp/blob/main/doc/cmp.txt
- 2: https://raw.githubusercontent.com/hrsh7th/nvim-cmp/main/doc/cmp.txt
- 3: https://git.mzte.de/nvim-plugins/nvim-cmp/src/branch/separate-view/lua/cmp/types/cmp.lua
🏁 Script executed:
# First, find the file and read the relevant lines with context
fd "cmp.lua" lua/Repository: samarth-na/nvim
Length of output: 88
🏁 Script executed:
# Read the file with line numbers focusing on the area around lines 79-85
cat -n lua/kickstart/plugins/cmp.lua | head -120 | tail -60Repository: samarth-na/nvim
Length of output: 2126
🏁 Script executed:
# Search for all occurrences of select_prev_item and select_next_item to see all usages
rg "select_(prev|next)_item" lua/kickstart/plugins/cmp.lua -n -A 2 -B 1Repository: samarth-na/nvim
Length of output: 611
Invalid parameter select passed to cmp.select_prev_item() and cmp.select_next_item().
The cmp.select_prev_item() and cmp.select_next_item() functions accept behavior and count parameters (e.g., { behavior = cmp.SelectBehavior.Select }), not select. The { select = true } argument will be silently ignored.
This issue appears in multiple locations:
- Line 81:
cmp.select_prev_item({ select = true })in["<S-Tab>"] - Line 97:
cmp.select_next_item({ select = true })in["<C-j>"] - Line 105:
cmp.select_prev_item({ select = true })in["<C-k>"]
Remove the parameter or replace with { behavior = cmp.SelectBehavior.Select } if the selection behavior is intentional.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@lua/kickstart/plugins/cmp.lua` around lines 79 - 85, The keymaps calling
cmp.select_prev_item() and cmp.select_next_item() (specifically the "<S-Tab>"
mapping using cmp.select_prev_item, the "<C-j>" mapping using
cmp.select_next_item, and the "<C-k>" mapping using cmp.select_prev_item) are
passing an invalid `{ select = true }` argument; remove that argument or replace
it with the proper behavior option `{ behavior = cmp.SelectBehavior.Select }` if
you intend to auto-select items. Update the three calls to either call the
functions with no parameter or with `{ behavior = cmp.SelectBehavior.Select }`
accordingly.
| ["<C-i>"] = function(fallback) | ||
| if cmp.visible() then | ||
| cmp.mapping.confirm({ select = true })() | ||
| else | ||
| fallback() | ||
| end | ||
| end, |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
neovim C-i Tab same key terminal
💡 Result:
In Neovim running in a terminal, the Tab key and Ctrl-I (C-i) send the same ASCII character (0x09), so they are indistinguishable by default. This causes conflicts, e.g., mapping <Tab> can shadow the default C-i jump list navigation. Modern Neovim (0.7+) automatically enables terminal features like CSI u or modifyOtherKeys (via :help tui-modifyOtherKeys tui-csiu) to distinguish them in supported terminals (kitty, Wezterm with CSI u enabled, iTerm2, etc.). See :help motion.txt under CTRL-I note. To use both separately: - Map both <Tab> and <C-i> explicitly, e.g.: nnoremap <Tab> :Tabnext<CR> nnoremap <C-i> <C-i> " Preserve default or remap - In Terminal mode (t), map both if needed: tnoremap <Tab> <Tab> tnoremap <C-i> <C-i> Test in insert mode: Ctrl-V then Tab vs Ctrl-V C-i. Different output means distinguishable. Caveats: tmux may interfere; older terminals don't support distinction.
Citations:
- 1: https://neovim.io/doc/user/motion/
- 2: https://github.com/neovim/neovim/blob/master/runtime/doc/motion.txt
- 3: https://neo.vimhelp.org/tui.txt.html
- 4: Mapping <Tab> while not mapping <C-i>, shadows the default key action on <C-i> neovim/neovim#20719
- 5: distinguish Tab, ctrl-i in Terminal mode neovim/neovim#22795
- 6: feat(tui): enable CSI u keys neovim/neovim#17771
- 7: https://unix.stackexchange.com/questions/563469/conflict-ctrl-i-with-tab-in-normal-mode
🏁 Script executed:
# First, let's check the file size and read the relevant section
wc -l lua/kickstart/plugins/cmp.luaRepository: samarth-na/nvim
Length of output: 92
🏁 Script executed:
# Read the file around the mentioned lines to understand the full context
head -n 110 lua/kickstart/plugins/cmp.lua | tail -n 50Repository: samarth-na/nvim
Length of output: 1278
🏁 Script executed:
# Search for all Tab-related mappings in this file
rg -n "Tab|tab|C-i|C-I" lua/kickstart/plugins/cmp.luaRepository: samarth-na/nvim
Length of output: 330
Remove the redundant <C-i> mapping or use a different key.
In most terminal emulators without modern terminal support (CSI u / modifyOtherKeys), <Tab> and <C-i> send the same key code, causing one mapping to shadow the other. Even in modern terminals that distinguish them, having both mappings with identical behavior (confirming completion when visible) is redundant and confusing. Keep <Tab> since it's more discoverable, and either remove <C-i> or assign it a different action if needed.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@lua/kickstart/plugins/cmp.lua` around lines 87 - 93, Remove the redundant
"<C-i>" key mapping in the cmp setup: locate the mapping that binds ["<C-i>"] to
the function that checks cmp.visible() and calls cmp.mapping.confirm({ select =
true })() or fallback(), and either delete that mapping entry entirely or change
it to a different, intentional key/action; keep the existing "<Tab>" mapping as
the primary confirm behavior to avoid terminal keycode collisions and ensure
only one key handles completion confirmation.
| ["<C-j>"] = function(fallback) | ||
| if cmp.visible() then | ||
| cmp.select_next_item({ select = true }) | ||
| else | ||
| fallback() | ||
| end | ||
| end, |
There was a problem hiding this comment.
Invalid parameter select passed to cmp.select_next_item().
Same issue as <S-Tab> - the select parameter is not recognized by this function.
Proposed fix
["<C-j>"] = function(fallback)
if cmp.visible() then
- cmp.select_next_item({ select = true })
+ cmp.select_next_item()
else
fallback()
end
end,🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@lua/kickstart/plugins/cmp.lua` around lines 95 - 101, The mapping for "<C-j>"
uses an invalid parameter { select = true } when calling cmp.select_next_item;
update the function to call cmp.select_next_item() without the unsupported
argument (mirror the fix used for the "<S-Tab>" mapping), so inside the
anonymous function replace cmp.select_next_item({ select = true }) with
cmp.select_next_item().
| ["<C-k>"] = function(fallback) | ||
| if cmp.visible() then | ||
| cmp.select_prev_item({ select = true }) | ||
| else | ||
| fallback() | ||
| end | ||
| end, |
There was a problem hiding this comment.
Same invalid parameter issue for <C-k> mapping.
Proposed fix
["<C-k>"] = function(fallback)
if cmp.visible() then
- cmp.select_prev_item({ select = true })
+ cmp.select_prev_item()
else
fallback()
end
end,📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ["<C-k>"] = function(fallback) | |
| if cmp.visible() then | |
| cmp.select_prev_item({ select = true }) | |
| else | |
| fallback() | |
| end | |
| end, | |
| ["<C-k>"] = function(fallback) | |
| if cmp.visible() then | |
| cmp.select_prev_item() | |
| else | |
| fallback() | |
| end | |
| end, |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@lua/kickstart/plugins/cmp.lua` around lines 103 - 109, The "<C-k>" mapping
passes an invalid opts object to cmp.select_prev_item; replace the incorrect {
select = true } with the proper nvim-cmp option object, e.g., use { behavior =
cmp.SelectBehavior.Select } when calling cmp.select_prev_item inside the "<C-k>"
mapping so it matches the cmp API (reference cmp.select_prev_item and
cmp.SelectBehavior in the mapping).
Summary by CodeRabbit
New Features
Updates