0

New to vim. Using Dvorak layout. Trying to remap the move_selection_{next,previous} to t for next and c for previous, to match my text editing mappings. Here's the code:

  {
    "nvim-telescope/telescope.nvim",
    keys = {
      -- add a keymap to browse plugin files
      -- stylua: ignore
      {
        "<leader>fp",
        function() require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root }) end,
        desc = "Find Plugin File",
      },
    },
    -- change some options
    opts = {
      defaults = {
        layout_strategy = "horizontal",
        layout_config = { prompt_position = "top" },
        sorting_strategy = "ascending",
        winblend = 0,
      },
      mappings = {
        n = {
          ["t"] = require("telescope.actions").move_selection_next,
          ["c"] = require("telescope.actions").move_selection_previous,
        },
      },
    },
  },

This just doesn't work.

It acts the same regardless of weather I specify the mappings or not. When I press t, it opens the highlighted file in fullscreen (with the telescope window hidden), and on c it says "copy <filename> to: <enter-name>". This is especially weird because I've looked at the default telescope mappings and there aren't any for these keys. If there's some global action on top of telescope mapped to these keys, then why do they work correctly when I'm just editing a file?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.