Wednesday, October 1, 2014

Re: double the columns in vim on vertical split

Kamaraju,
  I use a 'function' to expand/contract window size when I turn on or off 'tags-list' window for my coding sessions.
I'm sure I lifted this idea from a google-search on this need.  
Copying in the code in below.  Use it as a guide if you want, and modify to fit your need.  
I have this in my .vimrc file.
---Dave.



" ====================
" TAG-LIST tool.
" ====================
if split( system( "ps -o command= -p " . getpid() ) )[0] == "gvim"
    let s:tagson = 0
    function! MyTagListFunction()
        if s:tagson == 0 
            "Tags going on - increase window size
            set columns+=30
            let s:tagson = 1
        else
            "Tags going off - reduce window size
            set columns-=30
            let s:tagson = 0
        endif
        :Tlist
    endfunction

  if version >= 600 
      amenu icon=taglist.bmp ToolBar.taglist :call MyTagListFunction()<CR>
      tmenu ToolBar.taglist TAG-LIST 
  endif 
endif


On Wed, Oct 1, 2014 at 9:07 AM, Igor Forca <igor2x@gmail.com> wrote:
Can you explain why you need columns setting? What is your operating system? I see on Windows whole gVim program gets this size (which is little bit useless) and on vim for Linux it gets text truncated at exactly 80 characters.

Maybe you are looking for a setting like:
set textwidth 80

The above command with truncate whole words in new rows if passing 80 characters. It also preserves the 80 characters if you add new window with: vsp command.

If using textwidth command you have to delete "set columns=80" from your ~/.gvimrc file and restart Vim.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: