Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gVim + US-International: Not combining dead keys with space

I am using "United States-International" on Windows 7, which causes problems in combination with gVim 7.3.

In the US-International keyboard layout the keys " and ' are dead keys, that means, you can combine them with another key. For example pressing "+a results in ä and the keys '+a in á. In order to insert one double quote you simply have to hit "+space.

But when I enter "+space in gVim (in edit mode) nothing happens, no character is inserted. When I further hit space, only spaces are inserted. It seems that the keys "+space are not combined to one " character. However combining " with a to ä works as expected.

When I press " followed by spaces, the " is buffered until I enter another char and is then combined with that (if possible). Examples:

"+space+space+a => » ä«  
"+space+space+b => » "b«
"+space+space+" => » ""«

Does anyone know how to solve this problem?

BTW, the behaviour isn't affected in vim (through cmd.exe)

like image 812
Chris Avatar asked Oct 14 '10 20:10

Chris


4 Answers

My current workaround: Use the latest gVim 6.x version, those don't have the described problem.

like image 54
Chris Avatar answered Oct 21 '22 06:10

Chris


Are you in edit mode or command mode when you do this? It sounds to me like you are expecting command mode to work like edit mode. The quote character in command mode affects registers and the clipboard (e.g., for copy/paste).

like image 28
Michael Goldshteyn Avatar answered Oct 21 '22 06:10

Michael Goldshteyn


I noticed that you can press " and then a to produce ä. On my machine (Windows XP) if I press and hold " and <Space> at the same time, it seems to work. If I try to press " and then <Space>, I get unexpected behavior.

like image 43
tinifni Avatar answered Oct 21 '22 05:10

tinifni


Same problem here since 7.3. I didn't try Yongwei's builds, but I built Vim myself (which was pretty straightforward using Wikia's instructions) and the problem went away \0/

Edit Spoke too soon : the 32bits version works fine, but the 64bits version is still broken :(

Edit Workaround: the 64bits version works fine if compiled with OPTIMIZE=SPACE
In some parts of the code, optimization is disabled using #pragmas, so a real solution would be to do the same thing for the precise code parts that need it so we could have optimized code for the rest of the program.

Edit I was building vim using the compiler that comes with Visual Studio 2010, which apparently can produce incorrect code when optimizing (see here). The solution was to install Visual Studio Express 2013 to get an updated compiler and build vim using this new version.
For what it's worth, here's the simple build script I used to get a python 2.7-enabled vim :

REM TODO: cd to your vim source code directory

:: Set environment for wanted options before building Vim.
set GUI=yes
set DYNAMIC_PYTHON=yes
set PYTHON=C:/Python27
set PYTHON_VER=27
set NETBEANS=no
set FEATURES=HUGE
set CPUNR=i686
set WINVER=0x500
set OLE=yes
set CPU=AMD64
set SDK_INCLUDE_DIR=C:\Program Files\Microsoft SDKs\Windows\v7.1\Include

REM setup environment to use VS2013's compiler
call "c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86_amd64

nmake -f Make_mvc.mak clean
nmake -f Make_mvc.mak 
like image 1
nop Avatar answered Oct 21 '22 04:10

nop