{"id":13850470,"url":"https://github.com/wincent/scalpel","last_synced_at":"2025-04-06T00:10:36.524Z","repository":{"id":66829541,"uuid":"57346280","full_name":"wincent/scalpel","owner":"wincent","description":"🔪 Fast within-file word replacement for Vim","archived":false,"fork":false,"pushed_at":"2025-01-24T10:07:16.000Z","size":1816,"stargazers_count":120,"open_issues_count":3,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-29T23:11:16.853Z","etag":null,"topics":["vim"],"latest_commit_sha":null,"homepage":"","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/wincent.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2016-04-29T01:46:27.000Z","updated_at":"2025-03-02T05:07:05.000Z","dependencies_parsed_at":"2023-02-21T06:16:14.379Z","dependency_job_id":"eaeb5078-c816-4b94-9c86-b26620b3e67e","html_url":"https://github.com/wincent/scalpel","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wincent%2Fscalpel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wincent%2Fscalpel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wincent%2Fscalpel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wincent%2Fscalpel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wincent","download_url":"https://codeload.github.com/wincent/scalpel/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247415973,"owners_count":20935387,"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":["vim"],"created_at":"2024-08-04T20:01:13.647Z","updated_at":"2025-04-06T00:10:36.506Z","avatar_url":"https://github.com/wincent.png","language":"Vim Script","funding_links":[],"categories":["Vim script"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/wincent/scalpel/media/scalpel.png\" /\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/wincent/scalpel/media/scalpel.gif\" /\u003e\n\u003c/p\u003e\n\n# scalpel\u003ca name=\"scalpel-scalpel\" href=\"#user-content-scalpel-scalpel\"\u003e\u003c/a\u003e\n\n\n## Intro\u003ca name=\"scalpel-intro\" href=\"#user-content-scalpel-intro\"\u003e\u003c/a\u003e\n\nScalpel provides a streamlined shortcut for replacing all instances of the word currently under the cursor throughout a file.\n\nIn normal mode pressing `\u003cLeader\u003ee` (mnemonic: \u0026quot;edit\u0026quot;) will display a prompt pre-populated with the current word and with the cursor placed so that you can start typing the desired replacement:\n\n```\n:Scalpel/\\v\u003cfoo\u003e//\n```\n\nPress `\u003cEnter\u003e` and Scalpel will prompt to confirm each substitution, starting at the current word (unlike a normal `:%s` command, which starts at the top of the file).\n\nScalpel works similarly in visual mode, except that it scopes itself to the current visual selection rather than operating over the entire file.\n\nScreencasts that show Scalpel in action:\n\n- https://youtu.be/YwMgnmZNWXA: \u0026quot;Vim screencast #13: Multiple Cursors\u0026quot;\n- https://youtu.be/7Bx_mLDBtRc: \u0026quot;Vim screencast #14: *Ncgn\u0026quot;\n- https://youtu.be/iNVyCPPYFzc: \u0026quot;Vim screencast #21: Scalpel update\u0026quot;\n\nNote that `:Scalpel` just calls through to an underlying `scalpel#substitute` function that does the real work, ultimately calling Vim's own `:substitute`. As such, be aware that whatever changes you make to the command-line prior to pressing `\u003cEnter\u003e` must keep it a valid pattern, or bad things will happen.\n\nThe mapping can be suppressed by setting:\n\n```\nlet g:ScalpelMap=0\n```\n\nOr overridden:\n\n```\n\" Use \u003cLeader\u003es instead of default \u003cLeader\u003ee:\nnmap \u003cLeader\u003es \u003cPlug\u003e(Scalpel)\n```\n\nIn any case, Scalpel won't overwrite any pre-existing mapping that you might have defined for `\u003cLeader\u003ee`, nor will it create an unnecessary redundant mapping if you've already mapped something to `\u003cPlug\u003e(Scalpel)`.\n\nThe `:Scalpel` command name can be overridden if desired. For example, you could shorten it to `:S` with:\n\n```\nlet g:ScalpelCommand='S'\n```\n\nThen your Scalpel prompt would look like:\n\n```\n:S/\\v\u003cfoo\u003e//\n```\n\nThe command can be entirely suppressed by setting `g:ScalpelCommand` to an empty string:\n\n```\nlet g:ScalpelCommand=''\n```\n\nFinally, all plug-in functionality can be deactivated by setting:\n\n```\nlet g:ScalpelLoaded=1\n```\n\nin your `~/.vimrc`.\n\n\n## Installation\u003ca name=\"scalpel-installation\" href=\"#user-content-scalpel-installation\"\u003e\u003c/a\u003e\n\nTo install Scalpel, use your plug-in management system of choice.\n\nIf you don't have a \u0026quot;plug-in management system of choice\u0026quot; and your version of Vim has `packages` support (ie. `+packages` appears in the output of `:version`) then you can simply place the plugin at a location under your `'packpath'` (eg. `~/.vim/pack/bundle/start/scalpel` or similar).\n\nFor older versions of Vim, I recommend [Pathogen](https://github.com/tpope/vim-pathogen) due to its simplicity and robustness. Assuming that you have Pathogen installed and configured, and that you want to install Scalpel into `~/.vim/bundle`, you can do so with:\n\n```\ngit clone https://github.com/wincent/scalpel.git ~/.vim/bundle/scalpel\n```\n\nAlternatively, if you use a Git submodule for each Vim plug-in, you could do the following after `cd`-ing into the top-level of your Git superproject:\n\n```\ngit submodule add https://github.com/wincent/scalpel.git ~/vim/bundle/scalpel\ngit submodule init\n```\n\nTo generate help tags under Pathogen, you can do so from inside Vim with:\n\n```\n:call pathogen#helptags()\n```\n\n\n## FAQ\u003ca name=\"scalpel-faq\" href=\"#user-content-scalpel-faq\"\u003e\u003c/a\u003e\n\n\n### Why use Scalpel rather than a built-in alternative?\u003ca name=\"scalpel-why-use-scalpel-rather-than-a-built-in-alternative\" href=\"#user-content-scalpel-why-use-scalpel-rather-than-a-built-in-alternative\"\u003e\u003c/a\u003e\n\nScalpel is a lightweight plug-in that provides subtle but valuable improvements to the experience you'd get by using Vim's built-in functionality.\n\nCompared to writing a \u003cstrong\u003e`:substitute`\u003c/strong\u003e command manually:\n\n- Scalpel is quickly activated by a mapping.\n- Scalpel prepopulates the search pattern with the word currently under the cursor.\n- Scalpel avoids a jarring jump to the top of the file, instead starting replacements at the current location.\n\nCompared to a mapping such as \u0026quot;*Ncgn\u0026quot;:\n\n- Scalpel allows you to preview the location at which each change will occur instead of performing the change blindly.\n\n\n## Website\u003ca name=\"scalpel-website\" href=\"#user-content-scalpel-website\"\u003e\u003c/a\u003e\n\nSource code:\n\n- https://github.com/wincent/scalpel\n- https://gitlab.com/wincent/scalpel\n- https://bitbucket.org/ghurrell/scalpel\n\nOfficial releases are listed at:\n\nhttp://www.vim.org/scripts/script.php?script_id=5381\n\n\n## License\u003ca name=\"scalpel-license\" href=\"#user-content-scalpel-license\"\u003e\u003c/a\u003e\n\nCopyright (c) 2016-present Greg Hurrell\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \u0026quot;Software\u0026quot;), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \u0026quot;AS IS\u0026quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n## Development\u003ca name=\"scalpel-development\" href=\"#user-content-scalpel-development\"\u003e\u003c/a\u003e\n\n\n### Contributing patches\u003ca name=\"scalpel-contributing-patches\" href=\"#user-content-scalpel-contributing-patches\"\u003e\u003c/a\u003e\n\nPatches can be sent via mail to greg@hurrell.net, or as GitHub pull requests at: https://github.com/wincent/scalpel/pulls\n\n\n### Cutting a new release\u003ca name=\"scalpel-cutting-a-new-release\" href=\"#user-content-scalpel-cutting-a-new-release\"\u003e\u003c/a\u003e\n\nAt the moment the release process is manual:\n\n- Perform final sanity checks and manual testing.\n- Update the [scalpel-history](#user-content-scalpel-history) section of the documentation.\n- Regenerate the documentation:\n\n```\ndocvim README.md doc/scalpel.txt\n```\n\n- Verify clean work tree:\n\n```\ngit status\n```\n\n- Tag the release:\n\n```\ngit tag -s -m \"$VERSION release\" $VERSION\n```\n\n- Publish the code:\n\n```\ngit push origin main --follow-tags\ngit push github main --follow-tags\n```\n\n- Produce the release archive:\n\n```\ngit archive -o scalpel-$VERSION.zip HEAD -- .\n```\n\n- Upload to http://www.vim.org/scripts/script.php?script_id=5381\n\n\n## Authors\u003ca name=\"scalpel-authors\" href=\"#user-content-scalpel-authors\"\u003e\u003c/a\u003e\n\nScalpel is written and maintained by Greg Hurrell \u0026lt;greg@hurrell.net\u0026gt;.\n\nOther contributors that have submitted patches include (in alphabetical order):\n\n- Keng Kiat Lim\n\nThis list produced with:\n\n```\n:read !git shortlog -s HEAD | grep -v 'Greg Hurrell' | cut -f 2-3 | sed -e 's/^/- /'\n```\n\n\n## History\u003ca name=\"scalpel-history\" href=\"#user-content-scalpel-history\"\u003e\u003c/a\u003e\n\n\n### 1.1 (12 June 2020)\u003ca name=\"scalpel-11-12-june-2020\" href=\"#user-content-scalpel-11-12-june-2020\"\u003e\u003c/a\u003e\n\n- Automatically escape characters that may have special meaning for \u003cstrong\u003e`/\\v`\u003c/strong\u003e (patch from Keng Kiat Lim, https://github.com/wincent/scalpel/pull/11).\n\n\n### 1.0.1 (6 March 2019)\u003ca name=\"scalpel-101-6-march-2019\" href=\"#user-content-scalpel-101-6-march-2019\"\u003e\u003c/a\u003e\n\n- Prefer \u003cstrong\u003e`execute()`\u003c/strong\u003e when available to avoid potential nested \u003cstrong\u003e`:redir`\u003c/strong\u003e issues.\n\n\n### 1.0 (3 January 2019)\u003ca name=\"scalpel-10-3-january-2019\" href=\"#user-content-scalpel-10-3-january-2019\"\u003e\u003c/a\u003e\n\n- Perform multiple replacements per line even when \u003cstrong\u003e`'gdefault'`\u003c/strong\u003e is on.\n\n\n### 0.5 (28 July 2018)\u003ca name=\"scalpel-05-28-july-2018\" href=\"#user-content-scalpel-05-28-july-2018\"\u003e\u003c/a\u003e\n\n- Fix problem with \u003cstrong\u003e`Visual`\u003c/strong\u003e mode operation on older versions of Vim (GitHub issue #8).\n\n\n### 0.4 (23 July 2018)\u003ca name=\"scalpel-04-23-july-2018\" href=\"#user-content-scalpel-04-23-july-2018\"\u003e\u003c/a\u003e\n\n- Fix problem with replacement patterns containing the number 1 (GitHub issue #7).\n\n\n### 0.3 (10 May 2018)\u003ca name=\"scalpel-03-10-may-2018\" href=\"#user-content-scalpel-03-10-may-2018\"\u003e\u003c/a\u003e\n\n- Fix compatibility with older versions of Vim that don't implement \u003cstrong\u003e`getcurpos()`\u003c/strong\u003e.\n\n\n### 0.2 (13 June 2016)\u003ca name=\"scalpel-02-13-june-2016\" href=\"#user-content-scalpel-02-13-june-2016\"\u003e\u003c/a\u003e\n\n- Support visual mode.\n- Do not show \u0026quot;N substitutions on N lines\u0026quot; messages.\n\n\n### 0.1 (29 April 2016)\u003ca name=\"scalpel-01-29-april-2016\" href=\"#user-content-scalpel-01-29-april-2016\"\u003e\u003c/a\u003e\n\n- Initial release.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwincent%2Fscalpel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwincent%2Fscalpel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwincent%2Fscalpel/lists"}