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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:12:31+00:00 2026-05-27T15:12:31+00:00

I use evil, which got (defcustom evil-shift-width 4 The offset used by \\<evil-normal-state-map>\\[evil-shift-right] \

  • 0

I use evil, which got

(defcustom evil-shift-width 4
  "The offset used by \\<evil-normal-state-map>\\[evil-shift-right] \
and \\[evil-shift-left]."
  :type 'integer
  :group 'evil)

I’d like to set evil-shift-width to the buffer-local indent width (the variable indent).

(add-hook 'after-change-major-mode-hook
      (function (lambda ()
                  (setq evil-shift-width indent))))

What did I miss?

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

    Without more information, I believe I understand the problem to be that desire is for evil-shift-width to be set to 4 in python-mode and 2 in ruby-mode (for two examples), yet it is always set to 2.

    The problem in this case comes from the fact that indent isn’t defined globally in Emacs, and certainly not in python-mode. In python-mode there is a variable python-indent, which is set to 4, and that is the variable to use.

    While annoying to have to use custom variables for each of the major modes, that’s what each of the modes actually use, and that’s probably the solution that will actually work:

    (add-hook 'python-mode-hook
      (function (lambda ()
              (setq evil-shift-width python-indent))))
    (add-hook 'ruby-mode-hook
      (function (lambda ()
              (setq evil-shift-width ruby-indent-level))))
    

    Adding a new one for each major-mode you want supported.

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

Sidebar

Related Questions

I've got a page where I load screen.css which contains an evil rule, which
I'm debugging a perl script which looks like this (simplified): #!/usr/bin/perl use strict; use
I'm developing plugins in Eclipse which mandates the use of singleton pattern for the
I have created a simple GUI engine which I plan to use in a
I have a code which I need to use within eval . Sometimes I
I have a program which crashes on the ShellExecute() instruction. If I use the
I have a program that uses an external API which uses its own state.
I have a situation in which I have to use eval in Javascript. Yes,
I have a relatively simple use case which is failing. Consider the following code:
'''use Jython''' import shutil print dir(shutil) There is no, shutil.move, how does one move

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.