Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 949189
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:21:59+00:00 2026-05-15T23:21:59+00:00

is there some way to tell VIM place the cursor at some position after

  • 0

is there some way to tell VIM place the cursor at some position after abbreviation expansion?
Say you have something like this in .gvimrc

iabberv <? <?=|?> 

and you want to place cursor where pipe character is automatically.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T23:22:00+00:00Added an answer on May 15, 2026 at 11:22 pm

    A quick solution that I’d use in this case is to insert some key presses to the abbreviation:

    iabbrev <? <?=?><Left><Left>
    

    Would place the cursor two places left, after the =.

    In this manner, you can use various movement keys such as <End>, <Home>, or even return to normal mode with <Esc> and command usual normal-mode commands. The example would then be

    iabbrev <? <?=?><Esc>hha
    

    and it does the same as the first example. If you expand an abbreviation with space, it will have one extra space. which you can get rid of by using a <BS> (backspace) in the abbreviation. Or expand with <C-]> which will leave no space.

    Correction: since the abbreviation is first expanded, and after that the space inserted, you need a small function found in the help (map.txt):

    func Eatchar(pat)
       let c = nr2char(getchar(0))       
       return (c =~ a:pat) ? '' : c      
    endfunc
    

    This is best put in .vimrc. Now the following abbreviation will work fully as intented:

    :iabbrev <silent> <? <?=?><Left><Left><C-R>=Eatchar('\s')<CR>
    

    It is a bit messy, but has an external function call that removes the white space and it should work well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I have a Type , is there some easy way to tell that
is there some way to tell sql server to use the (nolock) hint or
Is there some way in Flex where I can tell when all of the
Is there some way I can use URLs like: http://www.blog.com/team-spirit/ instead of http://www.blog.com/?p=122 in
I was wondering if there is some way to tell if data was encrypted
Is there some way to tell Javascript that it should never use anything but
Given two jquery objects, Is there some way I tell which one is further
Is there some way to sum up two different tweet number from two different
Is there some way to stop the Changed database context to ... message when
Is there some way to block access from a referrer using a .htaccess file

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.