Skip to content

Migrating from Plugin.config to Plugin.opts #1082

Answered by folke
Syphdias asked this question in Q&A
Discussion options

You must be logged in to vote

As the message says, config as a table is deprecated. Use opts instead for this:

return {
  "nvim-neo-tree/neo-tree.nvim",
  opts = {
    window = {
      mappings = {
        ["l"] = "open",
        ["h"] = "close_node",
      },
    },
  },
}

The same for telescope.

However, you also need to make sure to use proper closures, otherwise you're loading telescope in the spec itself. Which is not somhing you want.

["<C-k>"] = function(...)
  return require("telescope.actions").move_selection_previous(...)
end

keys is something that lazy supports. mappings is a telescope option, unrelated to lazy

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@Syphdias
Comment options

Answer selected by Syphdias
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants