Sunday, April 9, 2017

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

I wrote a script to implement the side-by-side view with vim. See if it meets your need.

After sourcing it:

1. To enable the side view, first maximize your Vim window (or drag it large enough. Resizing vim window is system specific, need apps like 'wmctrl' so I didn't do it. You'll have to manually arrange them even if you could fire up a separate frame window anyway)

2. Use :vsplit twice so you now have 3 vertical windows, use the *left* 2 for side view

3. Press Ctrl-I/K/J/L in Normal mode to switch windows alongside 4 direction

4. When inside a window, press \s to toggle the side view status on and off. You would want to turn the left 2 windows on. The status will be shown in the statusline('SView' with green background at the left corner) as well as the column numbers.

5. Windows with the side view status set will automatically try to resize themselves to 80 columns wide and their height to maximum when you switch windows

6. Press + to add a new, minimized window below your current window, new window will automatically be set as a side view window. When you're done just use :q to close it

7. Use :only to close all other windows in the current tab page

8. Inside a window, use :E to open the default 'netrw' plugin to navigate to your target file.

9. If you have the file open in another place and want to move it to a side view window, first move to that place, press \\(backslash twice) to save the full path to register @", then move to the side view window and use :edit command then ^R"(ctrl-r and ") to paste the path in the command line

10. If you have the path in another application, say your system file browser and want to move it into your vim, first copy the path to your system clipboard, then use ^R+ to paste it in vim under command/insert mode.

11. Keep in mind if you leave the side view status on with a window, it will always try to resize itself to 80 columns wide even if there's no other side view windows left.


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