The registers are an X11 feature; they are not Linux-specific or even Unix-specific but work on any OS that uses X11.
As described in Vim documentation (:help quoteplus
), the "+
register corresponds to the 'CLIPBOARD' selection in X11, while the "*
register corresponds to the 'PRIMARY' selection.
More detailed explanation:
The X11 graphical environment has support for multiple clipboard-like buffers, called selections. There are three standard ones, two of which are in wide use:
The PRIMARY
selection is updated every time you select text. To paste from it (in graphical programs), middle-click or use ShiftInsert. In Vim, it is accessible through the "*
register.
The CLIPBOARD
selection is updated when you explicitly cut or copy anything (text or other data). In other words, it is used just like the Windows or Mac OS clipboards. To paste from it, the usual shortcut is CtrlV in grapical programs. In Vim, it is accessible through the "+
register.
You don't need any special settings to use them; however, your Vim must be configured with X11 support (look for +X11
in vim --version
), and – obviously – the registers only work inside X11.
It doesn't matter whether you are using the GUI or terminal version of Vim, however. (On Arch Linux, the gvim
package provides both GUI and terminal versions with the X11 support enabled.)
Resources:
This is an alternative that works for me up to now; Using AutoHotkey, I dynamically switch to a preferred language for specific software (E.g. Vim uses en-CA, and Slack uses fr-CA).
This is not an answer to my specific question, but if it worked for me, it might work for other people too:
https://gist.github.com/christianrondeau/00d7cd5848f33e029f00ce2b6b935ab9
; How to use:
; 1. Install AuthotKey: https://www.autohotkey.com
; 2. Save this script in `My Documents`
; 3. Create a shortcut in the Startup folder (`Win`+`R`, `shell:startup`)
; 4. Change the configurations below
; 5. Start and test the script!
; Configuration
; Cultures can be fetched from here: https://msdn.microsoft.com/en-us/library/windows/desktop/dd318693(v=vs.85).aspx
; They must be set twice in the language ID;
; en-US: 0x04090409
; fr-CA: 0x0C0C0C0C
global DefaultLanguage := "fr-CA"
global DefaultLanguageIndentifier := "0x0C0C0C0C"
global SecondaryLanguage := "en-US"
global SecondaryLanguageIndentifier := "0x04090409"
global SecondaryLanguageWindowTitles := "VIM,Visual Studio"
; And the code itself (you should not have to change this)
Gui +LastFound
hWnd := WinExist()
DllCall( "RegisterShellHookWindow", UInt,Hwnd )
MsgNum := DllCall( "RegisterWindowMessage", Str,"SHELLHOOK" )
OnMessage( MsgNum, "ShellMessage" )
Return
ShellMessage( wParam,lParam )
{
WinGetTitle, title, ahk_id %lParam%
; 4 is HSHELL_WINDOWACTIVATED, 32772 is HSHELL_RUDEAPPACTIVATED
If (wParam=4 || wParam=32772) {
If title contains %SecondaryLanguageWindowTitles%
SetKeyboard( title, SecondaryLanguage )
Else
SetKeyboard( title, DefaultLanguage )
}
}
SetKeyboard( title, culture )
{
; 0x50 is WM_INPUTLANGCHANGEREQUEST.
Try
{
If (culture = SecondaryLanguage)
{
PostMessage, 0x50, 0, %SecondaryLanguageIndentifier%,, A
; To debug:
; ToolTip, Using secondary language %SecondaryLanguage%
; Sleep 1000
; ToolTip
}
Else If (culture = DefaultLanguage)
{
PostMessage, 0x50, 0, %DefaultLanguageIndentifier%,, A
; To debug:
; ToolTip, Using default language %DefaultLanguage%
; Sleep 1000
; ToolTip
}
Else
{
; To debug:
; ToolTip, Unknown culture: %culture%
; Sleep 1000
; ToolTip
}
}
Catch e
{
ToolTip, Could not switch to %culture%`n%e%
Sleep 1000
ToolTip
}
}
Best Answer
It seems that "Latin-9" refers to the ISO 8859-15 character set. That is, "Latin-9 only" is supposed to exclude symbols which require full Unicode support.
For example, the regular Bépo variant has
ə
(schwa) on AltGrZ. This symbol does not exist in ISO 8859-15, and is therefore not included in the "Latin-9" variant.You can open
/usr/share/X11/xkb/symbols/fr
to see the definitions.Or at least that's supposed to be the case. In practice it doesn't seem to work as intended.
Since
bepo_latin9
is based onbepo
and simply removes characters instead of adding, it seems the overrides do not fully take effect and the extra symbols are not excluded – Z still has schwa on level 3 and level 4, and so on.I used GNOME's "Show Keyboard Layout" button in the taskbar's keyboard menu – it displays the layouts as they're ultimately interpreted by libxkbcommon, and as you can see the differences are very minor.
Disregard the weird Caps Lock position – that's my local configuration.
So which one to use? Well, practically all systems can cope with Unicode nowadays, so just go with the regular
bepo
layout. Don't bother withbepo_latin9
.