" vim:filetype=vim foldmethod=marker textwidth=78 " ========================================================================== " File: visSum.vim (global plugin) " Last Changed: 2015-08-18 " Maintainer: Erik Falor " Version: 1.2 " License: Vim License " " This version (1.2) contains a fix for a bug reported by Fabio Inguaggiato. " Thanks, Fabio! " " Version (1.1) contains a fix for a bug reported by Markus Weimar. " Thank you, Markus! " " A great big thanks to Christian Mauderer for providing a patch for " floating-point support! " " ________ __ __ " /_ __/ /_ ____ _____ / /_______/ / " / / / __ \/ __ `/ __ \/ //_/ ___/ / " / / / / / / /_/ / / / / ,< (__ )_/ " /_/ /_/ /_/\__,_/_/ /_/_/|_/____(_) " " This plugin will work whether or not your Vim is compiled with support for " floating-point numbers. If your Vim doesn't has('float'), we'll just " ignore whatever comes after the decimal point. " " Due to the way Vim parses floating-point numbers, the only valid separtator " between the whole and fractional parts of the number is a period. Vim " won't accept a comma, even if that's your locale's preference. This " plugin follows that convention. " ========================================================================== " Exit quickly if the script has already been loaded let s:this_version = '1.2' if exists('g:loaded_visSum') && g:loaded_visSum == s:this_version finish endif let g:loaded_visSum = s:this_version "Mappings {{{ " clean up existing key mappings upon re-loading of script if hasmapto('SumNum') nunmap \su vunmap \su nunmap SumNum vunmap SumNum endif " Key mappings nmap su SumNum vmap su SumNum if has('float') " Call the floating-point version of the function nmap