" Author: Bjorn Winckler " Version: 0.1 " License: (c) 2012 Bjorn Winckler. Licensed under the same terms as Vim. " " Summary: " " Text objects for function arguments ('arg' means 'angry' in Swedish) and " other items surrounded by brackets and separated by commas. " " TODO: " " - Growing selection in visual mode does not work " - Comments are not handled properly (difficult to accomodate all styles, " e.g. comment after argument, comment on line above argument, ...) " - Support empty object (e.g. ',,' and ',/* comment */,') if exists("g:loaded_angry") || &cp || v:version < 700 | finish | endif let g:loaded_angry = 1 " " Map to text objects aa (An Argument) and ia (Inner Argument) unless " disabled. " " The objects aA and iA are similar to aa and ia, except aA and iA match at " closing brackets, whereas aa and ia match at opening brackets and commas. " Generally, the lowercase versions match to the right and the uppercase " versions match to the left of the cursor. " if !exists("g:angry_disable_maps") vmap aa AngryOuterPrefix omap aa AngryOuterPrefix vmap ia AngryInnerPrefix omap ia AngryInnerPrefix vmap aA AngryOuterSuffix omap aA AngryOuterSuffix vmap iA AngryInnerSuffix omap iA AngryInnerSuffix endif " " Specify which separator to use. " " TODO: This should probably be determined on a per-buffer (or filetype) basis. " if !exists('g:angry_separator') let g:angry_separator = ',' endif vnoremap