The ý character in INSERT mode isn't printed - vim

Issue description
I use VIM to take notes in Czech at university lectures. All special characters work fine except for the 'ý' character.
When I type it in INSERT mode, it isn't printed. Instead, it shifts the cursor to the left, which is very annoying.
The character is represented correctly when typed in the vim command line. So I suppose the character is misinterpreted as an INSERT mode movement command? Is this a bug?
How to reproduce
Please temporarily install the Czech QWERTZ keyboard layout (careful, there is a programmer version of the layout, we need the regular one).
Typing the 'ý' character can be accomplished using either of these steps:
The top number row is reserved for the most common special characters, press 7 without SHIFT to print it.
Special characters can also be typed by first pressing and then letting go the '=' key (next to BACKSPACE) and then pressing the character you want to decorate with an accent.
Wrapping up
Issue replication times: always
Ubuntu 17.10
Terminal
GUI vim-gnome
Bash on Ubuntu for Win 10
Running vim without vimrc solves the issue.
Link to my vimrc
Any suggestion and/or workaround will be very helpful.
Thanks in advance!

I know this is an older issue, but to anyone else struggling with this, it is an issue within the auto-pairs plugin, that has since gone silent and unmaintained. There's an issue for it.
If you don't want to scroll through the discussion, there's a fork of the plugin at https://github.com/lunarWatcher/auto-pairs which has the issue fixed. Since the original plugin is unmaintained, there's little hope of the fix being merged back, but I managed to switch to the fork with no apparent issues.
Přeji příjemné psaní ypsilonů s čárkou!

The abbreviation:
iabbrev 'y ý
could be used to display the ý character in insert mode. Typing 'y should result in ý.

Related

How to get delete-button behavior in vim?

When using vim in insert mode (or not using vim at all), pressing the delete-button deletes a character TO THE RIGHT of the cursor. How can I get this behavior in vim when in normal mode?
Pressing x is not the right answer as it deletes the selected character, not the character to the right.
In the Insert mode it's just for you the cursor looks "kinda between characters". But in fact, your computer sees it being right on the character you are deleting.
In the Normal mode you normally have the bar-cursor, so it looks the way it works.
Now, of course, you can remap your "x" to delete the char to the right, but it will only add a confusion. So, please, don't. Train your mind to see the things in the proper light instead.

How to start using vim with a non-english keyboard

I recently started using git, and by default it would want to use vim. I always wanted to look a bit deeper in this editor, but was always thrown back, only using it if for some reason (such as in case of a near dead Linux system) it was unavoidable. Even now I soon ended up reconfiguring git to use mcedit instead (which I use for programming).
The problem was that OK, I gave the command :help to see how I could start. Then in the help system it suggests me to jump to the subject interesting me using CTRL-]. And here I am lost. I have a Hungarian keyboard, and simply couldn't find where it excepted to find ]. So I can just scroll around in a list of topics I can not enter.
This is just the beginning: In general how much such "weird" combinations I may except? And how I could fix those up? An other problem with the Hungarian language is that it has a bunch of extra vowels which have to be mapped on the same amount of keys like English with it's 26 letters (there are 9 extra letters, so 9 keys "lost"!). Would this hinder the use of vim for writing Hungarian text (where I would require these keys to produce the language-specific vowels)?
How this problem could be solved in a way that if I happen to get an English keyboard (for which layout I guess vim was originally designed), I wouldn't have to re-learn the positioning of the keys? (Since I have no English keyboard around I can't try what happens. As I tried neither of the two keys on the left of 'P' would suffice for the CTRL-] combination while as far as the layouts I checked the second should be it. Of course my system is configured for Hungarian layout)
The language truly is irrelevant, I guess everyone having non-English keyboards might face similar problems. So how you work yourself around these?
Look at /usr/share/vim/vim74/keymap/ directory (in debian/ubuntu it is a part of the vim-runtime package), you should see a bunch of keymap files for different locales. Chose the one you like. In the example I use russian-jcukenwin.vim.
Add to your .vimrc file →
set keymap=russian-jcukenwin
set iminsert=0
set imsearch=0
highlight lCursor guifg=NONE guibg=Cyan
Now you can switch layout with Ctrl-^ keys. Note: layout is switchable when in insert-mode.
As you can guess the first line is the name of the file I mentioned. The next two lines sets the iminsert and imsearch in order to start writing the very first time with latin layout. In fact Ctrl-^ toggles them between 1 and 0. And the last line draws the caret with cyan color when layout is changed.
You can remap all vim defaults bindings with the map function.
For further information, you can read this tutorial
simple solution
you can switch to English layout when using vim:
setxkbmap us
and switch back to hungarian keyboard (hu) afterwards.
xkb
To show you another way:
the xkeyboard layout for hu keyboard is located in /usr/share/X11/xkb/symbols/hu. Try to compare the layout with /usr/share/X11/xkb/symbols/us.
There are also layout variants for hu keyboard than just default.
See my post here
If you want to do something advanced, you could also apply the english keyboard to the CAPS LOCK modifier LEVEL

