{"id":13522852,"url":"https://github.com/gabesoft/evil-mc","last_synced_at":"2025-03-31T23:32:32.516Z","repository":{"id":36561567,"uuid":"40867460","full_name":"gabesoft/evil-mc","owner":"gabesoft","description":"Multiple cursors implementation for evil-mode","archived":false,"fork":false,"pushed_at":"2024-10-25T20:45:13.000Z","size":401,"stargazers_count":398,"open_issues_count":41,"forks_count":37,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-05T01:36:04.013Z","etag":null,"topics":["emacs","evil","multiple-cursors","vim"],"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/gabesoft.png","metadata":{"files":{"readme":"README.org","changelog":null,"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":"2015-08-17T05:44:33.000Z","updated_at":"2025-01-20T17:14:35.000Z","dependencies_parsed_at":"2024-05-30T01:27:37.557Z","dependency_job_id":"9c668cb5-d206-408d-9436-286313eb3588","html_url":"https://github.com/gabesoft/evil-mc","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabesoft%2Fevil-mc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabesoft%2Fevil-mc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabesoft%2Fevil-mc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabesoft%2Fevil-mc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gabesoft","download_url":"https://codeload.github.com/gabesoft/evil-mc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246558108,"owners_count":20796696,"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","evil","multiple-cursors","vim"],"created_at":"2024-08-01T06:00:52.954Z","updated_at":"2025-03-31T23:32:27.497Z","avatar_url":"https://github.com/gabesoft.png","language":"Emacs Lisp","funding_links":[],"categories":["Customize Module","Emacs Lisp"],"sub_categories":[],"readme":": ▓█████ ██▒   █▓ ██▓ ██▓        ███▄ ▄███▓ ▄████▄  \n: ▓█   ▀▓██░   █▒▓██▒▓██▒       ▓██▒▀█▀ ██▒▒██▀ ▀█  \n: ▒███   ▓██  █▒░▒██▒▒██░       ▓██    ▓██░▒▓█    ▄ \n: ▒▓█  ▄  ▒██ █░░░██░▒██░       ▒██    ▒██ ▒▓▓▄ ▄██▒\n: ░▒████▒  ▒▀█░  ░██░░██████▒   ▒██▒   ░██▒▒ ▓███▀ ░\n: ░░ ▒░ ░  ░ ▐░  ░▓  ░ ▒░▓  ░   ░ ▒░   ░  ░░ ░▒ ▒  ░\n:  ░ ░  ░  ░ ░░   ▒ ░░ ░ ▒  ░   ░  ░      ░  ░  ▒   \n:    ░       ░░   ▒ ░  ░ ░      ░      ░   ░        \n:    ░  ░     ░   ░      ░  ░          ░   ░ ░      \n:            ░                             ░        \n\n [[https://travis-ci.org/gabesoft/evil-mc][https://travis-ci.org/gabesoft/evil-mc.svg?branch=master]] [[http://melpa.org/#/evil-mc][file:http://melpa.org/packages/evil-mc-badge.svg?style=flat-square]] [[http://melpa.org/#/evil-mc][file:http://stable.melpa.org/packages/evil-mc-badge.svg?style=flat-square]]\n\n** Multiple cursors implementation for evil-mode\n*** Synopsis\n*evil-mc* provides multiple cursors functionality for Emacs when used with *evil-mode* \n*** Usage\nStart with:\n#+BEGIN_SRC emacs-lisp\n (require 'evil-mc)\n#+END_SRC\n**** Local Setup\nTo enable or disable *evil-mc* mode for a single buffer use:\\\\\n#+BEGIN_SRC emacs-lisp\n(evil-mc-mode  1) ;; enable\n(evil-mc-mode -1) ;; disable\n#+END_SRC\n**** Global Setup\nTo enable or disable *evil-mc* mode for all buffers use:\\\\\n#+BEGIN_SRC emacs-lisp\n(global-evil-mc-mode  1) ;; enable\n(global-evil-mc-mode -1) ;; disable\n#+END_SRC\n**** Basic Usage\nThe main commands used to create or delete cursors are:\n\n#+BEGIN_SRC emacs-lisp\n(evil-mc-make-all-cursors)\n;; Create cursors for all strings that match the selected \n;; region or the symbol under cursor.\n\n(evil-mc-undo-all-cursors)\n;; Remove all cursors.\n\n(evil-mc-make-and-goto-next-match)\n;; Make a cursor at point and go to the next match of the \n;; selected region or the symbol under cursor.\n\n(evil-mc-skip-and-goto-next-match)\n;; Go to the next match of the selected region or the symbol under \n;; cursor without creating a cursor at point.\n#+END_SRC\n\nThe above commands as well as others, detailed below, are setup with key bindings\nwhen the *evil-mc* mode is enabled. The keys are defined in ~evil-mc-key-map~. You can \ntake a look at that variable declaration in [[https://github.com/gabesoft/evil-mc/blob/master/evil-mc.el][evil-mc.el]] to see all key bindings. But,\nin short, ~C-n~ / ~C-p~ are used for creating cursors, and ~M-n~ / ~M-p~\nare used for cycling through cursors. The commands that create cursors wrap around; but, \nthe ones that cycle them do not. \nTo skip creating a cursor forward use ~C-t~ or ~grn~ and backward ~grp~. \nFinally use ~gru~ to \"undo\" the last added cursor, and ~grq~ to remove all cursors.\n\nOptionally set up visual mode keybindings for ~I~ and ~A~ to create cursors at the\nbeginning or end of every visually selected line.\n\n#+BEGIN_SRC emacs-lisp\n(evil-define-key 'visual evil-mc-key-map\n  \"A\" #'evil-mc-make-cursor-in-visual-selection-end\n  \"I\" #'evil-mc-make-cursor-in-visual-selection-beg)\n#+END_SRC\n\nFor an example of setting up *evil-mc* see this [[https://github.com/gabesoft/evil-mc/blob/master/evil-mc-setup.el][setup file]]\n**** Commands\nHere's a detailed list of all commands used to create, navigate through, or delete cursors:\\\\\n/All the commands below assume that there is a real cursor and possibly some fake cursors./\n\n#+BEGIN_SRC emacs-lisp\n(evil-mc-make-all-cursors)\n;; Make a cursor for every match of the selected region or the symbol at point.\n\n(evil-mc-undo-all-cursors)\n;; Remove all cursors.\n\n(evil-mc-undo-last-added-cursor)\n;; Remove the last added cursor and move point to its position.\n\n(evil-mc-make-and-goto-next-match)\n;; Make a cursor at point, and go to the next match of the \n;; selected region or the symbol at point.\n\n(evil-mc-make-and-goto-prev-match)\n;; Make a cursor at point, and go to the previous match of the \n;; selected region or the symbol at point.\n\n(evil-mc-skip-and-goto-next-match)\n;; Go to the next match of the selected region or symbol at point\n;; without making a cursor at point. This command can be used to\n;; remove unwanted cursors.\n\n(evil-mc-skip-and-goto-prev-match)\n;; Go to the previous match of the selected region or symbol at point\n;; without making a cursor at point. This command can be used to\n;; remove unwanted cursors.\n\n(evil-mc-make-and-goto-prev-cursor)\n;; Make a cursor at point and move point to the cursor\n;; closest to it when searching backwards.\n\n(evil-mc-make-and-goto-next-cursor)\n;; Make a cursor at point and move point to the cursor\n;; closest to it when searching forwards.\n\n(evil-mc-skip-and-goto-prev-cursor)\n;; Move point to the cursor closest to it when searching backwards\n;; without making a cursor at point. This command can be used to\n;; remove unwanted cursors.\n\n(evil-mc-skip-and-goto-next-cursor)\n;; Move point to the cursor closest to it when searching forwards\n;; without making a cursor at point. This command can be used to\n;; remove unwanted cursors.\n\n(evil-mc-make-and-goto-first-cursor)\n;; Make a cursor at point and move point to the cursor at the first position.\n\n(evil-mc-make-and-goto-last-cursor)\n;; Make a cursor at point and move point to the cursor at the last position.\n\n(evil-mc-make-cursor-here)\n;; Create a cursor at point. This command should be used with `evil-mc-pause-cursors'.\n\n(evil-mc-pause-cursors)\n;; Pause all fake cursors. This can be used with `evil-mc-make-cursor-here'\n\n(evil-mc-resume-cursors)\n;; Call to resume paused cursors.\n\n(evil-mc-make-cursor-in-visual-selection-beg)\n;; Create cursors at the beginning of every visually selected line.\n\n(evil-mc-make-cursor-in-visual-selection-end)\n;; Create cursors at the end of every visually selected line.\n#+END_SRC\n\n**** Customization\n*evil-mc* can be customized in several ways:\n\n- Every known command is executed using a command handler defined in a variable\n  called ~evil-mc-known-commands~ in [[https://github.com/gabesoft/evil-mc/blob/master/evil-mc-known-commands.el][evil-mc-known-commands.el]]. Those can be overridden by \n  defining the ~evil-mc-custom-known-commands~ variable. See the documentation of \n  that variable in [[https://github.com/gabesoft/evil-mc/blob/master/evil-mc.el][evil-mc.el]] for more info.\n- Some minor modes are incompatible with *evil-mc*. Those modes are defined in \n  ~evil-mc-incompatible-minor-modes~ and can be overridden by defining that variable.\n- In addition there are two hooks that can be used to temporarily disable or enable \n  additional functionality while there are multiple cursors active\n  #+BEGIN_SRC emacs-lisp\n  evil-mc-before-cursors-created\n  ;; this hook runs just before the first cursor is created\n\n  evil-mc-after-cursors-created\n  ;; this hook runs just after the last cursor is deleted\n  #+END_SRC\n\n*** Mode line text and colors\nThere are 4 variables, that can change the mode lines text, and its color.\n\n**** Only one cursor\nThe ~emc~ text can be hidden, by setting this variable to ~nil~.\n(default: ~t~)\n#+BEGIN_SRC\n(setq evil-mc-one-cursor-show-mode-line-text t)\n#+END_SRC\n\n**** Two or more cursors, resumed (unpaused)\nThe resumed mode line text, can have two different colors:\n- The cursors color, when this variable is ~t~.\n- The default colors, when this variable is ~nil~.\n(default: ~t~)\n#+BEGIN_SRC\n(setq evil-mc-mode-line-text-cursor-color t)\n#+END_SRC\n\n**** Two or more cursors, paused\nThe ~(paused)~ text can be hidden, by setting this variable to ~nil~.\n(default: ~t~)\n#+BEGIN_SRC\n(setq evil-mc-mode-line-text-paused t)\n#+END_SRC\n\nThe paused mode line text can have three different colors:\n- Inverse colors, when the inverse colors variable is ~t~.\n- Cursors color, when the inverse colors variable is ~nil~, and the cursor color variable is ~t~.\n- Default colors, when both the inverse and cursor color variables are ~nil~.\n(default: ~t~, for both the inverse and cursor variables)\n#+BEGIN_SRC\n(setq evil-mc-mode-line-text-inverse-colors t)\n(setq evil-mc-mode-line-text-cursor-color t)\n#+END_SRC\n\n*** Notes\n- Most evil motions and operators are supported but not every single command will work. \n- If the cursors don't seem to work during a command, either the command is\n  not known (see ~evil-mc-known-commands~ in [[https://github.com/gabesoft/evil-mc/blob/master/evil-mc-known-commands.el][evil-mc-known-commands.el]]) or some minor modes\n  could be interfering with the evil-mc operations. \n- Issues and pull requests are welcome. \n\n**** Debugging\n- When a command does not work, and you want to get more information,\n  you can enable (or disable) debugging by running any of the commands \n  below interactively.\n  #+BEGIN_SRC emacs-lisp\n  (evil-mc-executing-debug-on)\n  ;; Turn debug on while executing a command.\n\n  (evil-mc-executing-debug-off)\n  ;; Turn debug off while executing a command.\n\n  (evil-mc-recording-debug-on)\n  ;; Turn debug on while recording a command.\n\n  (evil-mc-recording-debug-off)\n  ;; Turn debug off while recording a command.\n\n  (evil-mc-all-debug-on)\n  ;; Turn all debug on.\n\n  (evil-mc-all-debug-off)\n  ;; Turn all debug off.\n  #+END_SRC\n\n**** Limitations\n- After an undo command the cursors will return to their original positions\n  if [[http://www.emacswiki.org/emacs/UndoTree][undo-tree]] mode is enabled and ~evil-repeat~ has not been used.\n- Redo may cause the real cursor to get out of sync with the others.\n  This can be worked around by setting a mark and returning to it after a redo.\n- Jumps work if [[https://github.com/bling/evil-jumper][evil-jumper]] mode is enabled\n- Search commands such as ~evil-search-forward~, ~evil-search-backward~, and ~evil-search-next~ are not supported\n\n**** Known issues\n- Only named commands can be executed by the fake cursors.\n- There could be a performance penalty when there are too many cursors (30+).\n- Paste will not work when [[https://github.com/syl20bnr/spacemacs][spacemacs]]' paste micro state is enabled.\n  This is due to the fact that ~evil-paste-pop~ and ~evil-paste-pop-next~ \n  commands are not supported.\n- ~evil-repeat~ works only for some commands. \n  In particular it doesn't work for delete. It will also interfere with the \n  cursor positions during an undo or redo operation.\n\n\n\n* \n: .__                                            .___.__  __  .__                \n: |  |__ _____  ______ ______ ___.__.   ____   __| _/|__|/  |_|__| ____    ____  \n: |  |  \\\\__  \\ \\____ \\\\____ \u003c   |  | _/ __ \\ / __ | |  \\   __\\  |/    \\  / ___\\ \n: |   Y  \\/ __ \\|  |_\u003e \u003e  |_\u003e \u003e___  | \\  ___// /_/ | |  ||  | |  |   |  \\/ /_/  \u003e\n: |___|  (____  /   __/|   __// ____|  \\___  \u003e____ | |__||__| |__|___|  /\\___  / \n:      \\/     \\/|__|   |__|   \\/           \\/     \\/                  \\//_____/  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabesoft%2Fevil-mc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgabesoft%2Fevil-mc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabesoft%2Fevil-mc/lists"}