Ctrl+S (horizontal split) not working with Command-T in vim

只愿长相守 提交于 2019-12-03 17:04:56

问题


I can't get the horizontal split to work. Ctrl+enter does nothing, Ctrl+S does nothing.

I've been googeling this for a bit and the only solutions I've found so far are related to OSX.

On both Arch Linux and Ubuntu, having same problem (but also the same config).

I'm not using Janus or anything like it, just a very basic config

set t_Co=256
set tabstop=2
set expandtab
set shiftwidth=2
set fileencoding=utf-8
set encoding=utf-8
set termencoding=utf-8
set showcmd
filetype plugin indent on
"color molokai
syntax enable
autocmd! BufNewFile * silent! 0r ~/.vim/skel/tmpl.%:e
set laststatus=2 " Always show the statusline

set backspace=indent,eol,start  " backspace through everything in insert mode

"" Searching
set hlsearch                    " highlight matches
set incsearch                   " incremental searching
set ignorecase                  " searches are case insensitive...
set smartcase                   " ... unless they contain at least one capital letter

call pathogen#infect()
colorscheme jellybeans
" use comma as <Leader> key instead of backslash
let mapleader=","

" Double <Leader> to switch between buffers
nnoremap <leader><leader> <c-^>
" double percentage sign in command mode is expanded
" to directory of current file - http://vimcasts.org/e/14
cnoremap %% <C-R>=expand('%:h').'/'<cr>

map <leader>f :CommandTFlush<cr>\|:CommandT<cr>
map <leader>F :CommandTFlush<cr>\|:CommandT %%<cr>

[~]$ ls .vim/bundle
rbenv:system command-t jellybeans.vim snipmate-snippets tlib_vim vim-addon-mw-utils vim-powerline vim-snipmate

I was hoping someone would be able to shed some light on this, it's getting really frustrating.

Not entirely sure whats wrong but it have work occasionally, but not at all right now.

Pressing CTRL+S does nothing, shift+enter just opens it normally in the current buffer and ctrl+enter just hops down the search results list in Command-T.


回答1:


In most terminals, Vim cannot distinguish between Enter and its combinations with Ctrl or Shift, unfortunately; these only work in GVIM.

The terminal's flow control commands may interfere with Ctrl-S and Ctrl-Q; this can be fixed (in the terminal, not in Vim!) with

stty start undef stop undef

in ~/.bashrc, ~/.zshrc, etc.



来源:https://stackoverflow.com/questions/13648237/ctrls-horizontal-split-not-working-with-command-t-in-vim

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!