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

  • Home
  • SEARCH
  • 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 6546479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:42:46+00:00 2026-05-25T11:42:46+00:00

I use VIM pretty regularly now but I never use the dot (.) command

  • 0

I use VIM pretty regularly now but I never use the dot (.) command to repeat the previous action. I keep reading about how awesome it is but I never see any real world examples that make sense to me and the way I code in VIM. What are some real world examples that show how awesome the dot (.) command is?

  • 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-25T11:42:47+00:00Added an answer on May 25, 2026 at 11:42 am

    Here are some actions that I do with the dot command:

    • Simpler than :%s/\<word\>/replacement/gc is * on the word, then cereplacement<esc> and then repeat n.. This is nice if you have two or three occurrences of your word. If you have several words that you want to replace, then go to the next word, hit * and again n.
    • When I want to left-align some blocks: <Ctrl-V>jjj<..... or insert spaces at the front: <ctrl-v>jjjI<space><esc>....
    • after dd or dw, the dot command will delete another line/word

    A magical thing that happens with the dot command is that if it repeats a command that used a numbered register, it will use the next numbered register (see :help redo-register).

    Explanation: If you did dd on 9 lines and want to restore them in the order in which you’ve deleted them, then do: "1P......... Note that registers 1 to 9 are Vim’s delete-ring. "1P will insert before the cursor the last deleted text, "2P will then insert prior-to-last deleted text, and so on.

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

Sidebar

Related Questions

I normally use gVim for editing, but I sometimes use vim when remotely connecting
I use Vim to read man pages. But I'm having trouble searching for variables.
When I use Vim I tend to split my screen in various ways, but
I've not used VIM as an editor before, but I'm curious about it and
I use vim as my editor but I would like to get some of
I use vim (7.1) on OpenVMS V7.3-2. I connect to VMS trough a telnet
I use Vim and Vim plugins for Visual Studio when writing C++. Often, I
I use VIM editor for PHP, i know many people will point to PDT
I use Vim & Git together. I tend to merge/switch Git branches alot. I
I am trying to use vim properly - to aid me I've mapped my

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.