{"id":13479594,"url":"https://github.com/terryma/vim-multiple-cursors","last_synced_at":"2026-04-07T15:30:18.329Z","repository":{"id":8015693,"uuid":"9424390","full_name":"terryma/vim-multiple-cursors","owner":"terryma","description":"True Sublime Text style multiple selections for Vim","archived":false,"fork":false,"pushed_at":"2020-07-30T19:52:03.000Z","size":1339,"stargazers_count":7949,"open_issues_count":1,"forks_count":245,"subscribers_count":136,"default_branch":"master","last_synced_at":"2025-01-01T08:28:42.363Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Vim script","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/terryma.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"MIT-LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-04-14T04:27:28.000Z","updated_at":"2024-12-27T13:21:05.000Z","dependencies_parsed_at":"2022-06-26T00:39:22.580Z","dependency_job_id":null,"html_url":"https://github.com/terryma/vim-multiple-cursors","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terryma%2Fvim-multiple-cursors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terryma%2Fvim-multiple-cursors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terryma%2Fvim-multiple-cursors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terryma%2Fvim-multiple-cursors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/terryma","download_url":"https://codeload.github.com/terryma/vim-multiple-cursors/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239970706,"owners_count":19727014,"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":[],"created_at":"2024-07-31T16:02:19.778Z","updated_at":"2026-04-07T15:30:18.267Z","avatar_url":"https://github.com/terryma.png","language":"Vim script","funding_links":[],"categories":["Vim Script","Block insert","Vim script","Included Plugins","Plugins","What's in it?"],"sub_categories":["Example configuration for temporary files","Install for multiple users","Plugins \u0026 themes"],"readme":"# **❗ This plugin is deprecated, use [vim-visual-multi](https://github.com/mg979/vim-visual-multi) instead ❗**\n\n# vim-multiple-cursors\n[![Build Status](https://travis-ci.org/terryma/vim-multiple-cursors.svg?branch=master)](https://travis-ci.org/github/terryma/vim-multiple-cursors)\n\n## Contents\n - [About](#about)\n - [Installation](#installation)\n - [Quick Start](#quick-start)\n - [Mapping](#mapping)\n - [Settings](#settings)\n - [Interactions with other plugins](#interactions-with-other-plugins)\n - [Highlight](#highlight)\n - [FAQ](#faq)\n - [Contributing](#contributing)\n - [Credit](#credit)\n\n## About\n[There](https://github.com/paradigm/vim-multicursor) [have](https://github.com/felixr/vim-multiedit) [been](https://github.com/hlissner/vim-multiedit) [many](https://github.com/adinapoli/vim-markmultiple) [attempts](https://github.com/AndrewRadev/multichange.vim) at bringing Sublime Text's awesome [multiple selection][sublime-multiple-selection] feature into Vim, but none so far have been in my opinion a faithful port that is simplistic to use, yet powerful and intuitive enough for an existing Vim user. [vim-multiple-cursors] is yet another attempt at that.\n\n### It's great for quick refactoring\n![Example1](assets/example1.gif?raw=true)\n\nVim command sequence: `fp\u003cC-n\u003e\u003cC-n\u003e\u003cC-n\u003ecname`\n\n### Add a cursor to each line of your visual selection\n![Example2](assets/example2.gif?raw=true)\n\nVim command sequence: `vip\u003cC-n\u003ei\"\u003cRight\u003e\u003cRight\u003e\u003cRight\u003e\",\u003cEsc\u003evipgJ$r]Idays = [`\n\n### Match characters from visual selection\n![Example3](assets/example3.gif?raw=true)\n\nVim command sequence: `df[$r,0f,v\u003cC-n\u003e…\u003cC-n\u003ec\u003cCR\u003e\u003cUp\u003e\u003cDel\u003e\u003cRight\u003e\u003cRight\u003e\u003cRight\u003e\u003cDel\u003e`\n\n### Use the command to match regexp\n![Example4](assets/example4.gif?raw=true)\n\nTo see what keystrokes are used for the above examples, see [the wiki page](https://github.com/terryma/vim-multiple-cursors/wiki/Keystrokes-for-example-gifs).\n\n## Installation\nInstall using [Pathogen], [Vundle], [Neobundle], [vim-plug], or your favorite Vim package manager.\n\nRequires vim 7.4 or newer for full functionality.\n\n### vim-plug instructions\n\n1. Paste this block into the top of `~/.vimrc`.\n\n```vim script\ncall plug#begin()\n\nPlug 'terryma/vim-multiple-cursors'\n\ncall plug#end()\n```\n\n2. Start vim and execute `:PlugInstall`.\n\n## Quick Start\n### normal mode / visual mode\n  * start:          `\u003cC-n\u003e` start multicursor and add a _virtual cursor + selection_ on the match\n    * next:         `\u003cC-n\u003e` add a new _virtual cursor + selection_ on the next match\n    * skip:         `\u003cC-x\u003e` skip the next match\n    * prev:         `\u003cC-p\u003e` remove current _virtual cursor + selection_ and go back on previous match\n  * select all:     `\u003cA-n\u003e` start multicursor and directly select all matches\n\nYou can now change the _virtual cursors + selection_ with **visual mode** commands.\nFor instance: `c`, `s`, `I`, `A` work without any issues.\nYou could also go to **normal mode** by pressing `v` and use normal commands there.\n\nAt any time, you can press `\u003cEsc\u003e` to exit back to regular Vim.\n\n**NOTE**: start with `g\u003cC-n\u003e` to match without boundaries (behaves like `g*` instead of `*`)\n\n### visual mode when multiple lines are selected\n  * start: `\u003cC-n\u003e` add _virtual cursors_ on each line\n\nYou can now change the _virtual cursors_ with **normal mode** commands.\nFor instance: `ciw`.\n\n### command\nThe command `MultipleCursorsFind` accepts a range and a pattern (regexp), it creates a _visual cursor_ at the end of each match.\nIf no range is passed in, then it defaults to the entire buffer.\n\n\n## Mapping\nIf you don't like the plugin taking over your key bindings, you can turn it off and reassign them the way you want:\n```viml\nlet g:multi_cursor_use_default_mapping=0\n\n\" Default mapping\nlet g:multi_cursor_start_word_key      = '\u003cC-n\u003e'\nlet g:multi_cursor_select_all_word_key = '\u003cA-n\u003e'\nlet g:multi_cursor_start_key           = 'g\u003cC-n\u003e'\nlet g:multi_cursor_select_all_key      = 'g\u003cA-n\u003e'\nlet g:multi_cursor_next_key            = '\u003cC-n\u003e'\nlet g:multi_cursor_prev_key            = '\u003cC-p\u003e'\nlet g:multi_cursor_skip_key            = '\u003cC-x\u003e'\nlet g:multi_cursor_quit_key            = '\u003cEsc\u003e'\n```\n\n**NOTE:** Please make sure to always map something to `g:multi_cursor_quit_key`, otherwise you'll have a tough time quitting from multicursor mode.\n\n## Settings\nCurrently there are four additional global settings one can tweak:\n\n### ```g:multi_cursor_support_imap``` (Default: 1)\nIf set to 0, insert mappings won't be supported in _Insert_ mode anymore.\n\n### ```g:multi_cursor_exit_from_visual_mode``` (Default: 0)\nIf set to 1, then pressing `g:multi_cursor_quit_key` in _Visual_ mode will quit and\ndelete all existing cursors, just skipping normal mode with multiple cursors.\n\n### ```g:multi_cursor_exit_from_insert_mode``` (Default: 0)\nIf set to 1, then pressing `g:multi_cursor_quit_key` in _Insert_ mode will quit and\ndelete all existing cursors, just skipping normal mode with multiple cursors.\n\n### ```g:multi_cursor_normal_maps``` (Default: see below)\n`{'@': 1, 'F': 1, 'T': 1, '[': 1, '\\': 1, ']': 1, '!': 1, '\"': 1, 'c': 1, 'd': 1, 'f': 1, 'g': 1, 'm': 1, 'q': 1, 'r': 1, 't': 1, 'y': 1, 'z': 1, '\u003c': 1, '=': 1, '\u003e': 1}`\n\nAny key in this map (values are ignored) will cause multi-cursor _Normal_ mode\nto pause for map completion just like normal vim. Otherwise keys mapped in\nnormal mode will \"fail to replay\" when multiple cursors are active.\nFor example: `{'d':1}` makes normal-mode command `dw` work in multi-cursor mode.\n\nThe default list contents should work for anybody, unless they have remapped a\nkey from an operator-pending command to a non-operator-pending command or\nvice versa.\n\nThese keys must be manually listed because vim doesn't provide a way to\nautomatically see which keys _start_ mappings, and trying to run motion commands\nsuch as `j` as if they were operator-pending commands can break things.\n\n### ```g:multi_cursor_visual_maps``` (Default: see below)\n`{'T': 1, 'a': 1, 't': 1, 'F': 1, 'f': 1, 'i': 1}`\n\nSame principle as `g:multi_cursor_normal_maps`\n\n### Interactions with other plugins\n\n### ```Multiple_cursors_before/Multiple_cursors_after``` (Default: `nothing`)\n\nOther plugins may be incompatible in insert mode.\nThat is why we provide hooks to disable those plug-ins when vim-multiple-cursors is active:\n\nFor example, if you are using [Neocomplete](https://github.com/Shougo/neocomplete.vim),\nadd this to your vimrc to prevent conflict:\n\n```viml\nfunction! Multiple_cursors_before()\n  if exists(':NeoCompleteLock')==2\n    exe 'NeoCompleteLock'\n  endif\nendfunction\n\nfunction! Multiple_cursors_after()\n  if exists(':NeoCompleteUnlock')==2\n    exe 'NeoCompleteUnlock'\n  endif\nendfunction\n```\n\nPlugins themselves can register `User` autocommands on `MultipleCursorsPre` and\n`MultipleCursorsPost` for automatic integration.\n\n### Highlight\nThe plugin uses the highlight group `multiple_cursors_cursor` and `multiple_cursors_visual` to highlight the virtual cursors and their visual selections respectively. You can customize them by putting something similar like the following in your vimrc:\n\n```viml\n\" Default highlighting (see help :highlight and help :highlight-link)\nhighlight multiple_cursors_cursor term=reverse cterm=reverse gui=reverse\nhighlight link multiple_cursors_visual Visual\n```\n\n## FAQ\n\n#### **Q**  Pressing \u003ckbd\u003ei\u003c/kbd\u003e after selecting words with \u003ckbd\u003eC-n\u003c/kbd\u003e makes the plugin hang, why?\n**A** When selecting words with \u003ckbd\u003eC-n\u003c/kbd\u003e, the plugin behaves like in **visual** mode.\nOnce you pressed \u003ckbd\u003ei\u003c/kbd\u003e, you can still press \u003ckbd\u003eI\u003c/kbd\u003e to insert text.\n\n#### **Q** \u003ckbd\u003eALT\u003c/kbd\u003e+\u003ckbd\u003en\u003c/kbd\u003e doesn't seem to work in VIM but works in gVIM, why?\n**A** This is a well known terminal/Vim [issue](http://vim.wikia.com/wiki/Get_Alt_key_to_work_in_terminal), different terminal have different ways to send ```Alt+key```.\nTry adding this in your `.vimrc` and **make sure to replace the string**:\n```vim\nif !has('gui_running')\n  map \"in Insert mode, type Ctrl+v Alt+n here\" \u003cA-n\u003e\nendif\n```\nOr remap the following:\n```vim\ng:multi_cursor_start_key\ng:multi_cursor_select_all_key\n```\n\n#### **Q** \u003ckbd\u003eCTRL\u003c/kbd\u003e+\u003ckbd\u003en\u003c/kbd\u003e doesn't seem to work in gVIM?\n**A** Try setting `set selection=inclusive` in your `~/.gvimrc`\n\n**A** Alternatively, you can just temporarily disable _exclusive_ selection whenever the plugin is active:\n```VimL\naugroup MultipleCursorsSelectionFix\n    autocmd User MultipleCursorsPre  if \u0026selection ==# 'exclusive' | let g:multi_cursor_save_selection = \u0026selection | set selection=inclusive | endif\n    autocmd User MultipleCursorsPost if exists('g:multi_cursor_save_selection') | let \u0026selection = g:multi_cursor_save_selection | unlet g:multi_cursor_save_selection | endif\naugroup END\n```\n\n### **Q** deoplete insert giberrish, how to fix this?\n**A** use the `Multiple_cursors` functions, add this in your vimrc:\n\n```VimL\n    func! Multiple_cursors_before()\n      if deoplete#is_enabled()\n        call deoplete#disable()\n        let g:deoplete_is_enable_before_multi_cursors = 1\n      else\n        let g:deoplete_is_enable_before_multi_cursors = 0\n      endif\n    endfunc\n    func! Multiple_cursors_after()\n      if g:deoplete_is_enable_before_multi_cursors\n        call deoplete#enable()\n      endif\n    endfunc\n```\n\n#### **Q** is it also working on Mac?\n**A** On Mac OS, [MacVim](https://code.google.com/p/macvim/) is known to work.\n\n#### **Q** How can I select `n` keywords with several keystrokes? `200\u003cC-n\u003e` does not work.\n**A** You can use :MultipleCursorsFind keyword. I have this binding in my vimrc:\n\n```VimL\nnnoremap \u003csilent\u003e \u003cM-j\u003e :MultipleCursorsFind \u003cC-R\u003e/\u003cCR\u003e\nvnoremap \u003csilent\u003e \u003cM-j\u003e :MultipleCursorsFind \u003cC-R\u003e/\u003cCR\u003e\n```\n\nThis allows one to search for the keyword using `*` and turn search results into cursors with `Alt-j`.\n\n\n## Contributing\nPatches and suggestions are always welcome! A list of open feature requests can be found [here](https://github.com/terryma/vim-multiple-cursors/labels/pull%20request%20welcome).\n\n### Issue Creation\nContributor's time is precious and limited. Please ensure it meets the requirements outlined in [CONTRIBUTING.md](CONTRIBUTING.md).\n\n### Pull Requests\nRunning the test suite requires ruby and rake as well as vim of course. Before submitting PR, please ensure the checks are passing:\n```bash\ncd vim-multiple-cursors/spec/\nbundle exec rake\n```\n\n### Contributors\nThis is a community supported project. Here is the list of all the [Contributors](https://github.com/terryma/vim-multiple-cursors/graphs/contributors)\n\n## Credit\nObviously inspired by Sublime Text's [multiple selection][sublime-multiple-selection] feature, also encouraged by Emac's [multiple cursors][emacs-multiple-cursors] implementation by Magnar Sveen\n\n[vim-multiple-cursors]:http://github.com/terryma/vim-multiple-cursors\n[sublime-multiple-selection]:http://www.sublimetext.com/docs/2/multiple_selection_with_the_keyboard.html\n[Pathogen]:http://github.com/tpope/vim-pathogen\n[Vundle]:http://github.com/gmarik/vundle\n[Neobundle]:http://github.com/Shougo/neobundle.vim\n[vim-plug]:https://github.com/junegunn/vim-plug\n[emacs-multiple-cursors]:https://github.com/magnars/multiple-cursors.el\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterryma%2Fvim-multiple-cursors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fterryma%2Fvim-multiple-cursors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterryma%2Fvim-multiple-cursors/lists"}