Skip to content

backspace joins the previous lines#9

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

backspace joins the previous lines#9
NalinDalal wants to merge 6 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 Markdown preview with commands and a mp shortcut
    • Added code-assist (opencode) and registered new plugins (cord, lazydev)
  • Updates

    • Refreshed pinned plugin versions (lockfile update)
    • Improved completion behavior for Tab/S-Tab/C-j/C-k and Enter in insert mode
    • Backspace now handles start, indent, and eol
    • LSP: enabled TypeScript language server in installer and removed legacy tsgo config

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 24, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 53fa5f35-bcde-45f8-9ce4-c07986872498

📥 Commits

Reviewing files that changed from the base of the PR and between 3f1d745 and d482968.

📒 Files selected for processing (5)
  • lua/custom/plugins/ai.lua
  • lua/custom/plugins/init.lua
  • lua/custom/plugins/languages/markdown.lua
  • lua/kickstart/plugins/cmp.lua
  • lua/options.lua
🚧 Files skipped from review as they are similar to previous changes (4)
  • lua/options.lua
  • lua/custom/plugins/init.lua
  • lua/kickstart/plugins/cmp.lua
  • lua/custom/plugins/ai.lua

📝 Walkthrough

Walkthrough

Updated plugin lockfile pins and added two new lock entries; registered vyfor/cord.nvim and added nickjvandyke/opencode.nvim; added markdown-preview plugin and a keymap; made completion mappings visibility-aware; set backspace and autoread options; 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 with event = "VeryLazy".
AI / opencode plugin
lua/custom/plugins/ai.lua
Added nickjvandyke/opencode.nvim with config to set vim.g.opencode_opts and multiple keymaps/commands.
Markdown preview & keymap
lua/custom/plugins/languages/markdown.lua, lua/keymaps.lua
Added iamcco/markdown-preview.nvim (ft = "markdown") with build step and user commands (:MarkdownPreview, :MarkdownPreviewStop, :MarkdownPreviewToggle); mapped <leader>mp to :MarkdownPreview.
Completion mappings
lua/kickstart/plugins/cmp.lua
Adjusted completion keybindings to be visibility-aware: conditional behaviors for <Tab>, <S-Tab>, <C-j>, <C-k>; <CR> remains confirm.
Editor options
lua/options.lua
Set vim.opt.backspace = "start,indent,eol" and enabled vim.opt.autoread = true.
LSP config changes
lua/kickstart/plugins/lspconfig.lua
Added ts_ls to mason-lspconfig.ensure_installed; removed explicit tsgo configuration and updated the Deno-vs-Node client ignore logic.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

🐰
I hop through pins and tidy tracks,
A preview lights the markdown stacks,
Tabs now peek before they press,
Backspace nibbles with finesse,
Small hops, new plugins — joyous snacks! 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title 'backspace joins the previous lines' refers to only one change in the changeset (backspace behavior in options.lua), but the PR includes extensive updates to dependency locks, plugin configurations, keymaps, completion settings, and LSP configuration—making the title overly narrow and not representative of the main scope. Consider using a more comprehensive title that reflects the primary changes, such as 'Update dependencies and plugin configurations' or splitting into multiple focused PRs.
✅ 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 thread lua/custom/plugins/languages/markdown.lua Outdated
Comment thread lua/kickstart/plugins/cmp.lua Outdated
Comment thread lua/kickstart/plugins/cmp.lua Outdated
Comment thread lua/kickstart/plugins/cmp.lua
Comment thread lua/kickstart/plugins/cmp.lua
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: 1

🧹 Nitpick comments (2)
lua/custom/plugins/ai.lua (2)

41-41: Keep global editor options out of plugin-local config

Line 41 mutates a global option (autoread) as a side effect of loading this plugin. It’s cleaner and more predictable to keep this in your central options file.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lua/custom/plugins/ai.lua` at line 41, Remove the side-effect that sets the
global editor option from the plugin config: delete the vim.o.autoread = true
line from lua/custom/plugins/ai.lua (the vim.o.autoread symbol) and instead set
autoread in your central editor options file (where you manage global
vim.opt/vim.o settings) so plugin loading does not mutate global state.

47-48: Avoid overriding native go motion for plugin actions

Line 47 and Line 48 replace built-in go behavior in normal mode. This is high-friction for Vim users and can break muscle memory/plugin expectations.

Suggested fix
-			vim.keymap.set({ "n", "x" }, "go", function() return require("opencode").operator("@this ") end, { desc = "Add range to opencode", expr = true })
-			vim.keymap.set("n", "goo", function() return require("opencode").operator("@this ") .. "_" end, { desc = "Add line to opencode", expr = true })
+			vim.keymap.set({ "n", "x" }, "<leader>or", function() return require("opencode").operator("@this ") end, { desc = "Add range to opencode", expr = true })
+			vim.keymap.set("n", "<leader>ol", function() return require("opencode").operator("@this ") .. "_" end, { desc = "Add line to opencode", expr = true })
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lua/custom/plugins/ai.lua` around lines 47 - 48, The mappings override Vim's
native "go" motion; update the vim.keymap.set calls that bind "go" and "goo" so
they do not shadow built-in motions — e.g., change the keys to a non-conflicting
prefix like "<leader>go" and "<leader>goo" (or another chosen combo) for the
functions that call require("opencode").operator("@this "), keeping the same
options ({ desc = "...", expr = true }) and leaving the operator invocation
(require("opencode").operator) unchanged so the behavior is preserved without
replacing the native "go" motion.
🤖 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/ai.lua`:
- Line 44: The mapping vim.keymap.set({ "n", "x" }, "<C-x>", function()
require("opencode").select() end) conflicts with the existing core <C-x>
buffer-delete mapping defined in lua/keybinds.lua; change this opencode mapping
to a non-conflicting key (e.g., use a leader-prefixed combo like "<leader>o" or
"<leader>oc") or make it buffer-local/conditional (check for an existing mapping
before setting) so both actions remain reachable; update the mapping site in
lua/custom/plugins/ai.lua by replacing the "<C-x>" binding for
require("opencode").select() accordingly.

---

Nitpick comments:
In `@lua/custom/plugins/ai.lua`:
- Line 41: Remove the side-effect that sets the global editor option from the
plugin config: delete the vim.o.autoread = true line from
lua/custom/plugins/ai.lua (the vim.o.autoread symbol) and instead set autoread
in your central editor options file (where you manage global vim.opt/vim.o
settings) so plugin loading does not mutate global state.
- Around line 47-48: The mappings override Vim's native "go" motion; update the
vim.keymap.set calls that bind "go" and "goo" so they do not shadow built-in
motions — e.g., change the keys to a non-conflicting prefix like "<leader>go"
and "<leader>goo" (or another chosen combo) for the functions that call
require("opencode").operator("@this "), keeping the same options ({ desc =
"...", expr = true }) and leaving the operator invocation
(require("opencode").operator) unchanged so the behavior is preserved without
replacing the native "go" motion.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3855f602-f506-47fd-9643-ba5305eba992

📥 Commits

Reviewing files that changed from the base of the PR and between 5986452 and 3f1d745.

📒 Files selected for processing (2)
  • lazy-lock.json
  • lua/custom/plugins/ai.lua
🚧 Files skipped from review as they are similar to previous changes (1)
  • lazy-lock.json

Comment thread lua/custom/plugins/ai.lua Outdated
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