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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T06:05:45+00:00 2026-05-12T06:05:45+00:00

I am long time-vim user and recently discovered that emacs has viper-mode, offering best

  • 0

I am long time-vim user and recently discovered that emacs has viper-mode, offering best of both worlds (at least for me). However one thing is really bothering me since I am mostly coding in python and mixing of tabs and spaces is a big deal.

When in insert mode I would like to insert viper-shift-width spaces instead of TAB when I press TAB. How can I do this? I suppose some simple lisp function/setting is the solution.

I didn’t find anything in viper-mode settings that could do this.

Edit:

I have (setq-default indent-tabs-mode nil) in my .emacs but this doesn’t work when I am in insert mode (in vim meaing of insert mode) in viper-mode

  • 1 1 Answer
  • 1 View
  • 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-12T06:05:46+00:00Added an answer on May 12, 2026 at 6:05 am

    First, you should ensure the default value of 'indent-tabs-mode is nil, like so:

    (setq-default indent-tabs-mode nil)
    

    Then, in viper-mode, it also depends on your viper-expert-level. At level 1 or 2, TAB appears to be bound to 'self-insert-command via the mode map viper-insert-diehard-minor-mode (which is enabled when the expert level is either 1 or 2). I guess that it is trying to provide maximal vi compatibility, which means you sacrifice some Emacs features, including the use of some pretty basic customizations.

    So… you can up your expert level to 3 or higher:

    (setq viper-expert-level 5)        ; really, why use anything less?
    

    If you really want level 1 or 2, but want TAB to not be a self inserting command, then add this to your .viper file:

    (define-key viper-insert-diehard-map (kbd "TAB") 'viper-insert-tab)
    

    That does the trick for me, even on level 1.

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

Sidebar

Related Questions

I am a long time emacs user learning Vim. Emacs lets me navigate in
I'm a long-time vim user trying to make the switch to emacs. I'm using
I am a long time vim user and have heard great things about TextMate
For a long time I've known that I can use ~ in Vim to
long time ago I try to create currency converter for android that has live
I've been using Vim for quite a long time, but I'm at a level
long time reader first time user. I'm putting together my first RoR application and
I have been a long time user of the standard Mac Terminal. Decided to
Lately vim takes a long time to start up when I'm running it to
Long time mysql/php user, first time Drupal user. Actually, I'm not doing the Drupal

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.