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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:27:57+00:00 2026-05-27T12:27:57+00:00

Is there a way to just have Vim copy the indent from the line

  • 0

Is there a way to just have Vim copy the indent from the line above, whether it be spaces or tabs, oblivious of the file types?

  • 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-27T12:27:58+00:00Added an answer on May 27, 2026 at 12:27 pm

    It seems what I’ve wanted isn’t actually possible as Vim automatically removes whitespaces, and uses configuration settings for its indention.

    I’ve avoided this put slapping these in to my vimrc:

    :inoremap <CR> x<BS><CR>x<BS>
    :inoremap <up> x<BS><up>
    :inoremap <down> x<BS><down>
    :nnoremap o ox<BS>
    :nnoremap O Ox<BS>
    

    It simply puts a character in place and then removes it before I exit the editing mode, so Vim doesn’t remove the empty line. If this is the case then it may be simply Vim checking if any editing was done to the line, auto indenting not counted. Maybe someday I’ll check out the source and poke around.

    I also wanted to use the previous line’s indent (so I’d get different indents for different files and not have to tamper with settings each time), but I’ve managed to compromise and use the lovely Vim plugin.

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

Sidebar

Related Questions

I have a working selector but I just wondered whether there was another way
Is there a way to have a full interpreter in Erlang, not just a
Just wondering if there is a way in Spring to have a parent controller:
Is there any way to get just a part from MySql cell and ignore
Just wondering is there any way I can check whether the url links to
Is there any way to make the status line in Vim spanning across multiple
Is there a way to have a UIPickerView just have escalating numbers to infinity?
Does anybody have her vim setup in a way that uses hard tabs as
Is there any way (just out of curiosity because I came across multiple same-value
Is there a way just like multidatatrigger behavior of WPF also implemented in Silverlight

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.