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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T23:51:20+00:00 2026-05-18T23:51:20+00:00

I am working with a CMS where the code’s indentation is a mess. Is

  • 0

I am working with a CMS where the code’s indentation is a mess. Is it possible to fix it automatically with vim, running some command?

  • 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-18T23:51:20+00:00Added an answer on May 18, 2026 at 11:51 pm

    Generally you can use the = operation to indent.

    See :help =

    (You’ll also need to have filetype indent on in your vimrc to enable different indentation rules for each type of file you’ll edit)

    gg=G will reindent a whole file. (gg move to beginning of the file, = will reindent every line under motion, G goes to the end of the file)

    By default, Vim support well C and C like language. See :help C-indenting for options. You’ll probably need to adjust these options before reformating your files. You’ll have to define set cindent in your .vimrc if you want to use the “smart” indentations that is controlled by cinoptions.

    See :help indent-expressionfor other languages.

    In addition, you’ll probably will have to fiddle withshiftwidth, expandtab and tabstop options if you want to use whitespaces or tab to indent.

    For example, if you to replace all tab by 4 spaces, you ‘ll have to use:

    set shiftwidth=4             " used by >>, << and tab.  
    set tabstop=4                " number of space characters used when displaying TAB  
    set expandtab                " replace TAB by spaces  
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a CMS with Widgets. On my localhost the followong code works
I am working on a cms and there are some simple parameters like number
I'm working on a project (simple XML CMS) just to learn some basic PHP.
I've been trying to get some working Java code to use for encrypting Paypal
I am working on a CMS that instead of generates pages automatically, it generates
I'm working on a CMS in Codeigniter and I'm currently setting up some validation
I'm working in an insane mess of a CMS system where php, javascript, and
I have some HTML I'm working on using programming from a CMS I didn't
Possible Duplicate: PHP session seemingly not working I'm currently coding my own CMS for
im working with a cms made a few years ago in asp/vbscript (old asp)

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.