effortless-indent
When we paste code and find that the indentation is incorrect, the traditional approach is to position the cursor at the beginning and end of the pasted code area, and insert spaces at the beginning of the line through rectangular operations to solve the problem.
The goal of the effortless-indent plugin is that after we have just executed the yank
command, we only need to execute the effortless-indent-right
command to quickly adjust the indentation to the right, without the need for additional selection operations, saving a lot of time.
The corresponding, we can execute the effortless-indent-left
command to adjust the indentation to the left.
Installation
- Download this repository using
git clone
, and replace the load-path path in the configuration below - Add the following code to your configuration file ~/.emacs:
(add-to-list ‘load-path “<path-to-effortless-indent>”)
(require ’effortless-indent)
Options
effortless-indent-formatting-indent-alist
: effortless-indent will automatically obtain the indentation value according to the current mode by default. Ifeffortless-indent-formatting-indent-alist
does not include your favorite language, you are welcome to submit a PR to improve it