horizontal split window not working with command-t

  1. Karl Baum

    I am able to open a vertical split but when i enter <C-s> nothing happens and when i enter <C-CR> it just opens the file without split.

    I am using command-t for macvim 7.3.107 on snow leopard 10.6.8 and most of the janus vim configuration.

    https://github.com/carlhuda/janus

    thx!

    -karl

  2. Greg Hurrell

    I believe this is depends on what TERM you are using.

    If you are using a graphical client like MacVim then all the mappings will work out of the box, but if you are using Vim in the terminal, it is possible that some of the default mappings won't work because your key presses end up getting mapped to escape sequences and other weirdness may happen.

    You can try twiddling your TERM settings, but generally the most straightforward workaround in this case is just to set up your own mapping which works in your terminal. Depending on how deeply you want to investigate, you can try to find out what key sequence is actually being sent to Vim by the terminal when you hit CTRL-<CR>. Or you can just pick an alternative mapping that makes sense to you.

    You can set up your own mapping with the g:CommandTAcceptSelectionSplitMap setting. By default, CTRL-<CR> and CTRL-S are set to open the selection in a horizontal split. You may find that CTRL-S works already in your terminal.

  3. Karl Baum

    Hi Wincent. I was able to get it working with this setting in my .vimrc.local

    let g:CommandTAcceptSelectionSplitMap=['<CR>', '<C-g>']

    I am honestly not sure how to figure out what is exactly being sent to vim. The interesting thing is that my friend also has janus installed and had the same issue with <C-s> for split windows.

    Thanks for your help!

    -karl

  4. roovo

    I've just hit the same issue (using iTerm2 on OSX Lion). The solution I've found (to getting the <C-s> combination working) is to put:

    stty -ixon

    in your .bashrc (or equivalent shell startup script). Understanding this is beyond my comprehension of things tty, but I got the info from the following thread where the same key combo wasn't getting through to readline.

    http://groups.google.com/group/iterm2-discuss/browse_thread/thread/47700851d59386fb

  5. anonymous

    Solved: You dont need to modify anything in your .vimrc to use ctrl + s with command-t. The only thing you need to do is to add this to your ~/.bashrc :

    stty -ixon

    Thank you roovo

Reply

This topic is now closed.