Skip to content

Migrate to Neovim 0.11.5 API compatibility#8

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/migrate-neovim-config-0-11-5
Draft

Migrate to Neovim 0.11.5 API compatibility#8
Copilot wants to merge 2 commits intomainfrom
copilot/migrate-neovim-config-0-11-5

Conversation

Copy link

Copilot AI commented Dec 6, 2025

Updates configuration to use Neovim 0.11.5 APIs, replacing deprecated functions and fixing strict event name validation.

Critical API Updates

Diagnostic navigation - Deprecated goto_prev/next replaced with jump():

-- Before
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic' })

-- After
vim.keymap.set('n', '[d', function() vim.diagnostic.jump({ count = -1 }) end, { desc = 'Go to previous diagnostic' })

LSP client method checking - New signature requires buffer parameter:

-- Before
if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight) then

// After
if client and client:supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight, event.buf) then

vim.loop deprecation - Replaced with vim.uv:

-- Before: if not (vim.uv or vim.loop).fs_stat(lazypath) then
-- After:  if not vim.uv.fs_stat(lazypath) then

Event Name Case Sensitivity

Fixed 6 occurrences across treesitter, lspconfig, utility, and ui plugins:

  • bufReadBufRead
  • insertEnterInsertEnter

Configuration Cleanup

  • Removed deprecated setup key from go.nvim (already handled by config)
  • Removed invalid gitsigns keys (unstaged, normal, default), added proper signs_staged
  • Fixed treesitter keymap conflict: <c-i><c-s> for scope_incremental (avoids Tab collision)
  • Deduplicated cmp dependencies (4 duplicates removed)
  • Moved neocord setup from manual require().setup() to lazy.nvim opts pattern
  • Added missing lspDiagnosticsVisible variable declaration
  • Removed duplicate diagnostic keymaps
  • Deleted temporary file madux28mhk.tmp

Documentation

  • Added Neovim 0.11.5+ requirement to README
  • Added version compatibility comment to options.lua

Net: 14 files changed, -12 lines (cleaner structure)

Original prompt

Migrate Neovim Configuration to Neovim 0.11.5

Overview

This Neovim configuration needs to be migrated to be fully compatible with Neovim 0.11.5. The migration requires addressing deprecated APIs, updated function signatures, and taking advantage of new built-in features.

Required Changes

1. Diagnostic API Changes (CRITICAL)

Files affected: lua/keymaps.lua

The vim.diagnostic.goto_prev() and vim.diagnostic.goto_next() functions are deprecated in Neovim 0.11. Replace with the new vim.diagnostic.jump() API:

-- OLD (deprecated):
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous [D]iagnostic message' })
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next [D]iagnostic message' })

-- NEW (0.11.5 compatible):
vim.keymap.set('n', '[d', function() vim.diagnostic.jump({ count = -1 }) end, { desc = 'Go to previous [D]iagnostic message' })
vim.keymap.set('n', ']d', function() vim.diagnostic.jump({ count = 1 }) end, { desc = 'Go to next [D]iagnostic message' })

Note: These keymaps appear twice in keymaps.lua (lines 7-8 and 45-46) - remove the duplicate.

2. vim.loop Deprecation (CRITICAL)

Files affected: lua/lazy-bootstrap.lua

Replace vim.loop with vim.uv:

-- OLD:
if not (vim.uv or vim.loop).fs_stat(lazypath) then

-- NEW (cleaner for 0.11.5):
if not vim.uv.fs_stat(lazypath) then

3. Event Name Case Sensitivity (CRITICAL)

Files affected: Multiple files

Neovim 0.11 is stricter about event name casing. Fix these:

  • lua/kickstart/plugins/treesitter.lua: event = 'bufRead'event = 'BufRead'
  • lua/kickstart/plugins/lspconfig.lua: event = "bufRead" in dependencies → event = "BufRead"
  • lua/custom/plugins/utility.lua: event = "insertEnter"event = "InsertEnter"
  • lua/custom/plugins/ui.lua: event = "bufRead"event = "BufRead" (multiple occurrences)

4. LSP Client API Updates

Files affected: lua/kickstart/plugins/lspconfig.lua

Update the LSP client method checking to use the new 0.11 API:

-- OLD:
local client = vim.lsp.get_client_by_id(event.data.client_id)
if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight) then

-- NEW (0.11.5 compatible - supports_method now takes buffer):
local client = vim.lsp.get_client_by_id(event.data.client_id)
if client and client:supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight, event.buf) then

Also update the inlay hints check:

-- OLD:
if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint) then

-- NEW:
if client and client:supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint, event.buf) then

5. Remove Deprecated Plugin Setup Pattern

