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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:54:15+00:00 2026-05-16T07:54:15+00:00

I am writing python, javascript, html and other config files and I realize that

  • 0

I am writing python, javascript, html and other config files and I realize that when I enter newline to an unfinished line (i.e. unterminated string, still inside dictionary brackets, etc) I get double indentation.

How do I fix this?

  • 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-16T07:54:16+00:00Added an answer on May 16, 2026 at 7:54 am

    Python

    There are a few variables you can set in your .vimrc file to affect how Python is indented:

    Indent after an open parenthesis: let g:pyindent_open_paren = '&sw * 2'

    Indent after a nested parenthesis: let g:pyindent_nested_paren = '&sw'

    Indent for a continuation line: let g:pyindent_continue = '&sw * 2'

    For more info: :help ft-python-indent

    Javascript

    See $VIMRUNTIME/indent/javascript.vim: it uses cindent to perform indentation. cindent is affected by a number of options through the cinoptions variable. Some of them are set by default to &shiftwidth * 2, you might want to reset those.

    The relevant option for your case seems to be +N. In your .vimrc file you should put something like:

    set cinoptions+=+1
    

    even though this seems to be the default already.

    Html

    Again, see $VIMRUNTIME/indent/html.vim: this performs the indentation via a custom expression. I had a quick look and it doesn’t seem to be performing any double indentation anywhere, but I might be wrong. The global variables available for that doesn’t seem to be relevant.

    In the worst case, you might want to amend that file yourself and put it in your ~/.vim/indent/.

    Other files

    In general, each file is indented according to its own criteria, have a look in $VIMRUNTIME/indent/ to understand if and how each of them can be configured.

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

Sidebar

Ask A Question

Stats

  • Questions 531k
  • Answers 531k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer When you set your toLoad variable, add the all children… May 16, 2026 at 11:53 pm
  • Editorial Team
    Editorial Team added an answer Adjutancy's constructor is not being compiled. You may not be… May 16, 2026 at 11:53 pm
  • Editorial Team
    Editorial Team added an answer Just place the content in Xml (probably Xaml Resource dictionary)… May 16, 2026 at 11:53 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Is there a single regular expression that can parse a string (in Python and/or
I've been writing python scripts that run locally. I would now like to offer
I am writing a python script (Linux) that is adding some shell aliases (writes
I am writing a python/pygtk application that is adding some custom scripts (bash) in
I am writing a cgi page in Python. Let's say a client sends request
Is the syntax for writing regular expression standardized? That is, if I write a
So we're writing a full-text search framework MongoDb . MongoDB is pretty much javascript-native,
I am developing a Math application which can be extended by writing python scripts.
I make no claims to know anything at all about writing Python scripts or
I am writing a python module which checks several media and document formats whether

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.