1

One can make e/ produce é with inoremap e/ é; but this only works if / is typed before timeoutlen seconds have passed. Is there a way to make / after e produce the same result, regardless of the time elapsed? The bare e should be visible after timeout, but changed if a / is entered.

Toothrot
  • 3,129
  • 13
  • 27
  • 2
    Disable timeouts, while showing already typed letters to Vim's bottom-right: set showcmd notimeout nottimeout. – VanLaser May 07 '16 at 17:31

1 Answers1

1

You could use something like this:

function! s:accent_e()
  if getline('.') =~# 'e/$'
    call feedkeys("\<bs>\<bs>é")
  endif
endfunction

autocmd! TextChangedI * call s:accent_e()

However, that doesn't seem like a good solution. You'll end up needing a way to disable it if you want to type path components that end with an e since i_CTRL-V wouldn't help with the method above. Have you looked at :help digraph and :help i_CTRL-K? In insert mode you can type Ctrl-Ke' to get é.

A few other examples:

Ctrl-Ke! = è

Ctrl-Ke: = ë

etc.

Using Ctrl-K, not only will you be deliberate with the character entry, you'll have all the time you need.

Tommy A
  • 6,770
  • 22
  • 36