Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

VIM newbie here. I'm trying to write a mapping that will let me move around 'common' insertion points in a line when in insert mode. For ex. I have the delimitMate plugin - so typing a opening delimiter automatically closes the delimiter and puts me in between. once I've typed the text that goes inside, I usually want to jump to the end of the delimiter and stay in insert mode. Taking this forward, for a function like below

 $("#someid").live("someevent", function (param1, param2) {

What I'd like is a insert mode mapping that lets me jump to after the first of any of the following delimiter chars (quote, double quote, parens, and/or EOL) and cycle over these points.

Checked VIM documentation for search - the \%l operator allows to restrict over a specific line number. I tried \%.l (. being current line ) - but this doesn't work. Any ideas?


:exe  "/\\%" . line(".") . "l[{}()\"':=\\[\\],]"

seems to work - but doesnt move the cursor to the match.

share|improve this question
up vote 1 down vote accepted

Got this to work with the following.

inoremap <C-e> <C-o>:call search("\\%" . line(".") . "l[{}():=\\[\\]\.,]","We")<cr>

This moves the cursor to the matches on the current line, but there are two things that don't work well:

  1. there's a long pause everytime I hit the key
  2. It drops me in Ins mode before the matching character instead of after as I'd like.
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.