https://github.com/ryuslash/indent-shift
Shift indentation
https://github.com/ryuslash/indent-shift
Last synced: 5 months ago
JSON representation
Shift indentation
- Host: GitHub
- URL: https://github.com/ryuslash/indent-shift
- Owner: ryuslash
- License: gpl-3.0
- Created: 2014-05-31T22:22:40.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2014-06-04T19:49:22.000Z (about 12 years ago)
- Last Synced: 2025-04-22T17:16:59.085Z (over 1 year ago)
- Language: Emacs Lisp
- Size: 133 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
- License: COPYING
Awesome Lists containing this project
README
* indent-shift
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=).
** Installation
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)=.
** Usage
Bind the commands to some keys and you're ready to go, for example:
#+BEGIN_SRC emacs-lisp
(global-set-key (kbd "C-<") 'indent-shift-left)
(global-set-key (kbd "C->") 'indent-shift-right)
#+END_SRC
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.
#+BEGIN_SRC emacs-lisp
(add-hook 'python-mode-hook
(lambda ()
(local-set-key (kbd "C->") 'python-indent-shift-right)
(local-set-key (kbd "C-<") 'python-indent-shift-left)))
#+END_SRC