smart-shift is a minor mode for conveniently shifting a line/region of code to the left/right according to the current major mode indentation width.
Once you have setup Melpa you can use
package-install command to install. The package name is
1 2 3
smart-shift will infer the indentation level of current major mode, if none of major modes listed below match, it will fallback to use the
tab-width by default.
It can also be set to a number explictly.
Or, for some major mode we are not supportted yet, add following snippets to your config file.
1 2 3 4
Supported major modes
||Shift the line or region ARG times to the left.|
||Shift the line or region ARG times to the right.|
smart-shift-right the first time, you can simply hit
] to continuously shift to left or right, respectively.
If you use the key-chord like me. I strongly recommend you add the following snippets:
Repo is here, forks and pull requests are welcome!