From a783cac28a16b17abf15bddf57c7a1b5dd0e4493 Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Tue, 25 Aug 2015 20:31:05 -0500 Subject: [PATCH] Add Case-Aware Substitution With vim-abolish as a vim til. --- README.md | 1 + ...ase-aware-substitution-with-vim-abolish.md | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 vim/case-aware-substitution-with-vim-abolish.md diff --git a/README.md b/README.md index 2dd4bf6..c08fda8 100644 --- a/README.md +++ b/README.md @@ -147,6 +147,7 @@ smart people at [Hashrocket](http://hashrocket.com/). - [Alternate Files With vim-rails](vim/alternate-files-with-vim-rails.md) - [The Black Hole Register](vim/the-black-hole-register.md) - [Buffer Time Travel](vim/buffer-time-travel.md) +- [Case-Aware Substitution With vim-abolish](vim/case-aware-substitution-with-vim-abolish.md) - [Case-Insensitive Substitution](vim/case-insensitive-substitution.md) - [Check Your Current Color Scheme](vim/check-your-current-color-scheme.md) - [Close the Current Buffer](vim/close-the-current-buffer.md) diff --git a/vim/case-aware-substitution-with-vim-abolish.md b/vim/case-aware-substitution-with-vim-abolish.md new file mode 100644 index 0000000..2e3ac14 --- /dev/null +++ b/vim/case-aware-substitution-with-vim-abolish.md @@ -0,0 +1,22 @@ +# Case-Aware Substitution With vim-abolish + +Substitution in vim is, by default, case-sensitive. Adding the `i` `s-flag` +makes it case-insensitive. +[`vim-abolish`](https://github.com/tpope/vim-abolish), on the other hand, lets +you perform a case-insensitive substitution that preserves three case +variants (foo, Foo, and FOO). Substitution with `vim-abolish` can be +performed with `Subvert` or `S`. + +For instance, `:%S/blog/article/g` will turn + +``` +blog Blog bLOg BLOG +``` + +into + +``` +article Article bLOg ARTICLE +``` + +Install `vim-abolish` and see `:h Subvert` for more details.