diff options
Diffstat (limited to 'vimwiki/Quickly Quote')
| -rw-r--r-- | vimwiki/Quickly Quote/.unquote words.md.swp | bin | 0 -> 12288 bytes | |||
| -rw-r--r-- | vimwiki/Quickly Quote/unquote words.md | 37 |
2 files changed, 37 insertions, 0 deletions
diff --git a/vimwiki/Quickly Quote/.unquote words.md.swp b/vimwiki/Quickly Quote/.unquote words.md.swp Binary files differnew file mode 100644 index 0000000..f14e420 --- /dev/null +++ b/vimwiki/Quickly Quote/.unquote words.md.swp diff --git a/vimwiki/Quickly Quote/unquote words.md b/vimwiki/Quickly Quote/unquote words.md new file mode 100644 index 0000000..6e7a75a --- /dev/null +++ b/vimwiki/Quickly Quote/unquote words.md @@ -0,0 +1,37 @@ + + +###Easy Method### + +Use surround.vim plugin + +###Native Vim methods### + + __Quote a word using single quotes__ + + `ciw'Ctrl+r"'` + + * `ciw` - Delete the word the cursor is on, and end up in insert mode + * `'` - Add the first quote + * `Ctrl+r"` - Insert the contents of the `"` register, aka the last yank/delete. + * `'` - Add the closing quote + + + _Unquote a word that's enclosed in single quotes_ + + `di'hPl2x` + + * `di'` - Delete the word enclosed by single quotes. + * `hP` - Move the cursor left one place (on top of the opening quote) and put the just deleted text before the quote. + * `l` - Move the cursor right one place (on top of the opening quote). + * `2x` - Delete the two quotes. + + _Change single quotes to double quotes_ + + `va':s/\%V'\%V/"/g` + + * `va'` - Visually select the quoted word and the quotes. + * ``:s/`` - Start a replacement. + * ``\%V'\%V` - Only match single quotes that are within the visually selected region. + * ``/"/g` - Replace them all with double quotes. + +See [Stack Overflow Ref:](https://stackoverflow.com/questions/2147875/what-vim-commands-can-be-used-to-quote-unquote-words) |
