textmanipulation.vim (259B)
1 function! Centre() 2 exec 's/^[[:space:]]*//' 3 normal $ 4 let cols=col(".")+1 5 let offset=(80-cols)/2 6 let c=0 7 while c < offset 8 let c+=1 9 exec 's/^/ /' 10 endwhile 11 echo c 12 endfunction 13 14 function! PlaceCC() 15 let cols=col(".") 16 exec 'set cc=' . cols 17 endfunction