|
| 1 | +*textobj-delimiters.txt* For Vim version 8.1 Last change: 2018 December 24 |
| 2 | + |
| 3 | + _____ _ _____ _ _ ~ |
| 4 | + |_ _| | | | _ | | (_) ~ |
| 5 | + | | _____ _| |_| | | | |__ _ ~ |
| 6 | + | |/ _ \ \/ / __| | | | '_ \| | ~ |
| 7 | + | | __/> <| |_\ \_/ / |_) | | ~ |
| 8 | + \_/\___/_/\_\\__|\___/|_.__/| | ~ |
| 9 | + ______ _ _ _ _ _/ | ~ |
| 10 | + | _ \ | (_) (_) | |__/ ~ |
| 11 | + | | | |___| |_ _ __ ___ _| |_ ___ _ __ ___ ~ |
| 12 | + | | | / _ \ | | '_ ` _ \| | __/ _ \ '__/ __| ~ |
| 13 | + | |/ / __/ | | | | | | | | || __/ | \__ \ ~ |
| 14 | + |___/ \___|_|_|_| |_| |_|_|\__\___|_| |___/ ~ |
| 15 | + |
| 16 | + |
| 17 | + A Vim plugin that adds various symbols as ~ |
| 18 | + delimiting text objects. ~ |
| 19 | + |
| 20 | + Reference Manual ~ |
| 21 | + |
| 22 | +============================================================================== |
| 23 | +CONTENTS *textobj-delimiters-contents* |
| 24 | + |
| 25 | + 1. Intro................................|textobj-delimiters-intro| |
| 26 | + 2. Symbols..............................|textobj-delimiters-symbols| |
| 27 | + 3. Usage................................|textobj-delimiters-usage| |
| 28 | + 3.1 Asterisks.......................|textobj-delimiters-asterisks| |
| 29 | + 3.2 Backslash.......................|textobj-delimiters-backslash| |
| 30 | + 3.3 Dollar Sign.....................|textobj-delimiters-dollar| |
| 31 | + 3.4 Minus Sign/Dash.................|textobj-delimiters-minus| |
| 32 | + 3.5 Percent Sign....................|textobj-delimiters-percent| |
| 33 | + 3.6 Pipe............................|textobj-delimiters-pipe| |
| 34 | + 3.7 Plus Sign.......................|textobj-delimiters-plus| |
| 35 | + 3.8 Question Mark...................|textobj-delimiters-question| |
| 36 | + 3.9 Slash...........................|textobj-delimiters-slash| |
| 37 | + 3.10 Underscore.....................|textobj-delimiters-underscore| |
| 38 | + 4. About................................|textobj-delimiters-about| |
| 39 | + |
| 40 | +============================================================================== |
| 41 | +1. Intro *textobj-delimiters-intro* |
| 42 | + |
| 43 | +TODO |
| 44 | +============================================================================== |
| 45 | +2. Symbols *textobj-delimiters-symbols* |
| 46 | + |
| 47 | +The following symbols are now recognized as block delimiters, marking the |
| 48 | +start and end of a region of text: > |
| 49 | +
|
| 50 | + * asterisk |
| 51 | + \ backslash |
| 52 | + $ dollar sign |
| 53 | + - minus sign/dash |
| 54 | + % percent sign |
| 55 | + | pipe |
| 56 | + + plus sign |
| 57 | + ? question mark |
| 58 | + / slash |
| 59 | + _ underscore |
| 60 | +< |
| 61 | +============================================================================== |
| 62 | +3. Usage *textobj-delimiters-usage* |
| 63 | + |
| 64 | +Similar to how quotes, parentheses, and brackets amongst other block |
| 65 | +delimiters can mark the start and end of a region of text and can have edited |
| 66 | +with the 'c' (change), 'd' (delete), 'v' (visual) and 'y' (yank) operators, |
| 67 | +vim-textobj-delimiters provides several new |text-objects| which are triggered |
| 68 | +by `a` and `i` motions. While there may be any number of uses for these |
| 69 | +delimiters, here are some examples for where they may be used. |
| 70 | + |
| 71 | +------------------------------------------------------------------------------ |
| 72 | +3.1 Asterisks *textobj-delimiters-asterisks* |
| 73 | + |
| 74 | +Selections of text surrounded by asterisks (*) is fairly common in markdown |
| 75 | +files, marking `*italicized*` or `**bold**` text. |
| 76 | + |
| 77 | +------------------------------------------------------------------------------ |
| 78 | +3.2 Backslash *textobj-delimiters-backslash* |
| 79 | + |
| 80 | +In Windows-style path names, directories are `separated\with\backslashes`. |
| 81 | + |
| 82 | +------------------------------------------------------------------------------ |
| 83 | +3.3 Dollar Sign *textobj-delimiters-dollar* |
| 84 | + |
| 85 | +In LaTeX files, inline math mode is delimited with `$single dollar signs$`, |
| 86 | +while `$$double dollar signs$$` delimits display math mode. |
| 87 | + |
| 88 | +------------------------------------------------------------------------------ |
| 89 | +3.4 Minus Sign/Dash *textobj-delimiters-minus* |
| 90 | + |
| 91 | +Languages like Lisp and css often use kebab case variable names, which |
| 92 | +`separate-words-with-dashes`. In webiste URLs, text of certain directories or |
| 93 | +titles are often in kebab case as well. |
| 94 | + |
| 95 | +------------------------------------------------------------------------------ |
| 96 | +3.5 Percent Sign *textobj-delimiters-percent* |
| 97 | + |
| 98 | +In some web templates, language boundaries are > |
| 99 | +
|
| 100 | + <% surrounded with template delimiters such as this %> |
| 101 | +< |
| 102 | +------------------------------------------------------------------------------ |
| 103 | +3.6 Pipe *textobj-delimiters-pipe* |
| 104 | + |
| 105 | +Hot-links in Vim help documentation and markdown tables delimit text with |
| 106 | +pipe characters. |
| 107 | + |
| 108 | +For example, suppose you have the following markdown table: > |
| 109 | +
|
| 110 | + | Cats | Dogs | |
| 111 | + |:------------:|:--------:| |
| 112 | + | Mr. Whiskers | Snuffles | |
| 113 | + | Oscar | Bella | |
| 114 | +< |
| 115 | +If you want to change 'Mr. Whiskers' to 'Tigger', you can do the following |
| 116 | +(cursor position marked by *): |
| 117 | + |
| 118 | +`| Mr. Wh*iskers |` and type `ci|` to get `|*|`, where you can make your |
| 119 | +replacement `| Tigger |` . |
| 120 | + |
| 121 | +Another example is if you are writing Vim help documentation and have |
| 122 | +a hot-link, which is a word surrounded with pipes as such: > |
| 123 | +
|
| 124 | + |bad tag| |
| 125 | +< |
| 126 | +If you want to delete the hot-link, you can do the following (cursor position |
| 127 | +marked by *): |
| 128 | + |
| 129 | +`|bad*tag|` and type `da|`, which will delete the hot-link. |
| 130 | + |
| 131 | + |
| 132 | +------------------------------------------------------------------------------ |
| 133 | +3.7 Plus Sign *textobj-delimiters-plus* |
| 134 | + |
| 135 | +In mathematical expressions or string concatenation, certain text may |
| 136 | +incidentally be delimited with plus signs such as: > |
| 137 | +
|
| 138 | + a = 4 + 457 + 12 |
| 139 | +
|
| 140 | + message = "Hello" + "there" + "General" + "Kenobi" |
| 141 | +< |
| 142 | +Admittedly, there does not seem to be much use to this as the quote and |
| 143 | +word text objects can achieve the same thing. |
| 144 | + |
| 145 | +------------------------------------------------------------------------------ |
| 146 | +3.8 Question Mark *textobj-delimiters-question* |
| 147 | + |
| 148 | +In XML, processing instructions are > |
| 149 | +
|
| 150 | + <? delimited with question marks ?> |
| 151 | +< |
| 152 | +------------------------------------------------------------------------------ |
| 153 | +3.9 Slash *textobj-delimiters-slash* |
| 154 | + |
| 155 | +In website URLs and Unix-style path names, directories are |
| 156 | +`separated/with/slashes`. |
| 157 | + |
| 158 | +------------------------------------------------------------------------------ |
| 159 | +3.10 Underscore *textobj-delimiters-underscore* |
| 160 | + |
| 161 | +Languages like C, Python, and Ruby often use snake case variable names, which |
| 162 | +`separate_words_with_underscores`. In website URLs, text of certain |
| 163 | +directories or titles are often in snake case as well. |
| 164 | + |
| 165 | +============================================================================== |
| 166 | +4. About *textobj-delimiters-about* |
| 167 | + |
| 168 | +You can find the most updated version of the plugin from: |
| 169 | + |
| 170 | + http://github.com/EvanQuan/vim-textobj-delimiters |
| 171 | + |
| 172 | +vim:tw=78:ts=8:ft=help:norl: |
0 commit comments