Vim langmap breaks plugin (bépo)

I am using a bépo keymap (http://bepo.fr) and seeking the perfect vim mapping.
So far I used a long list of noremap, but for many binding (for exemple, the motion aw or Ctrl+r), the first keystroke is well remaped but not the others, I reckon it's the expected behaviour, but then this is not what I need.
Ideally I would have my keyboard totally remaped in a higher level (before the map commands) except when typing text (in insertion mode and when typing a substitution for exemple). What I'm looking for seems to be langmap, but I have problems using it.
I added this langmap to my .vimrc, It seems perfect but it broke some of my plugins. SuperTab now insert <Plug>SuperTabForward when pressing Tab in insertion mode, I have t<SNR>24_SelectCompletion(1) when pressing enter.
Does someone know how to fix this langmap issue or a better way to remap my keyboard?
This is a known bug, that has been discussed before. I have made a patch (see the thread starting here) and hopefully Bram will include this change soon.
Update 11/05/2014
This has been fixed by patch 7.4.502. Use the langnoremap option to fix this.

Remapping a key to Escape in Vim (German keyboard)

Okay, so I've been trying out Vim (the standard console version; my OS is Linux Mint 13) and I'd like to get rid of having to use the Escape key to change modes. Preferably, I'd like to swap the Capslock and Escape keys, but as far as I've heard, that's not possible within Vim itself. Most "solutions" I've found involve changing the key on a global level (using xmodmap or whatever), but I don't really want that. If there's an easy way to swap Capslock and Escape only in Vim, please let me know.
Another common thing I've heard of is using "Ctrl-[" as an equivalent to Escape. However, because I'm using a German keyboard with a different layout, that's not an option. So, I thought I'd use noremap <C-ü> <Esc> in Vim (the "ü" key on a German keyboard is in the same place as the "[" key on US keyboards), but that didn't work, either. I'm assuming that's because "ü" isn't an ASCII character. Is there any way to get either of these options working?
UPDATE: Well, this is strange. After experimenting some more, it seems that "Ctrl-ü" does work after all. I'm not sure what happened – maybe I messed up some encoding-related settings while trying different things? If there is no good solution for remapping capslock, I guess I will stick with "Ctrl-ü".
So, yeah, eventually I decided to go with <C-ü> because it doesn't conflict with anything else and because it's the same as <C-[> on US keyboards.
However, because I'm getting tired of using the German keyboard layout for programming (for example, to get "{" you need to type "Alt Gr-7"), I'm switching my keyboard to US-International, which essentially has a similar effect as far as Vim is concerned. It also helps if you want to want to get into the habit of touch-typing; you actually can't look at the keyboard because the keys aren't labeled "correctly" ;-)
A lot of people use jk:
inoremap jk <Esc>
You can also simply do <C-c>.
Here is another alternative that may be useful to you! It involves changing the keyboard file related to VIM. I found this suggestion on this youtube video
$ cd /usr/share/X11/xkb/symbols/
sudo vim pc
to edit the capslock key to escape, change the capslock line to read as follows:
key <CAPS> { [ Escape ] };
:wq # to write and close the file
Log out and log back into the machine and it should be updated!

Vim backspace key only works on new text

For fun I decided to compile vim from source. Long story short the build seemed to go fine, but when I enter insert mode I cannot use the <BACKSPACE> key to delete existing characters or newlines created using the <ENTER> key in insert mode. The distro's pre-built package does this just fine. I also know there's no problem with the backspace key itself because I can backspace over characters I've just typed, just not existing characters.
It almost makes sense, as vim operates on a per-line basis most of the time. Is there a flag I need to set in order to support this behavior? Or is it faster by design to enter normal mode to delete existing characters/newlines?
Wow, second time I've figured out the answer minutes after posting the question.
set backspace=indent,eol,start
Must have been set automatically by the distro's package vimrc. Hope this answer helps someone else! For more info:
:help i_backspacing

Resources