Saturday, November 28, 2009

Re: [Vim-l] Need good tab-page tips on Vim Tips wiki

Wow, Bill. You have some great ideas, and some of them I haven't
thought of before. Here are some of my thoughts on how they might be
included in the wiki:

On Sat, Nov 28, 2009 at 5:33 AM, Bill Odom <wnodom@tmtowtdi.com> wrote:
> * Multiple full-page Vim help topics, each in their own
> conveniently-labeled tab page.
>
> * Reference material (API docs, framework source code, project notes,
> etc.) that I need to refer to often, but don't necessarily want taking
> up screen real estate adjacent to whatever I'm working on.
>

These both fall into the "full-page window that doesn't mess with your
window layout" category. I think they would both be great, briefly
mentioned in an "Intro to tap pages" tip.

> * At-a-glance summaries: I sometimes work in a buffer with most or all
> folds open, and keep a second tab page buffer with all folds closed.
> The folded version serves as an overview of the entire file, usually
> visible on a single screen.
>

This is a very interesting idea which I hadn't thought of and may use
myself. It could lead to other use cases; for example, rapidly finding
a place in a file, setting a mark (local to the buffer), and jumping
to it in another window/tab. I'm not sure where to put it. It seems a
little small for a tip by itself. It would probably be OK in the intro
to tab-pages tip, or perhaps a folding tip. It potentially could be
included with your "X-Ray tab" tip below.

> * Quick Vim environment modifications: I'm always tweaking my Vim
> settings, but I don't want to disrupt whatever I'm (supposed to be)
> working on just to update my .vimrc. I have a key map that opens
> $MYVIMRC and $MYGVIMRC in new tabs, so I can jump in and make whatever
> changes are necessary, then close them and immediately go back to what
> I was doing.
>

Another good "quick full-page window" tip, good for brief mention in
the intro tip.

> * "X-ray" buffers: I'll sometimes keep an alternate representation of
> a buffer in a separate tab page, with useful but visually-noisy
> options like 'list', 'cursorcolumn', 'cursorline', and 'number' all
> turned on, several :match patterns active, etc. This way, I can keep
> my regular working view clean and uncluttered, but quickly flip over
> to the information-overload version (the "x-ray") when I need it. (You
> don't have to get this crazy with it, of course; the idea works for
> pretty much any setting in `:help option-summary` labeled 'local to
> window'.)
>

I really like this one. The idea is very basic, but perhaps with some
expansion--some pre-made commands, etc.--it could make a tip on its
own. I think it deserves more than a short section in an "intro to
tabs" tip. Of course, it could be done in the same window with the
ability to restore the window-local settings, or a split window, so
these techniques should be mentioned as well. But I like that the tab
page doesn't take up additional screen real estate, and you don't need
to worry about restoring the state of the window when you're done.

> * Scratchpads: Tab pages are good for throwaway buffers, where I work
> with random chunks of text before (possibly) incorporating them into a
> file I plan to keep around.
>

I think this is another great "basic use" example for an intro tip.

> * Redirected Ex command output: I often want to use the output from an
> Ex command (vs. just viewing it in the status area), so I have a
> routine that runs a command, captures the output, then opens a new tab
> page containing the captured text. As with most of these techniques,
> this could also be done with a new window, or even within the current
> window, but I find using a new tab page less disruptive.
>

I thought we already had a tip on this, but I couldn't find it. John,
do you remember the tip? I actually do this myself from time to time
with a :tabnew | r !command. I, too, don't usually like to mess up my
screen layout with a buffer I'm just going to throw away shortly
anyway. At other times, the output of the command determines which
files I'm going to be opening next, and I like to be able to collect
all those files and the command output driving them in their own tab
page, like your "mini sessions" below.

> * Mini-sessions: If you remove 'tabpages' from 'sessionoptions',
> :mksession will only pay attention to the current tab page. This makes
> it easy to use tab pages as a lightweight project-organization tool --
> just open a set of files in whatever window layout you like, then run
> `:mksession some-random-project.vim` to save the current tab page as a
> session. To work on that set of files again, open a new tab page and
> :source the appropriate session file.
>

I also really like this very simple idea. Somehow I never thought of
this one either. I don't often use sessions currently, because it just
wasn't that useful for me. I often had a bunch of tabs open when I'm
just interested in restoring the state of one or two of them. I will
certainly use this one! I think this should go in its own section, in
a basic tip about using sessions. I'm not sure if we have one yet,
though, so for now it can be its own tip. Unless John knows of a good
generic "using sessions" tip.

Thanks for your contributions! I think we have the start to at least a
couple new tips. I look forward to seeing more!

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

No comments: