Monday, April 10, 2017

Re: RFE: enable gvim to open a buffer or tab in a new window

On Friday, April 7, 2017 at 6:50:25 PM UTC-5, L. A. Walsh wrote:
> Ben Fritz wrote:
> >
> > Is maximizing for the split view and then restoring the application window an option? If not is there a reason you need specifically 80-character application windows? Or do you just like that size?
> >
> ----
> I never use full screen unless I'm not doing work (movies/games).

OK, so that makes things somewhat more difficult, but still it might be possible to work with.

> 80-chars -- many projects require lines to fit in an 80-char
> width. It's a standard in the software world (not so much in the web
> world).
>

This part is easy: ":set textwidth=80" and make sure the 'formatoptions' setting contains 'c' or 't' or both. You also might be interested in the 'colorcolumn' option to draw a line at a specific column, for example column 80, to show when you're getting near to the 80-character boundary.

> And there's the final 'rub'... I'll try the other commands
> you mention -- but I gave 1 example (that can't even be
> handled w/80 column widths). When I'm working on a project
> with >50 file-pairs, working to resize any of them manually is a
> pain -- thus my comment that it was easier to quite and restart both
> files in separate 80 column windows (FYI -- my window columns are
> adjusted for the line numbers, automatically, so if a file has
> line numbers turned on in the header, a vim-function takes care of
> resizing the windows wider to handle the extra columns needed for
> the numbering).

It sounds like you could benefit from a mapping to quickly do ":wincmd o" or "<C-W>O" (that's CTRL+W followed by O) to close all but one window, leaving "only" the current window open, and then call your function to resize as you like. With that mapping it would be only one keystroke to restore your window to the size and layout you like.

>
> Also, side-by-side is one of the simplest to describe, but
> many times, I'll have windows staggered so a quick click can
> switch me to a different file. <<THAT is a major reason why
> I don't use full screen. When I want to take a break or do
> something else, I'll minimize my 13-vim edit buffs(6-w/2 tabs, +1),

I'd suggest just keeping a bunch of tabs open in ONE Vim and switching between the tabs, here. If you need to reference more files at the same time you can even open them as additional windows in the same tab. I frequently have 4-6 windows or more open in my Vim as I edit. But I understand more now why you wanted to be able to quickly spawn a new application window!

There is a --remote-tab flag you can use from the shell command line when launching Vim to open a tab in an existing Vim application window instead of launching a new Vim. See :help clientserver, it might be worth experimenting with and making some mappings to get what you want via mappings instead of mouse dragging. Also see the standard "editexisting" plugin shipped with Vim in the "pack/dist/opt" folder for an example of multiple application window shenanigans.

> or if it's a vid or game, just leave them for later. Also if
> full screen I often won't see other application messages hidden
> by the full screen window.
>
> In your case (and Jacky's), using vim full-screen eliminates
> even the thought of staggered windows or using the mouse to
> arrange them. Full-screen narrows your view -- both in terms
> of limiting it to only the files you've brought up, but also
> to not seeing the usefulness of vim having multiple independent
> windows as an option.
>

I occasionally bring up multiple Vim application windows when I'm switching between multiple unrelated tasks. But I like to keep everything related to my current task in one application window. I can see you're using multiple unrelated application windows for that, and understandably want to link them together more efficiently. Unfortunately Vim was not designed for that and the underlying assumption that there is ONE application window to worry about is pretty deeply ingrained in Vim, so it will take a LOT of time and effort to add such a feature, and the benefit over using multiple "tab pages" instead may not be worth that effort.

> Do you use vimperator as well? (a vim-like extension that
> used to be maintained for the FF web-browser. I tried it too,
> BTW, but couldn't get used to using the keyboard to navigate
> web pages.

I don't use vimperator or other plugins for vim-like movements in the browser. I never really saw much of a point since in a browser I mostly only scroll, view specific links, and switch tabs. Vim's power to me is mostly in manipulating text, not viewing it.

--
--
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:

Post a Comment