Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ctrl + S is not working as a horizontal split in VIM when using CommandT

Tags:

vim

macvim

I've been tweaking my ~/.vim quite a lot lately, and it seems that I broke something.

I'm using the CommandT plugin, which when the search is open allows for the following:

  • enter - open the file in current buffer
  • Ctrl + S - open the file in horizontal split window
  • Ctrl + V - open the file in vertical split window

The problem is, that Ctrl + S suddenly stopped working in terminal VIM, only Ctrl + V is working. At first I thought I broke something in my general config, but then I tried it in MacVim, and Ctrl + S works just fine.

I'm not aware of having set anything specific only to the terminal VIM.

Is there any way that I can tell, if a key is being rebound to something else and where is that happening?

btw, my ~/.vim is a fork of Janus with most stuff removed and changed, I'm keeping it mostly for the Rakefile for installing plugins. here's the repo

like image 770
Jakub Arnold Avatar asked Dec 23 '11 13:12

Jakub Arnold


2 Answers

I've found solution for this problem here: https://apple.stackexchange.com/a/34503

Just put in your .bashrc / .zshrc this line of code:

stty -ixon -ixoff
like image 147
sparrovv Avatar answered Nov 08 '22 16:11

sparrovv


You can list all current mappings by typing :map inside the command window.

You could also clear all maps using :mapclear and then map <C-S> again.

It could be that you vimrc contains alternate maps depending on the environment. Look for things like has("gui_running").

Finally when running MacVim gvimrc is sourced vs. vimrc when running vim in the terminal.

Depending on the differences in both of those, mappings and other features will change.

I noticed, that you are talking about Cmd key in the title, but about Ctrl in your description. The Cmd key does not work in terminal vim.

If you are talking about the Cmd key, consult my answer to a similar question.

like image 25
Thorsten Lorenz Avatar answered Nov 08 '22 17:11

Thorsten Lorenz