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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:23:55+00:00 2026-05-25T00:23:55+00:00

If I try cc or S when the cursor ( | below) is in

  • 0

If I try cc or S when the cursor (| below) is in the following
position:

public function blah()
{
    var i = 0;
|
    i++
    return i;
}

It stays in the first column instead of moving under the letter v in var. Pasting with ]p also pastes starting from column 1.

My setup (in MacVim) is: autoindent, smartindent, nocindent, and indentexpr=, if that helps.

According to the following SO questions, correct indentation should be possible:

  • Vim: Smart indent when entering insert mode on blank line?
  • Vim: Indent current (blank) line and insert
  • Autoindent in vim always empty the line if there are only whitespace in it, can I change that?

In the last post, @trVoldemort had the same issue (see the comments to the second answer).

  • 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-25T00:23:56+00:00Added an answer on May 25, 2026 at 12:23 am

    Turn on cindent…

    :set cindent
    

    This works for indenting with “cc” and “S”, as long as the language has similar indentation to C (or support for cindent).

    With this, the smart-indent paste (]p) still doesn’t work on an empty line, however. For that, remap ]p as follows:

    :nnoremap ]p oX<Esc>]pk"_dd
    

    This will create a new line at the correct indentation before doing the re-indent paste. Then it goes back and deletes that line, making sure not to overwrite the default buffer.

    You can also remap the alternative versions of the smart-indent paste:

    :nnoremap ]P OX<Esc>]pk"_dd
    :vnoremap ]p "_xkoX<Esc>]pk"_dd
    :vnoremap ]P "_xkoX<Esc>]pk"_dd
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I try to run this view/function, I get the following error execute() first
Try the following code public enum Color { Blue=1, Red=2, Green=3 } public List<Color>
I'd like to get the value of Count column from cursor. public Cursor getRCount(String
I was thinking I'd try to make my sqlite db connection a function instead
Try executing the following in JavaScript: parseInt('01'); //equals 1 parseInt('02'); //equals 2 parseInt('03'); //equals
When ever I try to access the RecordCount property, I always get a return
I currently have the code below it works fine up until I actually try
Been using the code below to return a single record from the database. I
http://jsfiddle.net/yrM3H/2/ I have the following code: jQuery(document).ready(function() { jQuery(.toggle).next(.hidden).hide(); jQuery(.toggle).click(function() { $('.active').toggleClass('active').next('.hidden').slideToggle(300); $(this).toggleClass('active').next().slideToggle(fast); });
I have the following code. int phoneContactID = new Random().nextInt(); Cursor contactLookupCursor = context.getContentResolver().query(

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.