{"id":13678076,"url":"https://github.com/editorconfig/editorconfig-emacs","last_synced_at":"2025-05-15T00:07:48.883Z","repository":{"id":1786507,"uuid":"2710379","full_name":"editorconfig/editorconfig-emacs","owner":"editorconfig","description":"EditorConfig plugin for Emacs","archived":false,"fork":false,"pushed_at":"2025-04-27T06:10:51.000Z","size":685,"stargazers_count":856,"open_issues_count":14,"forks_count":108,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-04-27T07:22:48.600Z","etag":null,"topics":["editorconfig","editorconfig-plugin","emacs","emacs-lisp"],"latest_commit_sha":null,"homepage":"https://editorconfig.org","language":"Emacs Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"docker/docker-registry","license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/editorconfig.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2011-11-04T16:03:58.000Z","updated_at":"2025-04-27T06:10:56.000Z","dependencies_parsed_at":"2023-12-18T06:21:47.470Z","dependency_job_id":"e745ab03-f4f8-4169-b959-80b03357583f","html_url":"https://github.com/editorconfig/editorconfig-emacs","commit_stats":{"total_commits":437,"total_committers":69,"mean_commits":6.333333333333333,"dds":0.6544622425629291,"last_synced_commit":"e1a391a618ec33d157822dbcc51d010559289f1a"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/editorconfig%2Feditorconfig-emacs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/editorconfig%2Feditorconfig-emacs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/editorconfig%2Feditorconfig-emacs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/editorconfig%2Feditorconfig-emacs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/editorconfig","download_url":"https://codeload.github.com/editorconfig/editorconfig-emacs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254249197,"owners_count":22039029,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["editorconfig","editorconfig-plugin","emacs","emacs-lisp"],"created_at":"2024-08-02T13:00:49.901Z","updated_at":"2025-05-15T00:07:43.838Z","avatar_url":"https://github.com/editorconfig.png","language":"Emacs Lisp","funding_links":[],"categories":["Emacs Lisp"],"sub_categories":[],"readme":"![build](https://github.com/editorconfig/editorconfig-emacs/actions/workflows/build.yaml/badge.svg?branch=master)\n[![MELPA](https://melpa.org/packages/editorconfig-badge.svg)](http://melpa.org/#/editorconfig)\n[![MELPA Stable](https://stable.melpa.org/packages/editorconfig-badge.svg)](https://stable.melpa.org/#/editorconfig)\n[![NonGNU ELPA](http://elpa.nongnu.org/nongnu/editorconfig.svg)](http://elpa.nongnu.org/nongnu/editorconfig.html)\n\n# EditorConfig Emacs Plugin\n\nThis is an [EditorConfig][] plugin for [Emacs][].\n\n## Getting Started\n\n### package.el\n\nThis package is available from [MELPA][], [MELPA Stable][] and [NonGNU ELPA][].\nInstall from these repositories and enable global minor-mode `editorconfig-mode`:\n\n```emacs-lisp\n(editorconfig-mode 1)\n```\n\nNormally, enabling `editorconfig-mode` should be enough for this plugin to work:\nall other configurations are optional.\nThis mode sets up hooks so that EditorConfig properties will be\nloaded and applied to the new buffers automatically when visiting files.\n\n### use-package\n\nIf you use [**use-package**][use-package], add the following to your\n`init.el` file:\n\n```emacs-lisp\n(use-package editorconfig\n  :ensure t\n  :config\n  (editorconfig-mode 1))\n```\n\n### Manual installation\n\nCopy all `.el` files in this repository to `~/.emacs.d/lisp` and add the\nfollowing:\n\n```emacs-lisp\n(add-to-list 'load-path \"~/.emacs.d/lisp\")\n(require 'editorconfig)\n(editorconfig-mode 1)\n```\n\n## Supported properties\n\nCurrent Emacs plugin coverage for EditorConfig's [properties][]:\n\n* `indent_style`\n* `indent_size`\n* `tab_width`\n* `end_of_line`\n* `charset`\n* `trim_trailing_whitespace`\n* `insert_final_newline`\n* `max_line_length`\n* ~~`file_type_ext` (Experimental)~~ (See below)\n* ~~`file_type_emacs` (Experimental)~~ (See below)\n* `root` (only used by EditorConfig core)\n\nNot yet covered properties marked with ~~over-strike~~\n– pull requests implementing missing features warmly welcomed!\nTypically, you will want to tie these to native functionality,\nor the configuration of existing packages handling the feature.\n\nAs several packages have their own handling of, say, indentation,\nwe might not yet cover some mode you use, but we try to add the\nones that show up on our radar.\n\n### ~~File Type (file_type_ext, file_type_emacs)~~\n\nFile-type feature is currently disabled, because this package is now undergoing\nbig internal refactoring.\nFor those who want this functionality,\nplease consider using [editorconfig-custom-majormode](https://github.com/10sr/editorconfig-custom-majormode-el).\n\n## Customize\n\n`editorconfig-emacs` provides some customize variables.\n\nHere are some of these variables: for the full list of available variables,\ntype \u003ckbd\u003eM-x customize-group [RET] editorconfig [RET]\u003c/kbd\u003e.\n\n### `editorconfig-trim-whitespaces-mode`\n\nBuffer local minor-mode to use to trim trailing whitespaces.\n\nIf set, editorconfig will enable/disable this mode in accord with\n`trim_trailing_whitespace` property in `.editorconfig`.\nOtherwise, use Emacs built-in `delete-trailing-whitespace` function.\n\nOne possible value is\n[`ws-butler-mode`](https://github.com/lewang/ws-butler), with which\nonly lines touched get trimmed. To use it, add following to your\ninit.el:\n\n``` emacs-lisp\n(setq editorconfig-trim-whitespaces-mode\n      'ws-butler-mode)\n```\n\n### `editorconfig-after-apply-functions`\n\n(Formerly `editorconfig-custom-hooks`)\n\nA list of functions which will be called after loading common EditorConfig settings,\nwhen you can set some custom variables.\n\nFor example, `web-mode` has several variables for indentation offset size and\nEditorConfig sets them at once by `indent_size`. You can stop indenting\nonly blocks of `web-mode` by adding following to your init.el:\n\n```emacs-lisp\n(add-hook 'editorconfig-after-apply-functions\n  (lambda (props) (setq web-mode-block-padding 0)))\n```\n\n## Troubleshooting\n\nEnabling `editorconfig-mode` should be enough for normal cases.\n\nWhen EditorConfig properties are not effective for unknown reason, we recommend\nfirst trying `M-x editorconfig-display-current-properties`.\n\nThis command will open a new buffer and display the EditorConfig properties\nloaded for current buffer.\nYou can check if EditorConfig properties were not read for buffers at all,\nor they were loaded but did not take effect for some other reasons.\n\n### Indentation for new major-modes\n\nBecause most Emacs major-modes have their own indentation settings, this plugin\nrequires explicit support for each major-mode for `indent_size` property.\n\nBy default this plugin ships with settings for many major-modes, but,\nsorry to say, it cannot be perfect. Especially it is difficult to support\nbrand-new major-modes.\nPlease feel free to submit issue or pull-request for such major-mode!\n\nSupported major-modes and their indentation configs are defined in the variable\n`editorconfig-indentation-alist`.\n\n### Not work at all for FOO-mode!\n\nMost cases properties are loaded just after visiting files when\n`editorconfig-mode` is enabled.\nBut it is known that there are major-modes that this mechanism does not work\nfor and require explicit call of `editorconfig-apply`.\n\nTypically it will occur when the major-mode is not defined using\n`define-derived-mode` (`rpm-spec-mode` is an example for this).\nPlease feel free to submit issues if you find such modes!\n\n### `editorconfig-format-buffer` does not work well with lsp-mode\n\nBy default, [lsp-mode][] configures indent-region-function so that Emacs uses\nlanguage servers' `textDocument/rangeFormatting` request to format text in\nbuffers.\nSo EditorConfig settings are ignored unless language servers\nthemselves support loading configs from `.editorconfig`.\n\nTo avoid this behavior ad-hocly, set `lsp-enable-indentation` to nil.\n\n## Submitting Bugs and Feature Requests\n\nBugs, feature requests, and other issues should be submitted to the issue\ntracker: https://github.com/editorconfig/editorconfig-emacs/issues\n\n### Development\n\nTo run the test locally, you will need the following tools:\n\n- Make\n- [CMake][]\n- [Eask][]\n\nIf you are on `Linux` or `macOS`:\n\n    $ make check-unix\n\nOn `Windows`:\n\n    $ make check-dos\n\nTo start a new Emacs process with current `*.el` and without loading user init\nfile, run:\n\n    $ make sandbox\n\n## License\n\nEditorConfig Emacs Plugin is free software: you can redistribute it\nand/or modify it under the terms of the GNU General Public License as\npublished by the Free Software Foundation, either version 3 of the\nLicense, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful, but\nWITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\nGeneral Public License for more details.\n\nYou should have received a copy of the GNU General Public License along\nwith this program.  If not, see \u003chttps://www.gnu.org/licenses/\u003e.\n\n\n[Emacs]: https://www.gnu.org/software/emacs/\n[MELPA]: https://melpa.org/#/editorconfig\n[MELPA Stable]: https://stable.melpa.org/#/editorconfig\n[NonGNU ELPA]: http://elpa.nongnu.org/nongnu/editorconfig.html\n[use-package]: https://www.emacswiki.org/emacs/UsePackage\n[EditorConfig]: https://editorconfig.org\n[EditorConfig C Core]: https://github.com/editorconfig/editorconfig-core-c\n[properties]: https://editorconfig.org/#supported-properties\n[CMake]: https://cmake.org\n[Eask]: https://github.com/emacs-eask/cli\n[lsp-mode]: https://github.com/emacs-lsp/lsp-mode\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feditorconfig%2Feditorconfig-emacs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feditorconfig%2Feditorconfig-emacs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feditorconfig%2Feditorconfig-emacs/lists"}