{"id":18081960,"url":"https://github.com/vindarel/indent-tools","last_synced_at":"2026-01-31T06:03:39.442Z","repository":{"id":67525173,"uuid":"140446319","full_name":"vindarel/indent-tools","owner":"vindarel","description":"(mirror) Emacs mode to indent, navigate around and act on indentation units: perfect for yaml, python and the like.","archived":false,"fork":false,"pushed_at":"2019-06-06T16:47:16.000Z","size":175,"stargazers_count":13,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-15T18:01:59.829Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://gitlab.com/emacs-stuff/indent-tools","language":"Emacs Lisp","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vindarel.png","metadata":{"files":{"readme":"README.org","changelog":null,"contributing":null,"funding":null,"license":null,"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},"funding":{"github":["vindarel"],"ko_fi":"vindarel"}},"created_at":"2018-07-10T14:41:27.000Z","updated_at":"2025-06-02T05:56:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"70db30b8-145a-4e3b-9fca-2285530388b3","html_url":"https://github.com/vindarel/indent-tools","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vindarel/indent-tools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vindarel%2Findent-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vindarel%2Findent-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vindarel%2Findent-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vindarel%2Findent-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vindarel","download_url":"https://codeload.github.com/vindarel/indent-tools/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vindarel%2Findent-tools/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28931079,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T04:05:25.756Z","status":"ssl_error","status_checked_at":"2026-01-31T04:02:35.005Z","response_time":128,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-10-31T13:17:30.798Z","updated_at":"2026-01-31T06:03:39.429Z","avatar_url":"https://github.com/vindarel.png","language":"Emacs Lisp","funding_links":["https://github.com/sponsors/vindarel","https://ko-fi.com/vindarel"],"categories":[],"sub_categories":[],"readme":"* indent-tools\n\n[[https://melpa.org/#/indent-tools][file:https://melpa.org/packages/indent-tools-badge.svg]]\n\nIndent,  move around  and  act  on code  based  on indentation  (yaml,\npython, jade, etc).\n\nMeant for indentation-based  languages, but can be used  any time with\nindented text.\n\n_Example:_\n\nNavigating by blocks:\n\n#+BEGIN_HTML\n \u003cimg src=\"https://gitlab.com/emacs-stuff/indent-tools/raw/master/demo.gif\" \u003c/img\u003e\n#+END_HTML\n\n_Indenting_:\n\n#+BEGIN_HTML\n \u003cimg src=\"https://gitlab.com/emacs-stuff/indent-tools/raw/master/demo-indent.gif\" \u003c/img\u003e\n#+END_HTML\n\n** Installation\n\nSet up [[http://wikemacs.org/wiki/Package.el][MELPA]] and use [[http://wikemacs.org/wiki/Package.el][package.el]]: =M-x package-install RET indent-tools RET=.\n\n** Usage\n\nYou can activate a minor mode or use an [[https://github.com/abo-abo/hydra/][Hydra]].\n\nWe  recommand you  to use  the hydra  because it  shows all  available\noptions and it allows to call an  action multiple times in a row, with\na single keypress:\n: M-x indent-tools-hydra/body\n\nTo bind the Hydra at =C-c \u003e=:\n#+BEGIN_SRC emacs-lisp\n(require 'indent-tools)\n(global-set-key (kbd \"C-c \u003e\") 'indent-tools-hydra/body)\n#+END_SRC\n\nTo bind this in python-mode:\n#+BEGIN_SRC emacs-lisp\n(add-hook 'python-mode-hook\n (lambda () (define-key python-mode-map (kbd \"C-c \u003e\") 'indent-tools-hydra/body))\n)\n#+END_SRC\n(=C-c \u003e= originally bound to indent the line).\n\nWith the minor mode (=M-x indent-tools-minor-mode=), the prefix key is\nat     =C-c      \u003e=     (you      can     change      the     variable\n=indent-tools-keymap-prefix=).   See   its    keymap   with   =C-h   f\nindent-tools-minor-mode=.\n\n*** Indent, de-indent\n\nIndent an  indentation tree: =M-x indent-tools-demote=.   This indents\naccording to  the major  mode (currently specially  supported: python,\njade,     yaml.     For     other     modes,     it     indents     by\n=indent-tools-indent-offset=, 4 spaces).\n\nWith the hydra, repeat this action as much as you wish.\n\nIndent by only *one space* (useful for jade-mode): =SPC= key with the hydra.\n\nIndent  the *paragraph*:  =M-x indent-tools-indent-paragraph=,  or =P=\nwith the hydra.\n\nSee also: (de)indenting until the end of the current indentation level\n(i.e., indent every nodes with the same level).\n\n*** Move around\n\n Move to the *end of the current indentation*,\n\n to the *next* or the *previous sibling* (a line with the same indentation),\n\n move  *one parent  up* or  the  first *child  down* (line  with lesser  or\n greater indentation), much useful for a  large yaml file, but also for\n code navigation.\n\n *j* and *k* (with the hydra) as usual go to the next and previous line.\n\n*** Recenter screen (L)\n\nWhile you  move around, you may  want to recenter the  screen, what we\nusually do with =C-l= (\"recenter-top-bottom\"). We can not bind control\nkeys into hydras,  so this is bound to =L=.  Successive calls will put\nthe point in the middle, at the top or at the bottom of the screen.\n\n*** Kill, copy, (un)comment, select, fold\n\nSee the  hydra.\n\nSome actions (kill, copy, comment) will  ask you again what to operate\nupon: the indented block, the whole level, or the paragraph.\n\nOther actions (toggle fold) act straight away on the indented block.\n\nSo one can:\n\n- kill something\n- copy\n- comment\n- uncomment (only a paragraph)\n- toggle the fold (of the current indentation)\n- call imenu to go to another function definition, keeping the hydra.\n\n\nThere are interactive functions too:\n\n : M-x indent-tools-kill-[hydra/body, tree, level, paragraph]\n\n Copying:\n\n : M-x indent-tools-copy-[hydra/body, tree, level, paragraph]\n\n\n*** Undo\n\nThe hydra  binds =_= to =undo-tree-undo=,  so we can try  commands and\nundo anything by staying inside it.\n\n** Configure\n\nTo   know  the   indentation   of  the   current   major  mode,   call\n=indent-tools-indentation-of-current-mode=.\n\nIf   it   doesn't   know   the  current   mode,   see   the   variable\n=indent-tools-indentation-of-modes-alist=.   It  is   an  alist  which\nassociates a mode to a  function which returns the desired indentation\nlevel (an int).\n\nIf   no  indentation   level  is   known  for   this  mode,   it  uses\n=indent-tools-indentation-offset=,    which    defaults   to    Emacs'\n=standard-indent=.\n\nExample:\n\n#+BEGIN_SRC emacs-lisp\n(defun indent-tools-indentation-of-python ()\n  \"Return Python's current indentation as an int, usually 4.\"\n  (cond ((and (boundp 'python-indent-offset)\n              (numberp python-indent-offset))\n         python-indent-offset)))\n\n;; The alist.\n(setq indent-tools-indentation-of-modes-alist\n      '(\n        (python-mode . indent-tools-indentation-of-python)\n        (yaml-mode . indent-tools-indentation-of-yaml)\n        (jade-mode . indent-tools-indentation-of-jade)\n       ))\n#+END_SRC\n\n** Develop\n\nTo run the unit tests, go into the tests file and run *ert*:\n: M-x ert\nand either choose a specific test, either keep =t= to run all.\n\nYou'll have an ert buffer with passing tests in green, failing ones in\nred. Use TAB end ENTER in this buffer (à la org-mode).\n\n** Ideas, todos\n\n[X] Demote.\n\n[X] Indent according to mode. Done for python, yaml and jade.\n\n[X] Do something with the default  behaviour of =M-x indent-rigidly= which\nlets us indent  interactively. Would be useful for  jade templates. =\u003e\njust used the Hydra feature.\n\n[X] See if  the utilities functions  of mine  on [[https://gitlab.com/emacs-stuff/my-elisp/blob/master/yaml-utils.el][yaml-utils]] can  be useful\n(indent all siblings at once ? Move around siblings ?).\n\nSee `move-text` in melpa to move regions up and down.\n\n[X] See how [[https://github.com/zenozeng/yafolding.el/blob/master/yafolding.el][yafolding]] did.\n\n** See also\n- [[http://wikemacs.org/wiki/Json#json-navigator_-_navigate_json_presented_as_a_tree][json-navigator]] - to display any JSON document as a tree,\n  which leafs  you can unfold  and follow.  (Emacs 25.1) Based  on the\n  more generic [[https://github.com/DamienCassou/hierarchy][hierarchy]].\n** Change log\n\n- \u003c2018-01-24 mer.\u003e simplify  =Kill=: it kills the  indented block, no\n  more choice  to kill a  paragraph or all the  level in a  hydra, not\n  fitting in this package.\n- \u003c2017-08-03 jeu.\u003e =L= insteal of =C-l= to recenter the screen (\"recenter-top-bottom\").\n- \u003c2017-07-21 ven.\u003e undo-tree within the hydra (press \"_\")\n- \u003c2017-07-21 ven.\u003e small  fix for \"\u003e\" indent: go to  the beginning of text before action.\n- \u003c2017-03-22 mer.\u003e added Uncomment the paragraph\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvindarel%2Findent-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvindarel%2Findent-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvindarel%2Findent-tools/lists"}