What they would do is set the default split orientation for commands
like C-w C-] (http://thread.gmane.org/gmane.editors.vim/48415), :diff
and so on. Normal commands currently switch orientation using
:vertical, but that option doesn't exist for keyboard shortcuts
without more invasive scripting, and every shortcut that splits a
window must be similarly modified with a lot of boilerplate.
Has this been considered before? Are there any major roadblocks I
should be aware of? (I haven't looked at the vim codebase in ~4 years)
A search quickly brought up several threads that would be served by
this change:
http://thread.gmane.org/gmane.editors.vim/48415
http://thread.gmane.org/gmane.editors.vim/25381
http://thread.gmane.org/gmane.editors.vim.devel/10002
http://article.gmane.org/gmane.editors.vim.devel/12551
via gmane.org/editors.vim: 'vertical split'
But I haven't seen any discussions for a global fix.
If this seems like a good idea I'll start with a documentation patch
for review here.
Thanks,
Kartik
http://akkartik.name
(I ran into this issue several years ago, without thinking of an
option-based solution:
http://vim.wikia.com/wiki/Using_vertical_splits)
--
You received this message from the "vim_dev" 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
On Do, 23 Sep 2010, Kartik Agaram wrote:
[split vertical request]
Try the attached patch, it provides the new setting 'splitvertical'
Mit freundlichen Gr��en
Christian
--
Wer zu lange ein Auge zugedr�ckt hat, dem werden eines Tages pl�tzlich
beide aufgehen.
-- Sophia Loren (eig. Maria Scicolone)
I've only been using it for a couple of hours, but I love it so far.
Has this patch come up before on the list? I'd vote to have it in.
(modulo adding splitvertical and variants to the syntax/vim.vim file)
Let me know if I can help with the process.
Bram decides what will be included in vim. He might comment on the patch
and then it may or may not be included in Vim. I don't know.
regards,
Christian
Just FYI, I made a couple of tweaks to syntax/vim.vim to include 6
variants of splitvertical as keywords.
After using splitvertical for a few weeks I find myself wanting a
:horizontal corresponding to the :vertical command, just for those
times I want a horizontal split. Should I just post an updated patch
on the mailing list?
Not my patch but Christian Brabandt's :)
Thanks for the tip. I just tested it and splitvertical trumps diffopt
horizontal so far. Is that right? Perhaps the configuration for a
specific mode should trump the global setting.
This has now put me over the edge to keeping a list of bugs about this
issue as we find them:
http://vim.wikia.com/wiki/User:Kartik_Agaram
(I wanted it to be in 'vim space', a wiki so anybody could easily
modify the list, and super lightweight so you didn't have to create an
account or login or *anything* to do so.)
Can anybody else think of options that affect split direction in vim?
Attaching updated version of the patch. Contains these improvements:
- implements :hor[izontal] command (now :hor vsp and :sp are
effectively the same)
- Quickfix and Commandwindow are not affected by 'splitvertical' (I
found that really annoying)
- added documentation for :horizontal and 'splitvertical'
- 'splitvertical' does not interfere with 'diffoptions' anymore
- syntax highlighting for vim script items
(I know this file is auto generated, but I don't know how?)
Caveats: This won't probably be included in Vim 7.3 as Bram told me.
Maybe with Vim 7.4
regards,
Christian
Today I discovered a new keyboard shortcut: C-w C-s to split
(circuitously via http://news.ycombinator.com/item?id=1807008). I was
going to report it here, but you'd gotten there before me.
One further bug report: :diffsplit, :diffthis and :diffpatch don't
respect 'splitvertical'.
Many thanks,
Kartik
[1] https://groups.google.com/group/vim_dev/msg/679fee5026967b82
On Di, 19 Okt 2010, Kartik Agaram wrote:
> Thanks a lot for this patch[1], Christian! I've been using it for a
> few weeks now and it's been working absolutely great. It's also
> eliminated almost 200 lines from my vimrc.
>
> Today I discovered a new keyboard shortcut: C-w C-s to split
> (circuitously via http://news.ycombinator.com/item?id=1807008). I was
> going to report it here, but you'd gotten there before me.
No I haven't done anything there. But I don't understand that page. It
refers to a graphical representation of the undotree. Though I also
created the histwin plugin, which is similar
>
> One further bug report: :diffsplit, :diffthis and :diffpatch don't
> respect 'splitvertical'.
That was on purpose. For those the 'diffopt' settings apply.
regards,
Christian
My reference to undotree was only marginally relevant. I was just
saying that C-w C-s splits vertically as it should, and its
documentation refers to splitvertical as well. So you were way ahead
of me :)
>> One further bug report: :diffsplit, :diffthis and :diffpatch don't
>> respect 'splitvertical'.
>
> That was on purpose. For those the 'diffopt' settings apply.
Ah. Perhaps diffopt should override splitvertical only if it's set?
On Di, 19 Okt 2010, Kartik Agaram wrote:
> My reference to undotree was only marginally relevant. I was just
> saying that C-w C-s splits vertically as it should, and its
> documentation refers to splitvertical as well. So you were way ahead
> of me :)
>
> >> One further bug report: :diffsplit, :diffthis and :diffpatch don't
> >> respect 'splitvertical'.
> >
> > That was on purpose. For those the 'diffopt' settings apply.
>
> Ah. Perhaps diffopt should override splitvertical only if it's set?
I think, this would make it more complex. I'd like to keep it clean and
don't want to depend one option on another one.
regards,
Christian