opening file in horizontal split with CtrlP in Terminal vim

4,764 views
Skip to first unread message

chadoh

unread,
Mar 20, 2012, 2:37:23 PM3/20/12
to janus-...@googlegroups.com
Howdy, all. All-in-all, I love Janus and am a big proponent of it. Thank you for all of the work you do!

I was wondering if anyone else was seeing this behavior, or if it might be something related to my local setup. In MacVim, using CtrlP and then using <c-cr> to open in a new horizontal split works great. When in Terminal vim, however, it does not. However, <c-v> to open in a new vertical split still works.

This is an annoying problem. I love splits; they're a big reason I came back to vim after a month of dicking around with sublime. And I'm really enjoying tmux. So I'd like to keep my one-app dev environment if possible, and just get horizontal splits working optimally.

Dan Neumann

unread,
Dec 21, 2012, 4:41:47 AM12/21/12
to janus-...@googlegroups.com
I just googled this question and landed here. I can live with having to enter `:sp` to manually split, moving to that split, and invoking ctrl-p.

Another option could be to map the capitalized version of your ctrl-p to do that for you.

For instance, I use ",t" to call ctrl-p. So I could do: :map ,T :sp<cr><c-w>j,t

:sp - create horizontal split
<cr> - enter
<c-w>j - move to that new split
,t - invoke ctrl-p

Oh well!

Jeroen De Vlieger

unread,
Jan 2, 2013, 7:28:42 AM1/2/13
to janus-...@googlegroups.com
A file can be opened in a horizontal split  by pressing <c-x>, <c-cr> or <c-s> as mentioned by the help file of ctrlp


Opening/Creating a file:~

  <cr>
    Open the selected file in the 'current' window if possible.

  <c-t>
    Open the selected file in a new 'tab'.

  <c-v>
    Open the selected file in a 'vertical' split.

  <c-x>,
  <c-cr>,
  <c-s>
    Open the selected file in a 'horizontal' split.

  <c-y>
    Create a new file and its parent directories.

Chad Ostrowski

unread,
Jan 2, 2013, 7:59:55 AM1/2/13
to janus-...@googlegroups.com
In MacVim that works fine. In iTerm or Terminal vim, it does not. <c-s> does nothing, <c-cr> does the same thing as <cr>, and hey wouldn't you know it <c-x> does actually work. So I can use that. But is this not the behavior you see?
--
You received this message because you are subscribed to the Google Groups "Janus - Vimius" group.
To view this discussion on the web visit https://groups.google.com/d/msg/janus-vimius/-/DjsRXKEf08wJ.
To post to this group, send email to janus-...@googlegroups.com.
To unsubscribe from this group, send email to janus-vimius...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/janus-vimius?hl=en.

Jeroen De Vlieger

unread,
Jan 3, 2013, 5:02:08 AM1/3/13
to janus-...@googlegroups.com, h...@chadoh.com
Heh, I have never notices it because I consistently use <c-x> but <c-cr> and <c-s> also don't work for me in the terminal vim. All three options do work in gvim though. Weird

Jeroen

Chad Ostrowski

unread,
Jan 3, 2013, 5:50:03 AM1/3/13
to janus-...@googlegroups.com
In Dvorak, X is way over where B is in Qwerty, so it's not the most comfortable of mappings for me. But I'm glad to have an easy way to make horizontal splits again, regardless.
To view this discussion on the web visit https://groups.google.com/d/msg/janus-vimius/-/TnJubRVSqWkJ.

chadoh

unread,
Feb 13, 2013, 10:45:48 AM2/13/13
to janus-...@googlegroups.com, h...@chadoh.com, bra...@pipelinedealsco.com
My compatriot Brandon Hilkert helped me out:

Ctrl-S is used for control flow in terminal app.

Run this in the console or add to your .bashrc to disable it, which frees up <c-s> to be used by vim.

stty -ixon -ixoff 

references:
Reply all
Reply to author
Forward
0 new messages