I'm trying to deconstruct a .vimrc file to learn. I'm at a loss to determine what this does. Typing the ] and _$ mapped keys in visual mode doesn't seem to do anything useful. Maybe I'm missing something.vmap <silent>       ]   $yygv_$vmap <silent><expr> _$  Under_dollar_visual()function! Under_dollar_visual ()     Locate block being shifted...    let maxcol = max(map(split(@y, \n), 'strlen(v:val)')) + getpos('<)[2] - 2     Return the selction that does the job...    return maxcol . '|'endfunction
What does this vim script do?
vimrc
vmap <silent>       ]   $yygv_$This selects to the end of the line ($), copies everything to the @y register (yy), visually selects the block (gv) and then calls _$.vmap <silent><expr> _$  Under_dollar_visual()<expr> means that the result of the expression is evaluated (see help map-expression).In Under_dollar_visual, maxcol is set tolet maxcol = max(map(split(@y, \n), 'strlen(v:val)')) the longest line of the text in the @y register that was just copied+ getpos('<)[2] - 2plus the start column of the block minus two (without the last character).return maxcol . '|'Finally it returns the keys that will be evaluated by vim (| = To screen column [count]).For example if you select a visual-block (indicated by X)aaaXXXyyyaaaXXXyyyyaaaXXXyyyyyand press ], you'll get:aaaXXXXXXaaaXXXXXXXaaaXXXXXXXy(if the cursor was on the last line) which is the same as if you had typed 10| with the initial selection.