Saturday, April 8, 2017

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

Linda,

If you're willing to do some configuring, you can improve your
current workflow using Vim as it stands today, even if it only
approximates your desired layout of multiple top-level
application frames. Here are some quick suggestions; I'm sure
the list can provide help if you choose to pursue any of them.

- You can create Gvim menus for any of the commands that you've
seen suggested here, so you can use the mouse instead of the
keyboard.

- You can resize the top-level Gvim frame via ``:set columns``.
I do this all the time with two simple commands that take into
account line numbering and such. I call them ``:L1`` and
``:L2`` which give me one-column or two-column layouts fixed
at 80 columns. You can setup a menu that toggles your layout
based on whether you are looking at a tab with one file or a
tab with two files. Along with ``<c-w>=`` to automatically
balance the file width, you can automate the switching of your
views. I suspect you would never have to use the keyboard to
perform resizing if you analyze your use cases and script up
solutions for them, then create menus to activate them.

- You may want to take another look at tabs. In Gvim, you can
switch between tabs by clicking on the tab, instead of using
your desktop window manager to switch between Gvim instances.

There may be a plugin to present you with a menu of tabs to
choose from as well, or you could script that up if you found
you had too many tabs to easily see which one is which.

- You might also look into the Project plugin
(http://www.vim.org/scripts/script.php?script_id=69), which
gives you a menu of files in your project that you can select
from. This can help you reduce the amount of typing to select
a file.

- I use Derek Wyatt's "fswitch" plugin to switch between
"companion" files (as he puts it):
https://github.com/derekwyatt/vim-fswitch

If you have a .cc file open and you want to open the
corresponding .h file, fswitch can find it and open it for
you. There are other similar plugins to try as well.

- I greatly enjoy fuzzy file finders. I routinely use CtrlP
(https://github.com/ctrlpvim/ctrlp.vim.git) and LustyExplorer
(https://github.com/sjbach/lusty.git) to avoid having to type
all the characters in a filename. If you are trying to reduce
the amount of typing, you may want to consider such a plugin.

- Similarly, if you aren't already using tags, you may want to
consider installing Exuberant Ctags and generating a ``tags``
file for your entire project. I find this feature
indispensable for navigating through my codebase. When I want
to find the definition of a function, I just place my cursor
on the identifier in my current file and press a key; but in
Gvim, you can use the mouse to follow the tag as well, saving
keystrokes.

Michael Henry

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