Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: is there a way to map characters for text input, like ab{breviate} or loadkeymap... in vim? #878

Closed
4 of 8 tasks
WaterSibilantFalling opened this issue Mar 26, 2017 · 4 comments
Labels

Comments

@WaterSibilantFalling
Copy link

  • I've searched for duplicates – also closed issues
  • I've looked at the change log
  • I've provided the below details:

VimFx version: 0.20.9
Firefox version: 52.0b3 (32bit)
OS: Linux 4.9.0-2-686-pae #1 SMP Debian 4.9.13-1 (2017-02-27) i686 GNU/Linux
Keyboard language: EN-US
Example URL (if any):

This is … (pick one!)

  • A bug report
    • I've filled in steps to reproduce below
  • A feature request
    • Sorry, feature requests are not accepted.
      See issue #860
  • A question
  • Somehting else

For my second language, I have set key-mappings on the command line (Bash), in vim and in neovim.

I would like to use these same mappings in firefox. Is there a way, via VimFx, to map a key combination to a specified key, eg ;o prints ö ?

@lydell
Copy link
Collaborator

lydell commented Mar 26, 2017

Thanks for your question!

Short answer: No.

Longer answer:

  1. I don’t know what ab{breviate} and loadkeymap do in vim.
  2. It sounds a bit like we have an XY problem here – what exactly are you trying to achieve?

@WaterSibilantFalling
Copy link
Author

WaterSibilantFalling commented Mar 26, 2017

In Vim, abbreviations and 'keymap' key pairing both make the characters 'bbbbb' be written whenever a key combination, say 'aaaa' is typed. I want the keycombination ';' and 'O' (i.e. ';O') to produce 'Ö' with an umlat

If, in my vimrc, I had
abbreviation xxxx yyyy
then, whenever I typed 'xxxx' then in its place 'yyyy' would be presented.

The key sequences in 'loadkeys' files are similar, focused on substituing specific keys, intended for non-ASCII, non-English letters, and (really) what I am looking for.

I have a file $HOME/.vim/keymap/sdm_tk.vim
In it is (a bit of housekeeping) and
;c <char-0xe7>
;C <char-0xc7>
;g <char-0x11f>
;G <char-0x11e>
;i <char-0x131>
;I <char-0x130>
;o <char-0xf6>
;O <char-0xd6>
;s <char-0x15f>
;S <char-0x15e>
;u <char-0xfc>
;U <char-0xdc>

In my vimrc I have
set keymap=sdm_tk

Whenever I type ;O say, I get Ö instead. This is intended for, and ideal for, those working in two languages, one of which is 'latin' but not US ASCII. German would be an example.

I have done the same in my .inputrc for bash.

I want to be able to type ";O" in firefox and get "Ö". I was wondering if I could do this via VimFx.

@WaterSibilantFalling
Copy link
Author

WaterSibilantFalling commented Mar 26, 2017

Whoops, I didn't mean to close that. Re-opened.

@lydell
Copy link
Collaborator

lydell commented Mar 26, 2017

Thanks for the explanation!

This is not possible with VimFx. Since VimFx is all about keyboard shortcuts, it won’t be added either.

I suggest you find or create an extension or user script that does this (replacing certain sequences of typed characters in text inputs).

@lydell lydell closed this as completed Mar 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants