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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T01:29:50+00:00 2026-06-06T01:29:50+00:00

When using the autoindent configuration from VIM, it will automatically indent your cursor to

  • 0

When using the autoindent configuration from VIM, it will automatically indent your cursor to a meaningful position after creating a new line. But when the first character you enter is a hash character (#) then the indentation will be removed and the # will be inserted as the first character of the line.

Why does this happen? How to configure VIM to not do that?

Example (_ as the empty cursor position):

def python_function():
    _

after clicking the# on the keyboard this happens:

def python_function():
#_

but what should have happened is this:

def python_function():
    #_
  • 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-06-06T01:29:51+00:00Added an answer on June 6, 2026 at 1:29 am

    You might have smartindent or cindent instead of (or as well as) autoindent; these indent styles are designed for C-syntax languages. It’s a good idea when editing Python to use :filetype plugin indent on as this will load appropriate indent settings for Python.

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

Sidebar

Related Questions

Right now I am using set autoindent when I edit Yaml files in Vim,
I'm using Vim and editing Python scripts. Autoindent works pretty well in general, but
using (var file_stream = File.Create(users.xml)) { var serializer = new XmlSerializer(typeof(PasswordManager)); serializer.Serialize(file_stream, this); file_stream.Close();
Using Nunit, I want to be able to write a test fixture that will
Android: i am using twitter authentication by launching webview Intent authIntent = new Intent(Intent.ACTION_VIEW,
This question describes how auto indent is ignored with empty lines, using his/her example:
Using mercurial, I've run into an odd problem where a line from one committer
I've got a perplexing Vim problem. If I start editing a new file, say
I'm using Vim (7.2.445 on Debian Squeeze) with the vim-snipmate plugin (specially this fork
I'm using Visual Studio 2010 + ReSharper. I there any way to modify auto-indent

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.