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 675961
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:52:33+00:00 2026-05-14T00:52:33+00:00

I am trying to use vim properly – to aid me I’ve mapped my

  • 0

I am trying to use vim properly – to aid me I’ve mapped my arrow keys to “” so that I am forced to use {hjlk} to move around.

This is causing me a problem when I want to just surround a character with spaces, eg:

“2+3” is better formatted “2 + 3”

Previously I would have put my cursor over the + and typed:

i[space][arrow-right][space][Esc]

That’s 5 presses.

To do this without the arrow I seem to need to put the cursor over the + and go:

i[space][Esc]lli[space][Esc]

That’s 8 presses.

I can convert the “li” into an “a” which reduces it to 7 presses:

i[space][Esc]la[space][Esc]

Short of writing this into a macro is there a better way of doing it? Is there some magic vim command which will allow me to do it in less than even 5 presses – and some way to generalise it so that I can do it to entire words or symbols, eg if I want to convert 3==4 to 3 == 4?

  • 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-14T00:52:33+00:00Added an answer on May 14, 2026 at 12:52 am

    Personally, I think it makes most sense to destroy what you want to surround, and then repaste it.

    c w "" ESC P
    

    Obviously, you can replace both the object and the quotes with whatever you like. To change just one character + to be [space]+[space], you would do

    s [space] [space] ESC P
    

    on the +

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

Sidebar

Related Questions

I am trying to get AStyle working with Vim so that I can use
I am trying to use ctags with VIM, and I am a newbie to
I'm trying to use the Vim snipMate plugin, and I've installed it as it
I'm trying to use the Search command in Vim: :Rs/F/T/X R = range F
I am trying to use snipMate and pydiction in vim together - however, both
I'm trying to know how vim experts use macro's in vim for day-to-day coding
I am trying to use VIM for some programming. I am a total beginner
I'm trying to find all single numbers (with the use of vim): numbers at
I'm trying out ViEmu with Visual Studio 2010 & R#. In Vim I use
I'm trying to find the specification that Vim uses for the documentation files (which

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.