Permalink
Browse files

add files

  • Loading branch information...
xwuxin committed Mar 6, 2013
1 parent defc648 commit fee4eb40648efb9a1d6fa0481573a70a8a2b9230
Showing 369 changed files with 43,126 additions and 0 deletions.
@@ -0,0 +1 @@
+/doc/tags
@@ -0,0 +1,127 @@
+abolish.vim
+===========
+
+I sat on on this plugin for 3 years before releasing it, primarily
+because it's so gosh darn hard to explain. It's three superficially
+unrelated plugins in one that share a common theme: working with
+variants of a word.
+
+Abbreviation
+------------
+
+I know how to spell separate. I know how to spell desperate. My
+fingers, however, have trouble distinguishing between the two, and I
+invariably have a 50 percent chance of typing seperate or desparate each
+time one of these comes up. At first, I tried abbreviations:
+
+ :iabbrev seperate separate
+ :iabbrev desparate desperate
+
+But this falls short at the beginning of a sentence.
+
+ :iabbrev Seperate Separate
+ :iabbrev Desparate Desperate
+
+To be really thorough, we need uppercase too!
+
+ :iabbrev SEPERATE SEPARATE
+ :iabbrev DESPARATE DESPERATE
+
+Oh, but consider the noun form, and the adverb form!
+
+ :iabbrev seperation separation
+ :iabbrev desparation desperation
+ :iabbrev seperately separately
+ :iabbrev desparately desperately
+ :iabbrev Seperation separation
+ :iabbrev Desparation Desperation
+ :iabbrev Seperately Separately
+ :iabbrev Desparately Desperately
+ :iabbrev SEPERATION SEPARATION
+ :iabbrev DESPARATION DESPERATION
+ :iabbrev SEPERATELY SEPARATELY
+ :iabbrev DESPARATELY DESPERATELY
+
+Wait, there's also separates, separated, separating, separations,
+separator...
+
+Abolish.vim provides a simpler way. The following one command produces
+48 abbreviations including all of the above.
+
+ :Abolish {despa,sepe}rat{e,es,ed,ing,ely,ion,ions,or} {despe,sepa}rat{}
+
+My current configuration has 25 Abolish commands that create hundreds of
+corrections my fingers refuse to learn.
+
+Substitution
+------------
+
+One time I had an application that with a domain model called
+"facilities" that needed to be renamed to "buildings". So, a simple
+search and replace, right?
+
+ :%s/facility/building/g
+
+Oh, but the case variants!
+
+ :%s/Facility/Building/g
+ :%s/FACILITY/BUILDING/g
+
+Wait, the plural is more than "s" so we need to get that too!
+
+ :%s/facilities/buildings/g
+ :%s/Facilities/Buildings/g
+ :%s/FACILITIES/BUILDINGS/g
+
+Abolish.vim has your back. One command to do all six, and you can
+repeat it with `&` too!
+
+ :%Subvert/facilit{y,ies}/building{,s}/g
+
+You can abbreviate it as `:S`, and it accepts the full range of flags
+including things like `c` (confirm).
+
+There's also a variant for searching and a variant for grepping.
+
+Coercion
+--------
+
+Want to turn `fooBar` into `foo_bar`? Press `crs` (coerce to
+snake\_case). MixedCase (`crm`), camelCase (`crc`), snake\_case
+(`crs`), and UPPER\_CASE (`cru`) are all just 3 keystrokes away. These
+commands support [repeat.vim](https://github.com/tpope/vim-repeat).
+
+Installation
+------------
+
+If you don't have a preferred installation method, I recommend
+installing [pathogen.vim](https://github.com/tpope/vim-pathogen), and
+then simply copy and paste:
+
+ cd ~/.vim/bundle
+ git clone git://github.com/tpope/vim-abolish.git
+
+Once help tags have been generated, you can view the manual with
+`:help abolish`.
+
+Contributing
+------------
+
+See the contribution guidelines for
+[pathogen.vim](https://github.com/tpope/vim-pathogen#readme).
+
+Self-Promotion
+--------------
+
+Like abolish.vim? Follow the repository on
+[GitHub](https://github.com/tpope/vim-abolish) and vote for it on
+[vim.org](http://www.vim.org/scripts/script.php?script_id=1545). And if
+you're feeling especially charitable, follow [tpope](http://tpo.pe/) on
+[Twitter](http://twitter.com/tpope) and
+[GitHub](https://github.com/tpope).
+
+License
+-------
+
+Copyright (c) Tim Pope. Distributed under the same terms as Vim itself.
+See `:help license`.
@@ -0,0 +1,162 @@
+*abolish.txt* Language friendly searches, substitutions, and abbreviations
+
+Author: Tim Pope <http://tpo.pe/>
+License: Same terms as Vim itself (see |license|)
+
+This plugin is only available if 'compatible' is not set.
+
+INTRODUCTION *abolish* *:Abolish* *:Subvert*
+
+Abolish lets you quickly find, substitute, and abbreviate several variations
+of a word at once. By default, three case variants (foo, Foo, and FOO) are
+operated on by every command.
+
+Two commands are provided. :Abolish is the most general interface.
+:Subvert provides an alternative, more concise syntax for searching and
+substituting.
+>
+ :Abolish [options] {abbreviation} {replacement}
+ :Abolish -delete [options] {abbreviation}
+
+ :Abolish -search [options] {pattern}
+ :Subvert/{pattern}[/flags]
+ :Abolish!-search [options] {pattern}
+ :Subvert?{pattern}[?flags]
+
+ :Abolish -search [options] {pattern} {grep-arguments}
+ :Subvert /{pattern}/[flags] {grep-options}
+ :Abolish!-search [options] {pattern} {grep-arguments}
+ :Subvert!/{pattern}/[flags] {grep-options}
+
+ :[range]Abolish -substitute [options] {pattern} {replacement}
+ :[range]Subvert/{pattern}/{replacement}[/flags]
+<
+ *:S*
+In addition to the :Subvert command, a :S synonym is provided if not
+already defined. This will be used in examples below.
+
+PATTERNS *abolish-patterns*
+
+Patterns can include brace pairs that contain comma separated alternatives:
+
+ box{,es} => box, boxes, Box, Boxes, BOX, BOXES
+
+For commands with a replacement, corresponding brace pairs are used in both
+halves. If the replacement should be identical to the pattern, an empty
+brace pair may be used. If fewer replacements are given than were given in
+the pattern, they are looped. That is, {a,b} on the replacement side is the
+same as {a,b,a,b,a,b,...} repeated indefinitely.
+
+The following replaces several different misspellings of "necessary":
+>
+ :%S/{,un}nec{ce,ces,e}sar{y,ily}/{}nec{es}sar{}/g
+<
+ABBREVIATING *abolish-abbrev*
+
+By default :Abolish creates abbreviations, which replace words automatically
+as you type. This is good for words you frequently misspell, or as
+shortcuts for longer words. Since these are just Vim abbreviations, only
+whole words will match.
+>
+ :Abolish anomol{y,ies} anomal{}
+ :Abolish {,in}consistant{,ly} {}consistent{}
+ :Abolish Tqbf The quick, brown fox jumps over the lazy dog
+<
+Accepts the following options:
+
+ -buffer: buffer local
+ -cmdline: work in command line in addition to insert mode
+
+A good place to define abbreviations is "after/plugin/abolish.vim",
+relative to ~\vimfiles on Windows and ~/.vim everywhere else.
+
+With a bang (:Abolish!) the abbreviation is also appended to the file in
+g:abolish_save_file. The default is "after/plugin/abolish.vim", relative
+to the install directory.
+
+Abbreviations can be removed with :Abolish -delete:
+>
+ Abolish -delete -buffer -cmdline anomol{y,ies}
+<
+SEARCHING *abolish-search*
+
+The -search command does a search in a manner similar to / key.
+search. After searching, you can use |n| and |N| as you would with a normal
+search.
+
+The following will search for box, Box, and BOX:
+>
+ :Abolish -search box
+<
+When given a single word to operate on, :Subvert defaults to doing a
+search as well:
+>
+ :S/box/
+<
+This one searches for box, boxes, boxed, boxing, Box, Boxes, Boxed, Boxing,
+BOX, BOXES, BOXED, and BOXING:
+>
+ :S/box{,es,ed,ing}/
+<
+The following syntaxes search in reverse.
+>
+ :Abolish! -search box
+ :S?box?
+<
+Flags can be given with the -flags= option to :Abolish, or by appending them
+after the separator to :Subvert. The flags trigger the following behaviors:
+
+ I: Disable case variations (box, Box, BOX)
+ v: Match inside variable names (match my_box, myBox, but not mybox)
+ w: Match whole words (like surrounding with \< and \>)
+
+A |search-offset| may follow the flags.
+>
+ :Abolish -search -flags=avs+1 box
+ :S?box{,es,ed,ing}?we
+<
+GREPPING *abolish-grep*
+
+Grepping works similar to searching, and is invoked when additional options
+are given. These options are passed directly to the :grep command.
+>
+ :Abolish -search box{,es}
+ :S /box{,es}/ *
+ :S /box/aw *.txt *.html
+<
+The slash delimiters must both be present if used with :Subvert. They may
+both be omitted if no flags are used.
+
+Both an external grepprg and vimgrep (via grepprg=internal) are supported.
+With an external grep, the "v" flag behaves less intelligently, due to the
+lack of look ahead and look behind support in grep regexps.
+
+SUBSTITUTING *abolish-substitute*
+
+Giving a range switches :Subvert into substitute mode. This command will
+change box -> bag, boxes -> bags, Box -> Bag, Boxes -> Bags, BOX -> BAG,
+BOXES -> BAGS across the entire document:
+>
+ :%Abolish -substitute -flags=g box{,es} bag{,s}
+ :%S/box{,es}/bag{,s}/g
+<
+The "c", "e", "g", and "n" flags can be used from the substitute command
+|:s_flags|, along with the "a", "I", "v", and "w" flags from searching.
+
+COERCION *abolish-coercion* *cr*
+
+Abolish's case mutating algorithms can be applied to the word under the cursor
+using the cr mapping (mnemonic: CoeRce) followed by one of the following
+characters:
+
+ c: camelCase
+ m: MixedCase
+ _: snake_case
+ s: snake_case
+ u: SNAKE_UPPERCASE
+ -: dash-case (not reversible)
+
+For example, cru on a lowercase word is a slightly easier to type equivalent
+to gUiw.
+
+ vim:tw=78:ts=8:ft=help:norl:
Oops, something went wrong.

0 comments on commit fee4eb4

Please sign in to comment.