A more general implementation of the python-indent-shift-left and
python-indent-shift-right commands. Basically just changes the
indent width variable used to tab-width (from python-indent-offset).
Download shift-indent.el and use package-install-file to install
it. Alternatively you could put it somewhere in your load-path and
either add some autoloads manually or use (require 'shift-indent).
Bind the commands to some keys and you’re ready to go, for example:
(global-set-key (kbd "C-<") 'indent-shift-left)
(global-set-key (kbd "C->") 'indent-shift-right)If you want to keep the original Python keybindings, you might not
want to use these keys, or you could rebind them locally when
python-mode starts.
(add-hook 'python-mode-hook
(lambda ()
(local-set-key (kbd "C->") 'python-indent-shift-right)
(local-set-key (kbd "C-<") 'python-indent-shift-left)))