{"id":17993947,"url":"https://github.com/jimeh/yank-indent","last_synced_at":"2025-03-26T02:30:43.652Z","repository":{"id":153645391,"uuid":"629245129","full_name":"jimeh/yank-indent","owner":"jimeh","description":"Emacs minor-mode that ensures pasted (yanked) text has the correct indentation level.","archived":false,"fork":false,"pushed_at":"2023-11-16T15:25:05.000Z","size":51,"stargazers_count":10,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-24T06:06:47.125Z","etag":null,"topics":["emacs","emacs-lisp","emacs-mode","emacs-package","indentation","indentation-level","paste","pasting","yank","yanking"],"latest_commit_sha":null,"homepage":"","language":"Emacs Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jimeh.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}},"created_at":"2023-04-17T23:41:00.000Z","updated_at":"2024-11-25T08:43:41.000Z","dependencies_parsed_at":"2023-11-16T16:38:52.658Z","dependency_job_id":"65186a01-c08a-403c-a718-d9382ac8388b","html_url":"https://github.com/jimeh/yank-indent","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimeh%2Fyank-indent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimeh%2Fyank-indent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimeh%2Fyank-indent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimeh%2Fyank-indent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jimeh","download_url":"https://codeload.github.com/jimeh/yank-indent/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245576522,"owners_count":20638123,"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":["emacs","emacs-lisp","emacs-mode","emacs-package","indentation","indentation-level","paste","pasting","yank","yanking"],"created_at":"2024-10-29T20:13:32.569Z","updated_at":"2025-03-26T02:30:43.373Z","avatar_url":"https://github.com/jimeh.png","language":"Emacs Lisp","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003cimg width=\"128px\" src=\"https://raw.githubusercontent.com/jimeh/yank-indent/main/img/yank-indent.svg\" alt=\"Logo\"\u003e\u003cbr /\u003e\n  yank-indent\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003e\n    Emacs minor-mode that ensures pasted (yanked) text has the correct indentation level.\n  \u003c/strong\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/jimeh/yank-indent/releases\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/v/tag/jimeh/yank-indent?label=release\" alt=\"GitHub tag (latest SemVer)\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/jimeh/yank-indent/issues\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/issues-raw/jimeh/yank-indent.svg?style=flat\u0026logo=github\u0026logoColor=white\" alt=\"GitHub issues\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/jimeh/yank-indent/pulls\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/issues-pr-raw/jimeh/yank-indent.svg?style=flat\u0026logo=github\u0026logoColor=white\" alt=\"GitHub pull requests\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/jimeh/yank-indent/blob/main/LICENSE\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/license/jimeh/yank-indent.svg?style=flat\" alt=\"License Status\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nDo you often find yourself fixing the indentation of a code snippet right after\npasting it somewhere? Never again! yank-indent is the answer.\n\n## Features\n\n- `yank-indent-mode` minor-mode that automatically calls `indent-region` on\n  yanked/pasted text.\n- `global-yank-indent-mode` which is a set-it-and-forget-it style global mode\n  that enables `yank-indent-mode` in relevant buffers, with a sensible default\n  list of major-modes to exclude.\n- By default does not trigger `indent-region` if pasted text is longer than 5000\n  characters. This threshold can be can be customized with\n  `yank-indent-threshold`.\n\n## Installation\n\n### use-package + straight.el\n\n```elisp\n(use-package yank-indent\n  :straight (:host github :repo \"jimeh/yank-indent\")\n  :config (global-yank-indent-mode t))\n```\n\n### Manual\n\nPlace `yank-indent.el` somewhere in your `load-path` and require it. For example\n`~/.emacs.d/vendor`:\n\n```elisp\n(add-to-list 'load-path \"~/.emacs.d/vendor\")\n(require 'yank-indent)\n(global-yank-indent-mode t)\n```\n\n## Usage\n\n### `global-yank-indent-mode`\n\nWith `global-yank-indent-mode` enabled, you will find that `yank-indent-mode` is\nautomatically enabled in relevant buffers. The defaults will specifically\nexclude common languages which are indentation sensitive like Python, YAML,\nMakefile, etc.\n\nFor fine-grained control over which major-modes it is enabled in or not, see\ncustomization options with `M-x customize-group RET yank-indent`.\n\n### `yank-indent-mode`\n\nIf you prefer not to use the global mode, you can add `yank-indent-mode` as a\nhook to relevant major-modes, or even manually toggle it on and off with\n`M-x yank-indent-mode`.\n\nTo skip the indent operation for a single yank command, use a prefix command, so\n`C-u C-y` instead of just `C-y`.\n\nKeep in mind that the include/exclude major-mode customizations only affect the\nglobal mode and which buffers it enables `yank-indent-mode` in. If you\nexplicitly enable `yank-indent-mode` in a buffer, it will operate like normal\nregardless of what major-mode the buffer is using.\n\n## Alternative Packages\n\n- [snap-indent](https://github.com/jeffvalk/snap-indent)\n  ([melpa](https://melpa.org/#/snap-indent)): Very similar with the addition of\n  being able to trigger indentation on save, and extra custom formatting\n  functions to run right after indentation.\n- [auto-indent-mode](https://github.com/mattfidler/auto-indent-mode.el)\n  ([melpa](https://melpa.org/#/auto-indent-mode)): Triggers indentation in a\n  whole suite of scenarios, more or less trying to ensure everything is always\n  correctly indented. This also includes indenting any yanked regions. Does not\n  seem to support any thresholds to avoid triggering indentation for large\n  buffers/yanked text.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimeh%2Fyank-indent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjimeh%2Fyank-indent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimeh%2Fyank-indent/lists"}