sponsor Vim development Vim logo Vim Book Ad

tabwins.vim : Create Tabs of symmetric or asymmetric Windows, empty or populated

 script karma  Rating 12/3, Downloaded by 514    Comments, bugs, improvements  Vim wiki

created by
Charles Sheridan
 
script type
utility
 
description
Easy access to the power of the Vim GUI.

"I'm very impressed with it. It gets my highest accolade: the coveted 'Why The
Hell Isn't This Functionality Built-In To Vim' award."
- Damian Conway


See the screen shots at
  https://github.com/cesheridan/graphics/tree/master/tabwins


1 command for immediate access to customized window structures
and content ~during~ Vim sessions.

The Developer
  - Avoids hit-or-miss, time-consuming, manual, repetitious
    runs of :split/:vsplit, and thought-sinks about how
    to produce the intended window structure

  - Avoids losing current configurations due to mid-session
    reloads of backed-up Vim sessions that have preferred
    window structures

  - Avoids loss of focus from these discontinuities


FORMS

  :{Tabwins cmd}   {window_dimensions}; {fill_spec,...};  {tab_option, ...}
  :{symmetric cmd}                                         {fill_spec,...};  {tab_option, ...}

  Where
     :{Tabwins cmd} is any of :Tabwins, :TabwinsVertical, :TabwinsHorizontal
     Aliases                              :T,               :V,                        & :H
     About aliases, see tabwins.txt section "Configuration"/TabwinsConfiguration.

     :{symmetric cmd} is any of the form :{V|H}IxJ or :{V|H}I  

     'fill_spec'  
     is a file, dir, shell/vim var, or string evaluable
     by :execute -- see EXAMPLES

     'tab_option'
     has Vim key:value pair syntax -- see EXAMPLES

  Semicolons separate arg groups, commas separate inside groups.

  {window_dimensions} is the only mandatory arg, for :{Tabwins cmd}

  SECTION "Usage/"TabwinsUsage IN tabwins.txt HAS MORE DETAIL.


EXAMPLES

  >> ----------------------------------------------------------------
  >> Empty Windows
  >> ----------------------------------------------------------------

  :Tabwins 1211
  :T               1211
  " For a new tab of 4 columns of 1, 2, 1, & 1 windows successively
  " left to right.


  :TabwinsHorizontal 4221
  :H                               4221
  " For a new tab of 4 rows, with 4,2,2, & 1 windows successively
  " top to bottom.

  >> ----------------------------------------------------------------
  >> Populated Windows
  >> ----------------------------------------------------------------

  :Tabwins            1211; $HOME, '~/.bashrc', '~/.vimrc', '/', '/usr/bin'
  :T                  {                   as above                        }
  " 'fill_content' specs of files are automatically opened via :edit,
  " while specs of dirs are opened via :Explore
  " (Specify the '' empty string for windows intended to be empty.)


  :Tabwins           11111; $HOME, '~/.bashrc', '~/.vimrc', '/', '/usr/bin'
  :T                 {                    as above                        }
  " Same buffer content, in different window structure, of 5 cols,
  " one window in each.


  :TabwinsHorizontal 11111; $HOME, '~/.bashrc', '~/.vimrc', '/', '/usr/bin'
  :H                 {                    as above                        }
  " Flip axis priority of above to the horizontal


  :Tabwins             312; '~/.bashrc', '~/.vimrc', '~/.git', $HOME, '/', '/usr/bin'
  :T                   {                  as above                                  }

  >> ----------------------------------------------------------------
  >> Symmetric Window Structures
  >> ----------------------------------------------------------------
  In a symmetric window, all secondary axis dimensions are the same.

  :V5x8
  :H5x8
  :V6
  :H6
  :V8x14
  :H8x14
  " Empty windows

  :V5x1


  :V5x1 $HOME, '~/.bashrc', '~/.vimrc', '/', '/usr/bin'
  " Structure & content same as :Tabwins 11111 above


  :V5   $HOME, '~/.bashrc', '~/.vimrc', '/', '/usr/bin'
  " Same result again: since the secondary axis has only 1
  " window for its dimensions, V5 is available as an even
  " shorter alias.

  >> ----------------------------------------------------------------
  >> Dimensions >9
  >> ----------------------------------------------------------------

  :Tabwins [ 5, 8, 13, 21 ]
  :T               [ 5, 8, 13, 21 ]
  " For a 4-column tab with 5, 8, 13, 21 windows successively left to right.


  :Tabwins [ 14, 14 ]
  :T       [ 14, 14 ]
  " Or, :V2x14


  :Tabwins [ 40, 30, 40, 30 ]
  :T               [ 40, 30, 40, 30 ]
  " For large monitors ...


  >> ----------------------------------------------------------------
  >> fill_specs with Multiple Commands
  >> ----------------------------------------------------------------

  :Tabwins 1112;  $HOME, '~/.bashrc', '~/.vimrc', '/', 'Explore /usr/bin | resize 20'
  :T                {                           as above                                     }
  " Does a :resize of the last window, via Vim '|' command concat.  If a file
  " or dir is followed with concated commands, the caller needs to explicitly
  " add the command that opens the file or dir, i.e. 'Explore' in this example.

  >> ----------------------------------------------------------------
  >> Tab Options
  >> ----------------------------------------------------------------

  :Tabwins 1211;  $HOME, '~/.bashrc', '~/.vimrc', '/', '/usr/bin'; 'ending_window_number' : 2
  :Tabwins 1211;  $HOME, '~/.bashrc', '~/.vimrc', '/', '/usr/bin'; 'netrw_liststyle'      : 3
  :T                 {                    as above                                                                       }


  :Tabwins 1211;  $HOME, '~/.bashrc', '~/.vimrc', '/', '/usr/bin'; 'netrw_liststyle'      : 3, 'ending_window_number' : 2
  :T                 {                    as above                                                                                                                       }
  " Multiple tab_options in same command.


