# sandwich處理html tags
[toc]
## tags
:::success
i,I It realizes to define `I`nstant surroundings. `saiwi` ask user for inputting former and latter surroundings. For example,
`saiwifoo<CR>bar<CR>` makes a word surrounded by `foo` and `bar`.
<Tab> key completes words from the current buffer, just simply. On the other hand `sdi` deletes arbitrary surroundings. For example, `sdifoo<CR>bar<CR>` makes `foowordbar` to `word`, the inputs would be
interpreted as regular expressions. This is useful when a lot of
targets are there because the action could be repeated by |.| command.
`sa{textobj}I`, `sdI` reuse the last inputs.
t,T The inputs `t` and `T` support to edit HTML style tags. `saiwt` ask
user to input a name of element, then a textobject would be surrounded
by the tag. `saiwT` works as same.
```
word -- saiwtp<CR> --> <p>word</p>
```
`sdt` deletes the nearest tag surroundings. `sdT` works as same.
```
<p>word</p> -- sdt --> word
```
`t` and `T` works differently only when replacing surroundings.
* `srtt` replaces only the name of element, does not touch attributes.
* `srTT` replaces the whole body of tags.
:::