{"id":13410740,"url":"https://github.com/kylechui/nvim-surround","last_synced_at":"2025-05-13T22:06:42.830Z","repository":{"id":39732091,"uuid":"487087290","full_name":"kylechui/nvim-surround","owner":"kylechui","description":"Add/change/delete surrounding delimiter pairs with ease. Written with :heart: in Lua.","archived":false,"fork":false,"pushed_at":"2025-04-18T22:16:47.000Z","size":349,"stargazers_count":3657,"open_issues_count":10,"forks_count":63,"subscribers_count":15,"default_branch":"main","last_synced_at":"2025-04-29T14:17:28.842Z","etag":null,"topics":["lua","neovim","neovim-plugin","nvim","surround","ucla-opensource"],"latest_commit_sha":null,"homepage":"","language":"Lua","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/kylechui.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","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},"funding":{"github":["kylechui"],"patreon":null,"open_collective":null,"ko_fi":"kylechui","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2022-04-29T19:23:26.000Z","updated_at":"2025-04-29T12:04:13.000Z","dependencies_parsed_at":"2023-02-01T03:45:58.250Z","dependency_job_id":"23ffb9b7-7c9f-4c07-9548-8545a2ea12ca","html_url":"https://github.com/kylechui/nvim-surround","commit_stats":{"total_commits":258,"total_committers":35,"mean_commits":7.371428571428571,"dds":0.5503875968992248,"last_synced_commit":"ec2dc7671067e0086cdf29c2f5df2dd909d5f71f"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylechui%2Fnvim-surround","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylechui%2Fnvim-surround/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylechui%2Fnvim-surround/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylechui%2Fnvim-surround/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kylechui","download_url":"https://codeload.github.com/kylechui/nvim-surround/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251516953,"owners_count":21601911,"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":["lua","neovim","neovim-plugin","nvim","surround","ucla-opensource"],"created_at":"2024-07-30T20:01:08.805Z","updated_at":"2025-04-29T14:17:35.941Z","avatar_url":"https://github.com/kylechui.png","language":"Lua","readme":"# nvim-surround\n\nSurround selections, stylishly :sunglasses:\n\n\u003cdiv align=\"center\"\u003e\n  \u003cvideo src=\"https://user-images.githubusercontent.com/48545987/178679494-c7d58bdd-d8ca-4802-a01c-a9444b8b882f.mp4\" type=\"video/mp4\"\u003e\u003c/video\u003e\n\u003c/div\u003e\n\n## :sparkles: Features\n\n- Add/delete/change surrounding pairs\n  - Function calls and HTML tags out-of-the-box\n- Dot-repeat previous actions\n- Set buffer-local mappings and surrounds\n- Jump to the _nearest_ surrounding pair for modification\n- Use a single character as an alias for several text-objects\n  - E.g. `q` is aliased to \u003ccode\u003e\\`,',\"\u003c/code\u003e, so \u003ccode\u003ecsqb\u003c/code\u003e replaces\n    the _nearest_ set of quotes with parentheses\n- Surround using powerful pairs that depend on user input\n- Modify custom surrounds\n  - First-class support for Vim motions, Lua patterns, and Tree-sitter nodes\n- Highlight selections for visual feedback\n\n## :lock: Requirements\n\n- [Neovim 0.8+](https://github.com/neovim/neovim/releases)\n- \\[Recommended] If\n  [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter) is\n  installed, then Tree-sitter nodes may be surrounded and modified, in addition\n  to just Vim motions and Lua patterns\n- \\[Recommended] If\n  [nvim-treesitter-textobjects](https://github.com/nvim-treesitter/nvim-treesitter-textobjects)\n  is installed, then Tree-sitter text-objects can be used to define surrounds,\n  simplifying configuration\n\n## :package: Installation\n\nInstall this plugin using your favorite plugin manager, and then call\n`require(\"nvim-surround\").setup()`.\n\n### [lazy.nvim](https://github.com/folke/lazy.nvim)\n\n```lua\n{\n    \"kylechui/nvim-surround\",\n    version = \"^3.0.0\", -- Use for stability; omit to use `main` branch for the latest features\n    event = \"VeryLazy\",\n    config = function()\n        require(\"nvim-surround\").setup({\n            -- Configuration here, or leave empty to use defaults\n        })\n    end\n}\n```\n\n### [packer.nvim](https://github.com/wbthomason/packer.nvim)\n\n```lua\nuse({\n    \"kylechui/nvim-surround\",\n    tag = \"*\", -- Use for stability; omit to use `main` branch for the latest features\n    config = function()\n        require(\"nvim-surround\").setup({\n            -- Configuration here, or leave empty to use defaults\n        })\n    end\n})\n```\n\n## :rocket: Usage\n\nThe three \"core\" operations of `add`/`delete`/`change` can be done with the\nkeymaps `ys{motion}{char}`, `ds{char}`, and `cs{target}{replacement}`,\nrespectively. For the following examples, `*` will denote the cursor position:\n\n```help\n    Old text                    Command         New text\n--------------------------------------------------------------------------------\n    surr*ound_words             ysiw)           (surround_words)\n    *make strings               ys$\"            \"make strings\"\n    [delete ar*ound me!]        ds]             delete around me!\n    remove \u003cb\u003eHTML t*ags\u003c/b\u003e    dst             remove HTML tags\n    'change quot*es'            cs'\"            \"change quotes\"\n    \u003cb\u003eor tag* types\u003c/b\u003e        csth1\u003cCR\u003e       \u003ch1\u003eor tag types\u003c/h1\u003e\n    delete(functi*on calls)     dsf             function calls\n```\n\nDetailed information on how to use this plugin can be found in\n[`:h nvim-surround.usage`](https://github.com/kylechui/nvim-surround/blob/main/doc/nvim-surround.txt).\n\n## :gear: Configuration\n\nThe default configuration is found\n[here](https://github.com/kylechui/nvim-surround/blob/main/lua/nvim-surround/config.lua).\nSimply call `require(\"nvim-surround\").setup` or\n`require(\"nvim-surround\").buffer_setup` with the desired options.\n\nMore information on how to configure this plugin can be found in\n[`:h nvim-surround.configuration`](https://github.com/kylechui/nvim-surround/blob/main/doc/nvim-surround.txt).\n\n## Contributing\n\nSee\n[the contributing file](https://github.com/kylechui/nvim-surround/blob/main/CONTRIBUTING.md).\n\n## Shoutouts\n\n- [vim-surround](https://github.com/tpope/vim-surround)\n- [mini.surround](https://github.com/echasnovski/mini.surround)\n- [vim-sandwich](https://github.com/machakann/vim-sandwich)\n- Like this project? Give it a :star: to show your support!\n","funding_links":["https://github.com/sponsors/kylechui","https://ko-fi.com/kylechui"],"categories":["Syntax","Lua"],"sub_categories":["Markdown and LaTeX","Assembly"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkylechui%2Fnvim-surround","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkylechui%2Fnvim-surround","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkylechui%2Fnvim-surround/lists"}