{"id":20785298,"url":"https://github.com/coachshea/vim-textobj-markdown","last_synced_at":"2025-05-05T14:42:49.059Z","repository":{"id":42644698,"uuid":"125627920","full_name":"coachshea/vim-textobj-markdown","owner":"coachshea","description":"text objects and movement mappings for working with md and rmd files","archived":false,"fork":false,"pushed_at":"2022-09-12T18:22:04.000Z","size":29,"stargazers_count":16,"open_issues_count":2,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-30T21:51:13.396Z","etag":null,"topics":["markdown","nvim","rmarkdown","vim","vim-textobj-user"],"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/coachshea.png","metadata":{"files":{"readme":"README.md","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}},"created_at":"2018-03-17T12:40:45.000Z","updated_at":"2024-12-10T04:16:11.000Z","dependencies_parsed_at":"2023-01-18T05:15:45.743Z","dependency_job_id":null,"html_url":"https://github.com/coachshea/vim-textobj-markdown","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coachshea%2Fvim-textobj-markdown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coachshea%2Fvim-textobj-markdown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coachshea%2Fvim-textobj-markdown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coachshea%2Fvim-textobj-markdown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coachshea","download_url":"https://codeload.github.com/coachshea/vim-textobj-markdown/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252516266,"owners_count":21760749,"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":["markdown","nvim","rmarkdown","vim","vim-textobj-user"],"created_at":"2024-11-17T14:44:39.838Z","updated_at":"2025-05-05T14:42:49.036Z","avatar_url":"https://github.com/coachshea.png","language":"Vim Script","readme":"            ####### ####### #     # ####### ####### ######        # \n               #    #        #   #     #    #     # #     #       # \n               #    #         # #      #    #     # #     #       # \n               #    #####      #       #    #     # ######        # \n               #    #         # #      #    #     # #     # #     # \n               #    #        #   #     #    #     # #     # #     # \n               #    ####### #     #    #    ####### ######   #####  \n                                                                    \n        #     #    #    ######  #    # ######  ####### #     # #     # \n        ##   ##   # #   #     # #   #  #     # #     # #  #  # ##    # \n        # # # #  #   #  #     # #  #   #     # #     # #  #  # # #   # \n        #  #  # #     # ######  ###    #     # #     # #  #  # #  #  # \n        #     # ####### #   #   #  #   #     # #     # #  #  # #   # # \n        #     # #     # #    #  #   #  #     # #     # #  #  # #    ## \n        #     # #     # #     # #    # ######  #######  ## ##  #     # \n                                                                       \n                                                                    \n\nTable of Contents\n=================\n\n\u003c!-- vim-markdown-toc GFM --\u003e\n\n* [Introduction](#introduction)\n* [Headers](#headers)\n* [Code Fences](#code-fences)\n  * [Code Fence Text Objects](#code-fence-text-objects)\n  * [Code Fence Movement](#code-fence-movement)\n* [Text Blocks](#text-blocks)\n  * [Text Text Objects](#text-text-objects)\n  * [Text Movement](#text-movement)\n* [Conflicts with Other Plugins](#conflicts-with-other-plugins)\n* [Dependencies](#dependencies)\n* [License](#license)\n\n\u003c!-- vim-markdown-toc --\u003e\n\nIntroduction\n============\n\nTextobj-Markdown provides text objects and movements for markdown and Rmarkdown\nfiles. Textobj-Markdown is built upon, and requires [textobj-user][1]. It\nprovides default key mappings and movements for code fences, text between code\nfences, and three levels of headers. If you choose not to apply the default\nmappings, simply include the following in you `vimrc/init.vim`:\n\n```vim\n\" remove default mappings\nlet g:textobj_markdown_no_default_key_mappings=1\n```\n\nHeaders\n=======\n\nTextobj-Markdown provides convenient mappings for moving between different\nlevels of headers and also provides a mapping to move to the next header of\nany level. Textobj-Markdown understand both styles of headers (i.e. #/## or\n===/---). The plug and default mappings are shown below.\n\n```vim\n\" level 1 headers\n\" # Header\n\" or\n\" Header\n\" =====\n\n\" plug\n\u003cPlug\u003e(textobj-markdown-header-n)\n\u003cPlug\u003e(textobj-markdown-header-p)\n\n\" default\n]] \"next\n[[ \"previous\n```\n\n```vim\n\"level 2 headers\n\" ## Sub Header\n\" or\n\" Sub Header\n\" ----------\n\n\" plug\n\u003cPlug\u003e(textobj-markdown-Sheader-n)\n\u003cPlug\u003e(textobj-markdown-Sheader-p)\n\n\" default\n][ \"next\n[] \"previous\n```\n\n```vim\n\" level 3 headers\n\" ### Sub Sub Header\n\n\" plug\n\u003cPlug\u003e(textobj-markdown-SSheader-n)\n\u003cPlug\u003e(textobj-markdown-SSheader-p)\n\n\" default\n]} \"next\n[{ \"previous\n```\n\n```vim\n\n\" general\n\" any level of header\n\n\" plug\n\u003cPlug\u003e(textobj-markdown-Gheader-n)\n\u003cPlug\u003e(textobj-markdown-Gheader-p)\n\n\" default\n]h \"next\n[h \"previous\n\n```\n\nCode Fences\n===========\n \nTextobj-Markdown provides text objects and movement maps for working with code\nfences. These are sometimes called code chunks or code blocks. By any name,\nTextobj-Markdown provides a convenient way to work with these sections.\n \nCode Fence Text Objects\n-----------------------\n\nFor operating on code fence, Textobj-Markdown provides two sets of mappings. By\ndefault they are mapped to `if/af` and `iF/aF`. When on or inside of a current\ncode block, both of these mappings work on the current block. When outside of a\ncode block the `if/af` mappings will search forward for a code block and the\n`iF/aF` mappings will search backward for a code block.\n\n```vim\n\" current or next code fence\n\n\" inside of fence plug\n\u003cplug\u003e(textobj-markdown-chunk-i)\n\" inside of block default\nif\n  \n\"around fence plug\n\u003cplug\u003e(textobj-markdown-chunk-a)\n\"around block default\naf\n\n\" current or previous code fence\n\n\" inside of fence plug\n\u003cplug\u003e(textobj-markdown-Bchunk-i)\n\" inside of block default\niF\n\n\"around fence plug\n\u003cplug\u003e(textobj-markdown-Bchunk-a)\n\"around block default\naF\n```\n\nCode Fence Movement\n-------------------\n\nIn addition to text objects, Textobj-Markdown also provides movement mappings\nfor code fences. Mappings are provided which for to the next/previous start of\na fence as well as the next/previous end of a fence.\n\n```vim\n\" start of fence block\n\n\" next fence plug\n\u003cplug\u003e(textobj-markdown-chunk-n)\n\" default\n]f \" next\n\n\" previous fence plug\n\u003cplug\u003e(textobj-markdown-chunk-p)\n\" default\n[f \" previous\n\n\" end of fence block\n\n\" next fence plug\n\u003cplug\u003e(textobj-markdown-chunk-N)\n\" default\n]g \" next\n\n\" previous fence plug\n\u003cplug\u003e(textobj-markdown-chunk-P)\n\" default\n[g \" previous\n```\n\nText Blocks\n===========\n\nTextobj-Markdown provides text objects and movement mappings for the blocks of\ntext between code blocks as well.\n\nText Text Objects\n-----------------\n\nTextobj-Markdown provides two sets of text objects for dealing with the blocks\nof text between code blocks `im/am` and `iM/aM`. As with the code fences text\nobjects, when within a text block, either set of mappings will work on the\ncurrent text block. If not within a current text block, the `im/am` mappings\nwill search forward for the next text block and the `iM/aM` mappings will\nsearch backward.\n\n```vim\n\" current or next text block\n\u003cplug\u003e(textobj-markdown-text-i)\nim \" inside of block\n\u003cplug\u003e(textobj-markdown-text-a)\nam \" around block\n\n\" current or previous text block\n\u003cplug\u003e(textobj-markdown-Btext-i)\niM \" inside of block\n\u003cplug\u003e(textobj-markdown-Btext-a)\naM \" around block\n```\n\nText Movement\n-------------\n\n```vim\n\" start of text block\n]m \" next\n[m \" previous\n\n\" end of text block\n]n \" next\n[n \" previous\n```\n\nConflicts with Other Plugins\n============================\n\nAs the list of [text-obj plugins][3] grows, there is an ever increasing chance\nfor mapping conflicts. One plugin in particular that has a conflict with this\none is textobj-function, which is one of my favorite textobj-user plugins.\nThe functions for the [textobj-function][4] plugin are only operative for\n`vim`, `java`, and `c` filetypes, so I did not expect a problem. However, the\nway the mappings are set up is that they are set globally and the function\nwhich they call changes based on filetype. This design allows the plugin the\npossibility of expanding to cover more filetypes, but does cause a conflict\nwith Textobj-Markdown. I am unaware of other plugins that conflict, but it is\nalways possible.\n\nThis means that if you use textobj-markdown with [textobj-function][4],\nyou will need to map the `af/if` and `aF/iF` mappings yourself. However,\nmarkdown does not have any functions and it is certainly possible to create\nbuffer-specific mappings for `af/if` and `aF/iF` without affecting the\nfunctionality of the [textobj-function][4] plugin for `vim`, `java`, and `c`\nfiles. Simply put the following in you `.vimrc` or `init.vim`:\n\n```vim\nomap \u003cbuffer\u003e af \u003cplug\u003e(textobj-markdown-chunk-a)\nomap \u003cbuffer\u003e if \u003cplug\u003e(textobj-markdown-chunk-i)\nomap \u003cbuffer\u003e aF \u003cplug\u003e(textobj-markdown-Bchunk-a)\nomap \u003cbuffer\u003e iF \u003cplug\u003e(textobj-markdown-Bchunk-i)\n```\n\nDependencies\n============\n\n[textobj-user][1]\n\nLicense\n=======\n\nCopyright (c) Torsten Schmits. Distributed under the terms of the [MIT\nLicense][2].\n\n[1]: https://github.com/kana/vim-textobj-user 'textobj-user'\n[2]: http://opensource.org/licenses/MIT 'mit license'\n[3]: https://github.com/kana/vim-textobj-user/wiki 'text-obj plugins'\n[4]: https://github.com/kana/vim-textobj-function 'textobj-function'\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoachshea%2Fvim-textobj-markdown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoachshea%2Fvim-textobj-markdown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoachshea%2Fvim-textobj-markdown/lists"}