Files affected: lua/custom/plugins/languages/go.lua

The setup key in lazy.nvim plugin specs is not valid - remove it:

-- REMOVE this line:
setup = function()
    require("go").setup()
end,

The config function already handles setup.

6. Native Snippet Expansion (Optional Enhancement)

Files affected: lua/kickstart/plugins/cmp.lua

Neovim 0.11 has improved native snippet support. The current LuaSnip setup works, but you can optionally use the native vim.snippet.expand() as a fallback.

7. Options Updates

Files affected: lua/options.lua

Some options have new defaults in 0.11. Review and explicitly set if needed:

  • vim.opt.termguicolors is now true by default
  • vim.opt.smoothscroll is available

Add comment noting Neovim version compatibility:

-- Neovim 0.11.5 compatible configuration

8. Gitsigns Configuration Update

Files affected: lua/kickstart/plugins/git.lua

The signs table has some keys that aren't standard gitsigns options (unstaged, normal, default). Clean up:

opts = {
    signs = {
        add = { text = '+' },
        change = { text = '~' },
        delete = { text = '_' },
        topdelete = { text = '' },
        changedelete = { text = '~' },
    },
    signs_staged = {
        add = { text = '' },
        change = { text = '' },
        delete = { text = '_' },
        topdelete = { text = '' },
        changedelete = { text = '~' },
    },
},

9. Which-key 0.11 Compatibility

Files affected: lua/custom/plugins/ui.lua

The which-key setup looks correct for the newer version, but ensure it uses the add() method properly which it does.

10. Treesitter Incremental Selection

Files affected: lua/kickstart/plugins/treesitter.lua

The incremental selection keymaps are correct, but <c-i> for scope_incremental conflicts with Tab in terminal. Consider changing:

scope_incremental = '<c-s>', -- Changed from <c-i> to avoid Tab conflict

11. Clean Up Duplicate Dependencies

Files affected: lua/kickstart/plugins/cmp.lua

