mattn / mattn/emmet-vim

Tab completion conflicts with emmet-vim

Open
#464 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Vim Script
Stars
6.5k
Forks
414
PR merge metrics
No merged PRs in 30d

Description

is it possible to fix this?
Whe I try to create <Text></Text> tag:
Tex<tab> and then <C-e>, prints <Tex></Tex>
(C-e is my emmet key trigger)

Process explanation:

  • Type Tex<tab>(autocompletes "Text" but vim opens a list menu at the cursor with many other options to complete that exists on my codebase, for example: TextView).
  • Selects "Text" at the menu using CTRL-N.
  • Now I have Text autocompleted but the menu is still open and then I trigger emmet using <C-e>, and my output is <Tex></Tex>.

I also have this mapping on my vimrc:

" Tab completion
" will insert tab at beginning of line,
" will use completion if not at beginning
set wildmode=list:longest,list:full
function! InsertTabWrapper()
    let col = col('.') - 1
    if !col || getline('.')[col - 1] !~ '\k'
        return "\<Tab>"
    else
        return "\<C-p>"
    endif
endfunction
inoremap <Tab> <C-r>=InsertTabWrapper()<CR>

Any ideas? Thanks!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the conflict using the reported InsertTabWrapper mapping, the Tex completion flow, and the emmet C-e trigger. Trace how the completion menu remains active when emmet expands the tag; done means the selected Text completion expands as without breaking either workflow.

Written by the indexing model from the issue text.

Assessment

Tech stack
html, vim
Domain
tooling, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.