Displaying the British pound key using the compose key

6 views
Skip to first unread message

cjsmall

unread,
Mar 19, 2023, 12:02:17 AM3/19/23
to vim_use
Vim 8.2

In vim I can enter the British Pound symbol with "Ctrl-K $ $" just fine.
However, I've been using the Compose key on my Sun Type 6 keyboard to enter
most of the Unicode characters, simply replacing Ctrl-K with Compose.  So
far this has worked with every digraph combination except the British Pound
symbol.  "Compose $ $" just inputs a $. Is there some mapping I could place
in my .vimrc file that would generate the same output?

Thanks.

Tim Chase

unread,
Mar 19, 2023, 9:26:56 AM3/19/23
to vim...@googlegroups.com
On 2023-03-18 21:02, cjsmall wrote:
> However, I've been using the Compose key on my Sun Type 6 keyboard to
> enter most of the Unicode characters, simply replacing Ctrl-K
> with Compose. So far this has worked with every digraph
> combination except the British Pound symbol. "Compose $ $" just
> inputs a $. Is there some mapping I could place in my .vimrc file
> that would generate the same output?

The Compose key is a thing in X before it ever reaches the terminal
or even vim. I prefer the default

<Compose> L -

which feels much more intuitive to me (I do all such character
compositions through the X Compose key and never use vim's digraphs
unless I'm helping someone with a vim digraph-related issue).

However, if you do want

<Compose> $ $

to make the British Pound symbol, you can create a ~/.XCompose file,
something like

$ cat >> ~/.XCompose

include "%L"
<Multi_key> <$> <$>
^D

I'm not exactly positive on the notation for the dollar key, so it
might be something like

<dollar>

instead of

<$>

but you can use xev(1) to show the key-name.

You might then have to restart vim (or possibly even restart your
X session)

-tim





Reply all
Reply to author
Forward
0 new messages