Remove duplicate dependencies in the cmp setup:

  • L3MON4D3/LuaSnip appears twice
  • `saadparwaiz1/cmp_luas...

This pull request was created as a result of the following prompt from Copilot chat.

Migrate Neovim Configuration to Neovim 0.11.5

Overview

This Neovim configuration needs to be migrated to be fully compatible with Neovim 0.11.5. The migration requires addressing deprecated APIs, updated function signatures, and taking advantage of new built-in features.

Required Changes

1. Diagnostic API Changes (CRITICAL)

Files affected: lua/keymaps.lua

The vim.diagnostic.goto_prev() and vim.diagnostic.goto_next() functions are deprecated in Neovim 0.11. Replace with the new vim.diagnostic.jump() API:

-- OLD (deprecated):
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous [D]iagnostic message' })
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next [D]iagnostic message' })

-- NEW (0.11.5 compatible):
vim.keymap.set('n', '[d', function() vim.diagnostic.jump({ count = -1 }) end, { desc = 'Go to previous [D]iagnostic message' })
vim.keymap.set('n', ']d', function() vim.diagnostic.jump({ count = 1 }) end, { desc = 'Go to next [D]iagnostic message' })

Note: These keymaps appear twice in keymaps.lua (lines 7-8 and 45-46) - remove the duplicate.

2. vim.loop Deprecation (CRITICAL)

Files affected: lua/lazy-bootstrap.lua

Replace vim.loop with vim.uv:

-- OLD:
if not (vim.uv or vim.loop).fs_stat(lazypath) then

-- NEW (cleaner for 0.11.5):
if not vim.uv.fs_stat(lazypath) then

3. Event Name Case Sensitivity (CRITICAL)

Files affected: Multiple files

Neovim 0.11 is stricter about event name casing. Fix these:

  • lua/kickstart/plugins/treesitter.lua: event = 'bufRead'event = 'BufRead'
  • lua/kickstart/plugins/lspconfig.lua: event = "bufRead" in dependencies → event = "BufRead"
  • lua/custom/plugins/utility.lua: event = "insertEnter"event = "InsertEnter"
  • lua/custom/plugins/ui.lua: event = "bufRead"event = "BufRead" (multiple occurrences)

4. LSP Client API Updates

Files affected: lua/kickstart/plugins/lspconfig.lua

Update the LSP client method checking to use the new 0.11 API:

-- OLD:
local client = vim.lsp.get_client_by_id(event.data.client_id)
if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight) then

-- NEW (0.11.5 compatible - supports_method now takes buffer):
local client = vim.lsp.get_client_by_id(event.data.client_id)
if client and client:supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight, event.buf) then

Also update the inlay hints check:

-- OLD:
if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint) then

-- NEW:
if client and client:supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint, event.buf) then

5. Remove Deprecated Plugin Setup Pattern

Files affected: lua/custom/plugins/languages/go.lua

The setup key in lazy.nvim plugin specs is not valid - remove it:

-- REMOVE this line:
setup = function()
    require("go").setup()
end,

The config function already handles setup.

6. Native Snippet Expansion (Optional Enhancement)

Files affected: lua/kickstart/plugins/cmp.lua

Neovim 0.11 has improved native snippet support. The current LuaSnip setup works, but you can optionally use the native vim.snippet.expand() as a fallback.

7. Options Updates

Files affected: lua/options.lua

Some options have new defaults in 0.11. Review and explicitly set if needed:

  • vim.opt.termguicolors is now true by default
  • vim.opt.smoothscroll is available

Add comment noting Neovim version compatibility:

-- Neovim 0.11.5 compatible configuration

8. Gitsigns Configuration Update

Files affected: lua/kickstart/plugins/git.lua

The signs table has some keys that aren't standard gitsigns options (unstaged, normal, default). Clean up:

opts = {
    signs = {
        add = { text = '+' },
        change = { text = '~' },
        delete = { text = '_' },
        topdelete = { text = '' },
        changedelete = { text = '~' },
    },
    signs_staged = {
        add = { text = '' },
        change = { text = '' },
        delete = { text = '_' },
        topdelete = { text = '' },
        changedelete = { text = '~' },
    },
},

9. Which-key 0.11 Compatibility

Files affected: lua/custom/plugins/ui.lua

The which-key setup looks correct for the newer version, but ensure it uses the add() method properly which it does.

10. Treesitter Incremental Selection

Files affected: lua/kickstart/plugins/treesitter.lua

The incremental selection keymaps are correct, but <c-i> for scope_incremental conflicts with Tab in terminal. Consider changing:

scope_incremental = '<c-s>', -- Changed from <c-i> to avoid Tab conflict

11. Clean Up Duplicate Dependencies

Files affected: lua/kickstart/plugins/cmp.lua

Remove duplicate dependencies in the cmp setup:

  • L3MON4D3/LuaSnip appears twice
  • saadparwaiz1/cmp_luasnip appears twice
  • hrsh7th/cmp-nvim-lsp appears twice
  • hrsh7th/cmp-path appears twice

12. Update README

Files affected: README.md

Add Neovim version requirement:

## Requirements
- **Neovim 0.11.5+** (required for this configuration)

13. Remove Temporary File

Files affected: Root directory

Delete madux28mhk.tmp - this appears to be a temporary file that was accidentally committed.

14. Fix Missing Variable Declaration

Files affected: lua/keymaps.lua

The lspDiagnosticsVisible variable is used without being declared:

-- Add at the top of the file or before the toggle function:
local lspDiagnosticsVisible = true

15. Neocord Setup Location

Files affected: lua/lazy-plugins.lua

Move the neocord setup into the plugin spec in lua/custom/plugins/nalin.lua instead of calling it directly in lazy-plugins.lua. This is better practice for lazy.nvim:

In lua/custom/plugins/nalin.lua, update the neocord entry:

{
    'IogaMaster/neocord',
    event = "VeryLazy",
    opts = {
        logo = "auto",
        logo_tooltip = nil,
        main_image = "language",
        client_id = "1157438221865717891",
        log_level = nil,
        debounce_timeout = 10,
        blacklist = {},
        file_assets = {},
        show_time = true,
        global_timer = false,
        editing_text = "Editing %s",
        file_explorer_text = "Browsing %s",
        git_commit_text = "Committing changes",
        plugin_manager_text = "Managing plugins",
        reading_text = "Reading %s",
        workspace_text = "Working on %s",
        line_number_text = "Line %s out of %s",
        terminal_text = "Using Terminal",
    },
},

Then remove the require("neocord").setup({...}) block from lua/lazy-plugins.lua.

Testing Checklist

After migration, verify:

  • nvim starts without errors
  • :checkhealth shows no critical issues
  • LSP attaches correctly to files
  • Diagnostics navigation ([d and ]d) works
  • Telescope functions work
  • Treesitter highlighting works
  • Autocompletion works
  • Format on save works
  • Git signs appear

Additional Notes

  • All deprecated APIs should be replaced with their modern equivalents
  • The configuration should work on Neovim 0.11.5 and be forward-compatible with future versions
  • Remove any debug/temporary files from the repository

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: samarth-na <110125971+samarth-na@users.noreply.github.com>
Copilot AI changed the title [WIP] Migrate Neovim configuration to version 0.11.5 Migrate to Neovim 0.11.5 API compatibility Dec 6, 2025
Copilot AI requested a review from samarth-na December 6, 2025 15:06
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.

2 participants