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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T20:16:53+00:00 2026-05-12T20:16:53+00:00

Someplace I saw a snippet of code which told vi to use soft tabs

  • 0

Someplace I saw a snippet of code which told vi to use soft tabs and set the size of a tab. If you put this snippet at the bottom of a source file, then vi would magically use those settings for that file.

What is the syntax and rules for including that snippet in a source file? Can emacs be made to use these settings as well?

  • 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-12T20:16:54+00:00Added an answer on May 12, 2026 at 8:16 pm

    You can put this in a comment in your source file:

    ex: set softtabstop=4 shiftwidth=4 tabstop=4 expandtab: 
    

    The comment syntax depends on the type of the source file.

    For C/C++/Java, this would be:

    // ex: set softtabstop=4 shiftwidth=4 tabstop=4 expandtab: 
    

    For JSP, this would be:

    <%-- ex: set softtabstop=4 shiftwidth=4 tabstop=4 expandtab: --%>
    

    This works if it is placed at the beginning of the source file, but I’m not sure that this’ll work if placed at the end of it too.

    This will not work for emacs. There might be a different way of achieving the same for emacs.

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

Sidebar

Related Questions

I've seen code like this someplace. Ideally I'd like a loop like this to
I expect the answer to this is already here someplace, but I was not
I am trying to write a rule which says xyz.com/hotels_in_someplace will direct to xyz.com/test.php?place=someplace
So, I saw someplace (I'm not sure where off the top of my head,
Can I use FileField to handle a file, but store it someplace not under
So I have this kind of location: someplacecat.com Where someplace is dynamic and differs.
Let's say you work someplace where every change to source code must be associated
Suppose I have this: <ul id=menu> <li><a href=someplace>some text</a><li> ... </ul> I want to
I read up someplace, that there are characters other than A-Z that have a
I have a set of type set<int> and I want to get an iterator

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.