Re: Introducing a dedicated unicode mode in Vim

20 views
Skip to first unread message

Manas

unread,
Jun 27, 2021, 2:02:50 AM6/27/21
to v...@vim.org
Hi folks, I was thinking about the following idea.

As Rust introduced usage of non-ascii characters as identifiers
< https://blog.rust-lang.org/2021/06/17/Rust-1.53.0.html#unicode-identifiers >,
I wanted to know that will it be interesting to add a dedicated support
for typing unicode characters in Vim? Like we have insert and replace
modes, will it be useful to have a "unicode-mode" which when activated
can enable a typist to type in unicodes at ease and allow them to type
those characters continuously? Current implementations of using <C-v> for
unicodes and <C-k> for digraphs become tedious for typing continually.

Of course, people will use this mode while writing various documents as
well, and it will not merely be specific to rust devs.

What do you folks think about this?
--
Manas

Bram Moolenaar

unread,
Jun 27, 2021, 6:08:30 AM6/27/21
to vim...@googlegroups.com, Manas, v...@vim.org
We already have support for input methods. These were originally aimed
at Asian language, but should work for anything.

Implementation of an input method is tricky and involves user
preferences. Making something Vim-specific has the disadvantage that
you can't use it in other programs.

--
You have the right to remain silent. Anything you say will be
misquoted, then used against you.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

meine

unread,
Jun 27, 2021, 10:59:44 AM6/27/21
to vim...@googlegroups.com, v...@vim.org
On Sun, Jun 27, 2021 at 11:32:21AM +0530, Manas wrote:
> I wanted to know that will it be interesting to add a dedicated support
> for typing unicode characters in Vim? Like we have insert and replace
> modes, will it be useful to have a "unicode-mode" which when activated
> can enable a typist to type in unicodes at ease and allow them to type
> those characters continuously? Current implementations of using <C-v> for
> unicodes and <C-k> for digraphs become tedious for typing continually.

Probably you can set this in your .vimrc:

`autocmd set digraph`

I had the reverse problem a while ago in mutt, where vim is my editor --
making a typo, hitting <backspace>, typing the right character and
ending up with Japanese katakana or hiragana. After some searching, I
found out that I had a line in my .vimrc that triggered this when
writing an email. Your wish is the reverse of this, although I don't
know if the line above is syntaxually right. But you just can find out.

As with my line that only worked when composing an email in mutt, you
could set it in your .vimrc only to work for specific file types, etc.
The original line I had is

`autocmd BufNewFile,BufRead /tmp/mutt* set noautoindent filetype=mail
wm=0 tw=78 digraph nonumber nolist`

Since I am a search-copy-paste sysadmin, I can't tell you what to change
for your purposes, but there is plenty of info on the Net.

//meine

L A Walsh

unread,
Jun 28, 2021, 10:09:15 PM6/28/21
to vim...@googlegroups.com, v...@vim.org
On 2021/06/26 23:02, Manas wrote:
> Hi folks, I was thinking about the following idea.
> As Rust introduced usage of non-ascii characters as identifiers
>
----
You do realize perl has had that for over a decade?

Manas

unread,
Jul 1, 2021, 11:07:52 AM7/1/21
to vim...@googlegroups.com, v...@vim.org
On Sun, Jun 27, 2021 at 12:08:16PM +0200, Bram Moolenaar wrote:
> We already have support for input methods. These were originally aimed
> at Asian language, but should work for anything.
>
> Implementation of an input method is tricky and involves user
> preferences. Making something Vim-specific has the disadvantage that
> you can't use it in other programs.
Makes sense. I understand that a particular plugin (which may exist
somewhere) would be more appropriate or method which @meine mentioned.

On Sun, Jun 27, 2021 at 04:59:21PM +0200, meine wrote:
> On Sun, Jun 27, 2021 at 11:32:21AM +0530, Manas wrote:
> > I wanted to know that will it be interesting to add a dedicated support
> > for typing unicode characters in Vim? Like we have insert and replace
> > modes, will it be useful to have a "unicode-mode" which when activated
> > can enable a typist to type in unicodes at ease and allow them to type
> > those characters continuously? Current implementations of using <C-v> for
> > unicodes and <C-k> for digraphs become tedious for typing continually.
>
> Probably you can set this in your .vimrc:
>
> `autocmd set digraph`
>
> I had the reverse problem a while ago in mutt, where vim is my editor --
> making a typo, hitting <backspace>, typing the right character and
> ending up with Japanese katakana or hiragana. After some searching, I
> found out that I had a line in my .vimrc that triggered this when
> writing an email. Your wish is the reverse of this, although I don't
> know if the line above is syntaxually right. But you just can find out.
>
> As with my line that only worked when composing an email in mutt, you
> could set it in your .vimrc only to work for specific file types, etc.
> The original line I had is
>
> `autocmd BufNewFile,BufRead /tmp/mutt* set noautoindent filetype=mail
> wm=0 tw=78 digraph nonumber nolist`
>
> Since I am a search-copy-paste sysadmin, I can't tell you what to change
> for your purposes, but there is plenty of info on the Net.
>
Thanks a lot! Probably will end up using this.
I didn't know that.

--
Manas
Reply all
Reply to author
Forward
0 new messages