On Apr 17, 5:00 am, Jürgen Krämer <[email protected]> wrote:

>
> you might try something like the following
>
>   function! ActualNumberWidth()
>       if !&number
>           return 0
>       endif
>
>       let numwidth = strlen(line('$')) + 1
>       return (numwidth > &numberwidth) ? numwidth : &numberwidth
>   endfunction
>
>   au CursorHold,CursorHoldI * let c=80 + ActualNumberWidth() | if c != 
> &columns | let &columns=c | endif
>
> The function calculates the space used for the last line number if the
> 'number' option is set, and the autocommand sets the new width if
> the size has changed.

Don't forget the foldcolumn and the signcolumn if you want this to
work in the general case as well!
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to