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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:13:07+00:00 2026-05-23T09:13:07+00:00

I’ve got a perplexing Vim problem. If I start editing a new file, say

  • 0

I’ve got a perplexing Vim problem. If I start editing a new file, say with vim test.txt, and I type in the word “do” and hit enter (while still in insert mode), the next line is automatically indented. Before giving a quick answer, please read this whole post.

Two questions:

  1. Why might this happen?
  2. How can I debug the startup process (reading ~/.vimrc and files in ~/.vim/)?

More information:

  • Here’s my .vimrc: http://dotfiles.org/~meonkeys/.vimrc.
  • “do”, “if”, and “switch” all cause indenting, but I still haven’t figured out what language Vim is using indent rules for.
  • I do have a bunch of stuff in ~/.vim/. Here’s that: http://adammonsen.com/tmp/dot_vim.tgz
  • I can’t find anything in my ~/.vimrc or ~/.vim/ that should turn on some kind of indenting even if filetype is unset!
  • If I start Vim using vim -u /dev/null test.txt, the problem goes away.
  • Yes, I know about the autoindent setting. I don’t think this is the problem because turning on autoindent after using a null vimrc doesn’t indent the line after “do” is typed in.
  • 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-23T09:13:08+00:00Added an answer on May 23, 2026 at 9:13 am
    'smartindent' 'si'      boolean (default off)
                            local to buffer
                            {not in Vi}
                            {not available when compiled without the
                            |+smartindent| feature}
            Do smart autoindenting when starting a new line.  Works for C-like
            programs, but can also be used for other languages.  'cindent' does
            something like this, works better in most cases, but is more strict,
            see |C-indenting|.  When 'cindent' is on, setting 'si' has no effect.
            'indentexpr' is a more advanced alternative.
            Normally 'autoindent' should also be on when using 'smartindent'.
            An indent is automatically inserted:
            - After a line ending in '{'.
            - After a line starting with a keyword from 'cinwords'.
            - Before a line starting with '}' (only with the "O" command).
    

    cinwords defaults to if,else,while,do,for,switch

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

Sidebar

Related Questions

i got an object with contents of html markup in it, for example: string
I've got a string that has curly quotes in it. I'd like to replace
I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
i want to parse a xhtml file and display in UITableView. what is the
I'm parsing an XML file, the creators of it stuck in a bunch social
I want to count how many characters a certain string has in PHP, but

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.