TABWINS MENU

  Default settings load Vim menu Tabwins, for access to selected
  tab-builder commands.  Those and additional tab builders are
  available via Vim commands defined in tabwins.vim. The menu has
  only a small portion of the tab builders defined in tabwins.vim.


HELP IN VIM

  :TabwinsFindTabwins loads the tabwins .vim & .txt files
  into a V2 window, if your Vim &runtimepath can see them.


  :TabwinsFindTabwins is in the 'Tabwins' menu.


HELP IN HTML

  The top-level of the github repository includes an html
  version of this Vim .txt file, viewable in rendered form via
    http://htmlpreview.github.io/?https://github.com/cesheridan/tabwins/blob/master/tabwins.txt.html    


THIS PLUGIN AS ARTIFACT
http://modcult.org/posts.html -- entry for Nov 13 2013
 
install details
  tabwins.vim tabwins/ dir is structured for deployment in a
  pathogen-managed bundle directory, e.g. ~/.vim/bundle/

  If pathogen is not installed, copy the the files in the tabwins
  subdirs to the same subdirs in ~/.vim.

  Enable :h tabwins in a pathogen environment with
    :Helptags
  and in a non-pathogen environment with
    :helptags


Also available at
   https://github.com/cesheridan/tabwins
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
tabwins.v3.1.0.tgz 3.1.0 2013-12-08 7.0 Charles Sheridan 1. For fill_specs that are files, put line #1 at window top.
2. tabwins.txt: correct Fill_tab() key 'dir_cmd_name'     to 'explore_cmd_name'
3. tabwins.txt: correct 'tabwins_dir_reader_name_default' to 'tabwins_explore_cmd_name_default'
4. tabwins.txt: various improvements.
tabwins.v3.0.0.tgz 3.0.0 2013-12-03 7.0 Charles Sheridan 0. No behavioral changes to command logic.
1. Tab option 'line_number_at_window_top'
   renamed => 'line_number_at_netrw_window_top'

2. Add configurable build of command aliases :T, :V, :H, and :TF
   for :Tabwins* commands.  An alias is NOT BUILT IF an existing
   command has the same name.  See ""Configuration"/*TabwinsConfiguration*
   in tabwins.txt.

3. All defaults to Fill_tab() are now user-configurable global vars.

4. Most functions converted to vimscript ':s' scope -- the
   Explore_*() functions and Fill_tab() are the exceptions.

5. Demo tabs are now :Tabwins* commands rather than functions.
6. Remove the :Ot* abbreviated commands for the demo tabs.
7. tabwins.txt: Add example builder command, & various improvements.
8. Comments in code cleaned up.
tabwins.v2.2.0.tgz 2.2.0 2013-11-24 7.0 Charles Sheridan - CLI commands support tab_option args
        ALL tabwins.vim capability is now available directly to
        the Vim command line.  A developer should not have to call
        functions in tabwins.vim to create a tabwins command.

- Configurable reloadability of tabwins.vim.

- Add :TabwinsFindTabwins and include it in the 'Tabwins' menu.

- Function Fill_tab() arg 'fill_content' renamed => 'fill_specs'

- Rework documentation.
tabwins.v2.1.0.tgz 2.1.0 2013-11-17 7.0 Charles Sheridan Enable command-line spec of window content.
tabwins-master.v2.0.0.tgz 2.0.0 2013-11-13 7.0 Charles Sheridan 1) As previewed in v1.8.0, the predefined asymmetric :{VH}{I} commands are removed, replaced with calls to :TabwinsVertical, :TabwinsHorizontal, and :Tabwins.  All the Create_tab_{vh}*() commands are removed, as the :Tabwins* commands can create the same tabs, with arbitrary dimensions.

2) Addition of :Tabwins, establishing a plugin default to :TabwinsVertical

3) Lots of updates to comments, reflecting 1) & 2)
tabwins-master.tgz 1.8.0 2013-11-13 7.0 Charles Sheridan New commands :TabwinsVertical and :TabwinsHorizontal to create arbitrarily-dimensioned symmetric AND asymmetric tabs.  In v.1.7.0, each asymmetric command required creation of a dedicated function, which is no longer the case.  

Most of the predefined asymmetric commands in v.1.7.0 will be removed in a later release.
tabwins-master.zip 1.7.0 2013-11-11 7.0 Charles Sheridan Initial upload
ip used for rating: 50.16.75.46

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
SourceForge.net Logo