Skip to content

Ambiguity of snippets keymap #99

@LittleNewton

Description

@LittleNewton
["<c-e>"] = cmp.mapping(
    function()
        cmp_ultisnips_mappings.compose { "expand", "jump_forwards" } (function() end)
    end,
    { "i", "s", --[[ "c" (to enable the mapping in command mode) ]] }
),

In autocomplete.lua, there is ambiguity.


Now I have a snippet:

snippet head "Head of Hexo Blogs"
title: ${1:title}
author: Peng Liu
cover: /images/`!p import os
base_name, _ = os.path.splitext(snip.fn)
snip.rv = base_name`/cover.png
date: `date +"%Y-%m-%d %H:%M:%S"`
tags:
	- ${2:tag}
categories:
	- ${3:type}
---

And another short snippet:

snippet aj "Markdown keyboard" i
<kbd>${1:key}</kbd>
endsnippet

The first snippet contains multiple placeholders.

In the first snippet instance, if I type aj with the intention of keyboard typing, the push of Ctrl e will have two different meanings:

  • expand aj
  • or jump-forward to the next placeholder.

I wanted it to take the expansion action but now it does nothing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions