Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

open map/planes in a new split instead of new tab #8

Open
marttt opened this issue May 22, 2014 · 2 comments
Open

open map/planes in a new split instead of new tab #8

marttt opened this issue May 22, 2014 · 2 comments

Comments

@marttt
Copy link

marttt commented May 22, 2014

Hi! What's the rationale behind opening Microviche in a new tab by default? Could you add an option for opening it in a new (horizontal) split instead?

I'm typically using a widescreen monitor set to portrait mode, and I'd like to use Microviche for storing "background" information for my main writing project. So I could have both things simultaneously in sight like so:

+---------------------------------+
|               main              |
|              project            |
|                                 |
|                                 |
+---------------------------------+
|  MV     | MV     | MV      |    |
|  plane1 | plane2 | plane3  | .. |
+---------------------------------+

Ideally, both the map and plane could be opened in this lower split. And there could also be an option for going fullscreen when a bigger overview of the map/planes is needed.

I find your plugin really interesting. Thanks for your work!

@q335r49
Copy link
Owner

q335r49 commented May 22, 2014

Yeah, the lack of support for horizontal splits is an old problem that has been consistently deferred. The panning functions are all fairly hackish as there's no real API for determining window layout or adjusting multiple splits at once. Panning consists mostly of resizing a single window and making sure it worked by checking the size of another window, and the logic of this operation is reduced when one assumes a simple window layout.

So I've had this on the backburner for awhile but I keep on delaying it mostly because while it is certainly something that would make the script more robust it is also not something I myself use a great deal and so wouldn't really get the debugging attention it would need. It is planned for a future release though.

For now, have you considered writing a small script to toggle the main project window? Ie, to close the horizontal split when one needs to pan, and to have it open at other times.

Maybe like:

nmap <f3> :if winheight(1)<&lines-&ch\|1 wincmd w\|q\|else\|topleft 25 split MainProject\|en<cr>

Ie, "On pressing f3 in normal mode, if the height of the first window is less than the number of lines on the screen minus the command height, go to the first window and quit. Otherwise, split the window "MainProject" across the entire top of the screen and make it 25 lines tall."

or maybe something more sophisticated:

let MainWinHeight=25  
let MainWinName=''  
nno <silent> <f3> :exe winheight(1)<&lines-&ch? '1 wincmd w\|let MainWinHeight=winheight(1)\|let MainWinName=expand("%")\|q' : 'topleft '.MainWinHeight.'split '.fnameescape(MainWinName)<cr>

Here the script remembers and restores the previous height and file

@marttt
Copy link
Author

marttt commented May 23, 2014

Thanks for the explanation! I'll try the workaround, looks like it'll do
the job.

2014-05-22 23:21 GMT+03:00 q335r49 [email protected]:

Yeah, the lack of support for horizontal splits is an old problem that has
been consistently deferred. The panning functions are all fairly hackish as
there's no real API for determining window layout or adjusting multiple
splits at once. Panning consists mostly of resizing a single window and
making sure it worked by checking the size of another window, and the logic
of this operation is reduced when one assumes a simple window layout.

So I've had this on the backburner for awhile but I keep on delaying it
mostly because while it is certainly something that would make the script
more robust it is also not something I myself use a great deal and so
wouldn't really get the debugging attention it would need. It is planned
for a future release though.

For now, have you considered writing a small script to toggle the main
project window? Ie, to close the horizontal split when one needs to pan,
and to have it open at other times.

Maybe like:

nmap :if winheight(1)<&lines-&ch|1 wincmd w|q|else|topleft 25
split MainProject|en

Ie, "On pressing f3 in normal mode, if the height of the first window is
less than the number of lines on the screen minus the command height, go to
the first window and quit. Otherwise, split the window "MainProject" across
the entire top of the screen and make it 25 lines tall."

or maybe something more sophisticated:

nno :if winheight(1)<&lines-&ch|1 wincmd w|let
MainProjectName=expand('%')|q|else|exe 'topleft 25 split
'.(exists("MainProjectName")? fnameescape(MainProjectName) : input('Enter
name of main project: ','','file'))|en

"... go to the first window, store the name into MainProjectName, and
quit. Othewise, if the variable MainProjectName exists, open that file
across the top of the window (making sure to escape any spaces or special
chars), otherwise, prompt user for the name of the file, using file name
completion."


Reply to this email directly or view it on GitHubhttps://github.com//issues/8#issuecomment-43939110
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants