{"id":13862811,"url":"https://github.com/colonelpanic8/multi-line","last_synced_at":"2025-03-21T17:31:53.456Z","repository":{"id":45047656,"uuid":"46647489","full_name":"colonelpanic8/multi-line","owner":"colonelpanic8","description":"multi-line everything from function invocations and definitions to array and map literals in a wide variety of languages","archived":false,"fork":false,"pushed_at":"2023-07-21T18:15:35.000Z","size":199,"stargazers_count":55,"open_issues_count":7,"forks_count":6,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-04-13T14:07:03.429Z","etag":null,"topics":["emacs","emacs-lisp","whitespace"],"latest_commit_sha":null,"homepage":"","language":"Emacs Lisp","has_issues":true,"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/colonelpanic8.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}},"created_at":"2015-11-22T05:15:52.000Z","updated_at":"2024-01-13T03:58:58.000Z","dependencies_parsed_at":"2023-08-09T23:43:45.051Z","dependency_job_id":"9444e617-cb52-4e90-97b4-ab4777920667","html_url":"https://github.com/colonelpanic8/multi-line","commit_stats":null,"previous_names":["colonelpanic8/multi-line"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colonelpanic8%2Fmulti-line","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colonelpanic8%2Fmulti-line/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colonelpanic8%2Fmulti-line/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colonelpanic8%2Fmulti-line/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/colonelpanic8","download_url":"https://codeload.github.com/colonelpanic8/multi-line/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221817172,"owners_count":16885473,"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","whitespace"],"created_at":"2024-08-05T06:01:53.135Z","updated_at":"2024-10-28T10:31:30.761Z","avatar_url":"https://github.com/colonelpanic8.png","language":"Emacs Lisp","funding_links":[],"categories":["Emacs Lisp"],"sub_categories":[],"readme":"# -*- mode: org; -*-\n\n#+HTML_HEAD: \u003clink rel=\"stylesheet\" type=\"text/css\" href=\"http://www.pirilampo.org/styles/readtheorg/css/htmlize.css\"/\u003e\n#+HTML_HEAD: \u003clink rel=\"stylesheet\" type=\"text/css\" href=\"http://www.pirilampo.org/styles/readtheorg/css/readtheorg.css\"/\u003e\n\n#+HTML_HEAD: \u003cscript src=\"https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js\"\u003e\u003c/script\u003e\n#+HTML_HEAD: \u003cscript src=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js\"\u003e\u003c/script\u003e\n#+HTML_HEAD: \u003cscript type=\"text/javascript\" src=\"http://www.pirilampo.org/styles/lib/js/jquery.stickytableheaders.js\"\u003e\u003c/script\u003e\n#+HTML_HEAD: \u003cscript type=\"text/javascript\" src=\"http://www.pirilampo.org/styles/readtheorg/js/readtheorg.js\"\u003e\u003c/script\u003e\n\n[[https://travis-ci.org/IvanMalison/multi-line][file:https://travis-ci.org/IvanMalison/multi-line.svg?branch=master]]\n[[http://melpa.org/#/multi-line][file:https://melpa.org/packages/multi-line-badge.svg]]\n[[https://stable.melpa.org/#/multi-line][file:https://stable.melpa.org/packages/multi-line-badge.svg]]\n\n* Demo\n[[https://asciinema.org/a/dwft2l94f75x9l46wmdhbm5lh?t=4][https://asciinema.org/a/dwft2l94f75x9l46wmdhbm5lh.png]]\n\n* About\nmulti-line aims to provide a flexible framework for automatically\nmulti-lining and single-lining function invocations and definitions,\narray and map literals and more. It relies on functions that are\ndefined on a per major mode basis wherever it can so that it operates\ncorrectly across many different programming languages.\n\n* Supported Languages\nThe following languages are officially supported by multi-line\n- C/C++\n- clojure\n- emacs-lisp\n- golang\n- java\n- javascript\n- python\n- ruby\n- rust\n- scala\n\nIt is likely that multi-line will function pretty well in any language using\ntypical brace/parenthesis/comma syntax, provided that the major mode has\nproperly defined ~forward-sexp~ and ~indent-line~. If you find that multi-line\nworks well without modification in your language of choice please file an issue\nor submit a pull request to have it added to the list of officially supported\nlanguages.\n* Installation\nInstall from MELPA with ~M-x package-install multi-line~. See the [[https://github.com/milkypostman/melpa][melpa\nrepository]] for details about how to set up MELPA if you have not already done\nso.\n* Setup\n#+BEGIN_SRC emacs-lisp\n(require 'multi-line)\n(global-set-key (kbd \"C-c d\") 'multi-line)\n#+END_SRC\n* Usage\nExecute the ~multi-line~ command (with M-x or a keybinding) inside the body of\nthe expression you wish to multi-line, as show in the demo above. Invoking\nmulti-line multiple times on the same definition will cycle between the\ndifferent respacing styles that are configured for the current buffer.\n\nWhen invoked with a prefix argument (~C-u~), multi-line will \"single-line\" the\nexpression at point, removing all new lines and replacing them with spaces (or\nthe character configured for single lining).\n* Configuration\nmulti-line can be configured to behave differently depending on the major mode\nof the current-buffer. The behavior of multi-line is described with a\nmulti-line-strategy object that has three components: a find-strategy, an\nenter-strategy and a replace-strategy. The ~multi-line-defhook~ macro can be\nused to set a major mode specific multi-lining strategy. The strategy defined\nwith the defhook will become active in any buffers with the specified mode.\n\nIn the following example we set the default multi-lining behavior for the\nclojure programming language.\n\n#+BEGIN_SRC emacs-lisp\n(multi-line-defhook clojure\n  (make-instance multi-line-strategy\n   :find (make-instance multi-line-forward-sexp-find-strategy\n          :split-regex \"[[:space:]\\n]+\"\n          :done-regex \"[[:space:]]*)]}\"\n          :split-advance-fn 'multi-line-lisp-advance-fn)\n   :respace multi-line-lisp-respacer))\n#+END_SRC\n\nThis expands to\n\n#+BEGIN_SRC emacs-lisp\n(eval-and-compile\n  (defvar multi-line-clojure-strategy)\n  (setq multi-line-clojure-strategy\n        (make-instance multi-line-strategy\n                       :find\n                       (make-instance multi-line-forward-sexp-find-strategy\n                                      :split-regex \"[[:space:]]+\"\n                                      :done-regex \"[[:space:]]*)]}\"\n                                      :split-advance-fn 'multi-line-lisp-advance-fn)\n                       :respace multi-line-lisp-respacer))\n  (defun multi-line-clojure-mode-hook nil\n    (setq-local multi-line-current-strategy multi-line-clojure-strategy))\n  (add-hook 'clojure-mode-hook 'multi-line-clojure-mode-hook t))\n#+END_SRC\n\nUsers will most often want to configure the respacing portion of the multi-line\nstrategy. If you prefer to always add a newline at every available split point\nyou might set up the default multi-line strategy as follows:\n\n#+BEGIN_SRC emacs-lisp\n(setq-default multi-line-current-strategy\n              (multi-line-strategy\n               :respace (multi-line-default-respacers\n                         (make-instance multi-line-always-newline))))\n#+END_SRC\n** Built-in Mode Specific Behavior\nmulti-line has some built in mode specific behavior that is enabled by default.\nThe interactive function ~multi-line-disable-mode-hooks~ disables this mode\nspecific behavior.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolonelpanic8%2Fmulti-line","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcolonelpanic8%2Fmulti-line","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolonelpanic8%2Fmulti-line/lists"}