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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:01:48+00:00 2026-05-27T11:01:48+00:00

Does anybody have her vim setup in a way that uses hard tabs as

  • 0

Does anybody have her vim setup in a way that uses hard tabs as indentation characters, but does use spaces for alignment? The problem I have is that when starting a continuation line like in

if (condition1 && (anotherlongcondition || /* <-- Here I insert a newline */
|-------|-------   whatever  /* some additional alignment added automatically */

, then cin (which is a must for me) adds some alignment just the way I prefer positionally, but this alignment is created using as much hard tabs as possible and filling the rest with spaces (as I tried to visualize).

So, in short, cin doesn’t really seem to distinguish between indentation and alignment. I’d really like that all the added alignment in the example above is spaces. This way the alignment would be preserved correctly when switching ts temporarily.

To make it clear again, I’d like to be able to write the following code, never pressing <TAB> or <SPACE> in front of the first non-blank character in any line (and not doing any manual shifting or whatever):

void foo(int bar)
{
|-------somestatement;
|-------if (somecondition && (someothercondition ||
|-------                      whatevercomesnext))
|-------|-------dosomething;
}

I have already tried out ctab.vim, but it focuses on editing an aligned line with soft tabs, which seems silly to me because manual alignment is a task which affords 1-step refinement and not tab-width-step refinement. I did not change the way cin uses mixed tabs and spaces for alignment.

I have not managed to find any built-in way to accomplish that. Perhaps still, there is one? Anyway, I doubt that there’s a plugin that does that. Although I admittedly don’t vim-script myself and may not have enough experience, I must say that most plugins I tried out only messed up my editor configuration…

  • 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-27T11:01:48+00:00Added an answer on May 27, 2026 at 11:01 am

    Okay, sorry for the question. I’ve finally found some good material for it.

    http://vim.1045645.n5.nabble.com/Indent-with-tabs-align-with-spaces-td1183279.html

    To sum up, currently vim is not flexible enough for this to be done comfortably.

    My workaround currently is using :set cinoptions=(1 which adds only one alignment unit when starting a continuation line. This way, I can be sure that the added alignment is a space (as long as I did not :set ts=1, at least) and add the nice amount of spaces manually. This is still ok in terms of speed and seems to be the least distracting behaviour to me!

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

Sidebar

Related Questions

Does anybody have a short code sample that can be run in the VS
Does anybody have any reference material that details Cauchy-Reed algorithm? Googling for Cauchy-Reed Solomon
Does anybody have a good analogy (or, failing that, a good resource) for describing
Does anybody have an example of how to use Google Guice to inject properties
Does anybody have a good way of finding ALL the controls within an object
Does anybody have a suggestion on how to create a gui that can change
Does anybody have an idea how to use he publish website command on VS
Does anybody have a regular expression that would work to limit the number of
Does anybody have any clever solutions that they've used to turn on customErrors for
Does anybody have any idea why iPad zoom (you know, where you use two

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.