UltiSnips and insert mode mappings
Asked by
Thiago A.
Hi,
Congratulations for UltiSnips. I've got some simple insert mode mappings that don't work when I'm typing in the placeholders. For example:
inoremap <expr> ' g:InsertPair("'")
inoremap <expr> " g:InsertPair('"')
function! g:InsertPair(char)
let next_char = strpart(
let char_is_rightside = next_char == a:char
if char_is_rightside
return "\<Right>"
else
return a:char . a:char . "\<Left>"
endif
endfunction
These mappings do not work when I'm expanding a snippet. Is there any fix for it?
Thanks and keep up the good work.
- Thiago
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- UltiSnips Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Thiago A. for more information if necessary.
To post a message you must log in.