- Notifications
You must be signed in to change notification settings - Fork6
Generic control the indentation level for each mode.
License
jcs-elpa/indent-control
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Management for indentation level.
Interface that combine all the indentation variables from each major modeto one giant list.
- Decouple from user knowing each major mode's indentation level variable. (if have)
- Keep the indentation level across buffers. If you changed the indentation levelin
buffer A
and switch tobuffer B
with the same major mode; they will havethe same indentation level.
You can tweak variableindent-control-records
to set the initialindentation level for each major mode.
(setq indent-control-records '((actionscript-mode.4) (c-mode.4) (c++-mode.4) (csharp-mode.4) ... (sql-mode.1) (typescript-mode.4) (web-mode.2) (yaml-mode.2)))
These functions will change the current indentation level for the major modethat you currently on.
indent-control-inc
indent-control-dec
You can tweak variableindent-control-delta
to change the size of the oneindentation level. The default value is2
.
Is easy to make indentation level inherit last time modified in Emacs.Just enable the global minor modeindent-control-mode
then it willautomatically records all changes from the indentation level.
This minor mode is already get called inprog-mode-hook
, but with somemajor modes that they do not use inheritprog-mode
will not work!You would have to manually called it in each mode's startup hook.For instanceactionscript-mode
doesn't inheritprog-mode
so you wouldhave to do the following.
(defunmy-actionscript-mode-hook ()"My actionscript mode hook." (indent-control-continue-with-record))(add-hook'actionscript-mode-hook#'my-actionscript-mode-hook)
If you would like to contribute to this project, you may eitherclone and make pull requests to this repository. Or you canclone the project and establish your own branch of this tool.Any methods are welcome!
To run the test locally, you will need the following tools:
Install all dependencies and development dependencies:
eask install-deps --dev
To test the package's installation:
eask packageeask install
To test compilation:
eask compile
🪧 The following steps are optional, but we recommend you follow these lint results!
The built-incheckdoc
linter:
eask lint checkdoc
The standardpackage
linter:
eask lint package
📝 P.S. For more information, find the Eask manual athttps://emacs-eask.github.io/.
This program is free software; you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe Free Software Foundation, either version 3 of the License, or(at your option) any later version.
This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See theGNU General Public License for more details.
You should have received a copy of the GNU General Public Licensealong with this program. If not, seehttps://www.gnu.org/licenses/.
SeeLICENSE
for details.
About
Generic control the indentation level for each mode.