diff options
| author | mitsuo <[email protected]> | 2020-03-30 04:55:36 -0500 |
|---|---|---|
| committer | mitsuo <[email protected]> | 2020-03-30 04:55:36 -0500 |
| commit | c7853855102bc88cb19bcb8cbad02887de0635b1 (patch) | |
| tree | 3f230d983f74bebcd9c854a39e87269b1c6aca00 /fun.vim | |
| parent | e24c24ef981a70b5d26afbf1b2c024cdbe693e73 (diff) | |
| download | dotfiles-c7853855102bc88cb19bcb8cbad02887de0635b1.tar.gz dotfiles-c7853855102bc88cb19bcb8cbad02887de0635b1.tar.bz2 dotfiles-c7853855102bc88cb19bcb8cbad02887de0635b1.zip | |
names, XGD and install script
Diffstat (limited to 'fun.vim')
| -rw-r--r-- | fun.vim | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -0,0 +1,23 @@ +" Echoes longest line number and lenght. + +function! LongestLineLength ( ) + let maxlength = 0 + let linenumber = 1 + while linenumber <= line("$") + exe ":".linenumber + let linelength = virtcol("$") + if maxlength < linelength + let maxlength = linelength + let maxlinenumber = linenumber + endif + let linenumber = linenumber+1 + endwhile + +" exe ':0' +" exe 'normal O' +" exe 'normal 0C'.maxlength + exe "normal" . maxlinenumber . "G" + exe ":echo \"" . maxlinenumber . ": " . maxlength . "\"" +endfunction + +command LongestLineLength call LongestLineLength() |
