Stahlman Family wrote:
> 
> 
> Paul wrote:
>> On Mon, 5 Oct 2009, Brett Stahlman wrote:
>>
>>> nnoremap <F8> :exe "resize " . (line('.') - line('w0') + 1)<CR>\|zb
>> Yes, you have the idea. That works for horizontal split. Now, how about for 
>> vertical split? I don't see a column() function...
> 
> Well, I see that Christian has already supplied you with what appears to 
> be a more complete solution, so this may not be necessary, but here's a 
> more simplistic mapping, which reflects my best guess as to what you 
> were trying to do. It works for both 'wrap' and 'nowrap'. What it does 
> is shrink the current window so that anything to the right of the cursor 
> is no longer visible.

Well, actually, when the 'wrap' option is set, the entire line is always 
visible; in that case, the cursor position determines the character 
after which the wrap will occur. In both cases, the idea is as follows: 
without scrolling the line horizontally (i.e., without changing the 
first visible character on the line), move the window's right edge so 
that the original cursor position is just to the left of it.

Brett S.

  It does so without altering what is in the first
> visible column.
> 
> <<<All on one line...>>>
> 
> nnoremap <silent> <F9> :if !&wrap\|let rvc = virtcol('.')\|let rc = 
> col('.')\|exe "norm! g0"\|let lvc = virtcol('.')\|exe "vert resize " . 
> (rvc - lvc + 1)\|call cursor(0, rc)\|exe "norm! ze"\|else \|exe "vert 
> resize " . col('.')\|endif<CR>
> 
> Brett Stahlman
> 
>> Thanks!
>>
> 
> > 
> 

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to