Skip to content

backspace joins the previous lines#9

Open
NalinDalal wants to merge 4 commits intosamarth-na:mainfrom
NalinDalal:main
Open

backspace joins the previous lines#9
NalinDalal wants to merge 4 commits intosamarth-na:mainfrom
NalinDalal:main

Conversation

@NalinDalal
Copy link
Copy Markdown
Contributor

@NalinDalal NalinDalal commented Mar 24, 2026

Summary by CodeRabbit

  • New Features

    • Added Discord presence plugin
    • Added Markdown preview with commands and keyboard shortcut
  • Updates

    • Refreshed pinned plugin versions (lockfile update) and added a couple new plugins
    • Improved completion Tab/Ctrl-i/Shift-Tab behavior in insert mode
    • Adjusted Backspace to handle start/indent/eol
    • LSP tweaks: enabled ts language server in installer and removed legacy tsgo config

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a7e3099d-b9d4-4033-83b6-d65d4f1f73c3

📥 Commits

Reviewing files that changed from the base of the PR and between 6519f97 and 5986452.

📒 Files selected for processing (2)
  • lazy-lock.json
  • lua/kickstart/plugins/lspconfig.lua

📝 Walkthrough

Walkthrough

Updated plugin lockfile entries and added two plugins; registered vyfor/cord.nvim; added markdown-preview plugin with commands and keymap; changed completion key mappings to be completion-visible aware; set explicit backspace option; adjusted TypeScript LSP entries and removed tsgo config.

Changes

Cohort / File(s) Summary
Lockfile
lazy-lock.json
Updated many plugin commit pins; added lock entries for cord.nvim and lazydev.nvim.
Custom plugins registration
lua/custom/plugins/init.lua
Registered vyfor/cord.nvim in custom plugins list.
Markdown preview & keymap
lua/custom/plugins/languages/markdown.lua, lua/keymaps.lua
Added iamcco/markdown-preview.nvim (ft = "markdown") with build step; created :MarkdownPreview, :MarkdownPreviewStop, :MarkdownPreviewToggle; mapped <leader>mp to :MarkdownPreview.
Completion mappings
lua/kickstart/plugins/cmp.lua
Made completion keybindings visibility-aware (<Tab>, <C-i>, <S-Tab>, <C-j>, <C-k>); <CR> still confirms.
Editor option
lua/options.lua
Set vim.opt.backspace = "start,indent,eol".
LSP config changes
lua/kickstart/plugins/lspconfig.lua
Added ts_ls to mason-lspconfig ensure list; removed tsgo explicit configuration and adjusted Deno/Node client ignore logic.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

🐰
I scurry through pins, a tidy chore,
A preview blooms beside the door,
Tabs obey when completions soar,
Backspace nibbles as before,
Small hops, big tidy—cheer and more! 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title 'backspace joins the previous lines' refers only to the backspace configuration change in lua/options.lua, which is a minor single-line modification, while the PR contains significant changes to plugins, keymaps, completion behavior, and LSP configuration. Update the title to reflect the main changes, such as 'Add markdown preview and cord plugins with LSP/completion improvements' or 'Add markdown preview and cord plugins, update dependencies'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🧹 Nitpick comments (1)
lua/custom/plugins/init.lua (1)

5-7: Consider adding lazy-loading for cord.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

📥 Commits

Reviewing files that changed from the base of the PR and between 9bc8a6d and 1a1f2ef.

📒 Files selected for processing (6)
  • lazy-lock.json
  • lua/custom/plugins/init.lua
  • lua/custom/plugins/languages/markdown.lua
  • lua/keymaps.lua
  • lua/kickstart/plugins/cmp.lua
  • lua/options.lua

Comment on lines +27 to +37
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,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 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:


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.

Comment on lines +79 to +85
["<S-Tab>"] = function(fallback)
if cmp.visible() then
cmp.select_prev_item({ select = true })
else
fallback()
end
end,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 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:


🏁 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 -60

Repository: 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 1

Repository: 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.

Comment on lines +87 to +93
["<C-i>"] = function(fallback)
if cmp.visible() then
cmp.mapping.confirm({ select = true })()
else
fallback()
end
end,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 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:


🏁 Script executed:

# First, let's check the file size and read the relevant section
wc -l lua/kickstart/plugins/cmp.lua

Repository: 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 50

Repository: 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.lua

Repository: 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.

Comment on lines +95 to +101
["<C-j>"] = function(fallback)
if cmp.visible() then
cmp.select_next_item({ select = true })
else
fallback()
end
end,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

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().

Comment on lines +103 to +109
["<C-k>"] = function(fallback)
if cmp.visible() then
cmp.select_prev_item({ select = true })
else
fallback()
end
end,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

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.

Suggested change
["<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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant