VimConf 2017 will be held on 11/4 in Tokyo

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

VimConf 2017 will be held on 11/4 in Tokyo

haya14busa
Hi, list!

I'm really excited to share upcoming VimConf 2017 - an international Vim conference.

Web site: http://vimconf.vim-jp.org/2017/
Annoucement post: http://vim-jp.org/blog/2017/08/04/vimconf2017-venue-and-date-en.html
Speaker list: http://vim-jp.org/blog/2017/10/12/vimconf2017-speakers-en.html

VimConf 2017 will be held in Japan and some speakers wil talk in Japanese, but
in VimConf 2017 all slides will be written in English and we are going to
translate Japanese talks to English (and vice versa).

I'd like to introduce some key speakers at VimConf 2017.

- Fatih Arslan @fatih (https://github.com/fatih), who is famous at vim-go
- Yasuhiro MATSUMOTO @mattn (https://github.com/mattn)
- Ken Takata k_takata @k-takata (https://github.com/k-takata)

@mattn and @k-takata will be talking with MURAOKA Taro (@kaoriya) as a speciall session.
It's like a panel discussion.

You can tweet about what kind of topic you want to hear from them with this hash tag #vimconf2017interview.
https://twitter.com/search?q=%23vimconf2017interview

Note that they made lots of contributions to Vim, such as :terminal, lamda,
DirectX support, quoted string text object (a", i"...) and so on.
I cannot wait listening their talk... XD

You can get a ticket here. http://peatix.com/event/311686

I'm really sorry that only a few tickets left already...
We'll record the talks and upload them to YouTube or somewhere, so you can
watch them even if you cannot attend the conference.

I feel VimConf 2017 is going to be best VimConf ever.
The organizers are making a lots of effort to make the conference interesting
and more international one.
I really appreciate their work. (I'm not an organizer)
I'm going to give a talk too, so I want to make VimConf2017 successful.

Get a ticket to attend VimConf 2017 or stay tuned for the update.

Regards,
haya14busa

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: VimConf 2017 will be held on 11/4 in Tokyo

Bram Moolenaar

Haya14busa wrote:

> Hi, list!
>
> I'm really excited to share upcoming VimConf 2017 - an international Vim conference.
>
> Web site: http://vimconf.vim-jp.org/2017/
> Annoucement post: http://vim-jp.org/blog/2017/08/04/vimconf2017-venue-and-date-en.html
> Speaker list: http://vim-jp.org/blog/2017/10/12/vimconf2017-speakers-en.html
>
> VimConf 2017 will be held in Japan and some speakers wil talk in Japanese, but
> in VimConf 2017 all slides will be written in English and we are going to
> translate Japanese talks to English (and vice versa).
>
> I'd like to introduce some key speakers at VimConf 2017.
>
> - Fatih Arslan @fatih (https://github.com/fatih), who is famous at vim-go
> - Yasuhiro MATSUMOTO @mattn (https://github.com/mattn)
> - Ken Takata k_takata @k-takata (https://github.com/k-takata)
>
> @mattn and @k-takata will be talking with MURAOKA Taro (@kaoriya) as a speciall session.
> It's like a panel discussion.
>
> You can tweet about what kind of topic you want to hear from them with this hash tag #vimconf2017interview.
> https://twitter.com/search?q=%23vimconf2017interview
>
> Note that they made lots of contributions to Vim, such as :terminal, lamda,
> DirectX support, quoted string text object (a", i"...) and so on.
> I cannot wait listening their talk... XD
>
> You can get a ticket here. http://peatix.com/event/311686
>
> I'm really sorry that only a few tickets left already...
> We'll record the talks and upload them to YouTube or somewhere, so you can
> watch them even if you cannot attend the conference.
>
> I feel VimConf 2017 is going to be best VimConf ever.
> The organizers are making a lots of effort to make the conference interesting
> and more international one.
> I really appreciate their work. (I'm not an organizer)
> I'm going to give a talk too, so I want to make VimConf2017 successful.
>
> Get a ticket to attend VimConf 2017 or stay tuned for the update.

Thanks to those organising VimConf!  I hope you all have a good and
productive conference.

--
I still remember when I gave up Smoking, Drinking and Sex.  It was the
most *horrifying* hour of my life!

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: VimConf 2017 will be held on 11/4 in Tokyo

cedric simon
In reply to this post by haya14busa
OMG! I'll try to go, I should be free on Saturday.
I was so sad I missed the one last year.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

How to handle non-ascii characters?

Barry Gold
In reply to this post by Bram Moolenaar
Background: I write  documents in MS Word, but my target format is HTML. After I do a Save as "Web Page (filtered)", I can use global replaces to get rid of most of the cruft that Word generates, but I have a problem with non-ASCII characters: cent sign, circle-r, dash, nbsp, etc.

None of these looks like themselves when I edit the file with vim in a cygwin Terminal window. I can search for [^ -~^t] to find the non-ASCII characters, then go to the original word document to find out what the correct character is. If I had only a few of these, that would be enough. But in a longer document, a given non-ASCII can occur hundreds of times. So once I've found (e.g.) an emdash, I want to replace _all_ occurrences with  "—". But I have no way of representing the character I want to replace on the command line.

I usually bring up the HTML file in Emacs so I can tell it to do a replace all on the character. I know emacs sort-of, but every time I want to do anything more than basic editing I have to look up the commands I want with ^hapropos. Is there a way to do this in vim without getting into emacs.

Note: ^t is what a tab character looks like on the vim command line.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to handle non-ascii characters?

jcordes
On Sat, Oct 21, 2017 at 08:43:23AM -0700, Barry Gold wrote:

> Background: I write  documents in MS Word, but my target format is HTML. After
> I do a Save as "Web Page (filtered)", I can use global replaces to get rid of
> most of the cruft that Word generates, but I have a problem with non-ASCII
> characters: cent sign, circle-r, dash, nbsp, etc.
>
> None of these looks like themselves when I edit the file with vim in a cygwin
> Terminal window. I can search for [^ -~^t] to find the non-ASCII characters,
> then go to the original word document to find out what the correct character
> is. If I had only a few of these, that would be enough. But in a longer
> document, a given non-ASCII can occur hundreds of times. So once I've found
> (e.g.) an emdash, I want to replace _all_ occurrences with  "—". But I
> have no way of representing the character I want to replace on the command
> line.
>
> I usually bring up the HTML file in Emacs so I can tell it to do a replace all
> on the character. I know emacs sort-of, but every time I want to do anything
> more than basic editing I have to look up the commands I want with ^hapropos.
> Is there a way to do this in vim without getting into emacs.
>
> Note: ^t is what a tab character looks like on the vim command line.

 I sometimes deal with something a bit similar. For
example if I want to change all the fancy "right single
quote" marks from a Windows file into a plain apostrophe,
"'" I use 'ga' on the first found character (the fancy
quote) to see that the code is U+2019. Then I search for
that, using \%u2019.
 Would that help?

 John Cordes

 

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to handle non-ascii characters?

Nikolay Aleksandrovich Pavlov
2017-10-21 19:39 GMT+03:00  <[hidden email]>:

> On Sat, Oct 21, 2017 at 08:43:23AM -0700, Barry Gold wrote:
>> Background: I write  documents in MS Word, but my target format is HTML. After
>> I do a Save as "Web Page (filtered)", I can use global replaces to get rid of
>> most of the cruft that Word generates, but I have a problem with non-ASCII
>> characters: cent sign, circle-r, dash, nbsp, etc.
>>
>> None of these looks like themselves when I edit the file with vim in a cygwin
>> Terminal window. I can search for [^ -~^t] to find the non-ASCII characters,
>> then go to the original word document to find out what the correct character
>> is. If I had only a few of these, that would be enough. But in a longer
>> document, a given non-ASCII can occur hundreds of times. So once I've found
>> (e.g.) an emdash, I want to replace _all_ occurrences with  "&mdash;". But I
>> have no way of representing the character I want to replace on the command
>> line.
>>
>> I usually bring up the HTML file in Emacs so I can tell it to do a replace all
>> on the character. I know emacs sort-of, but every time I want to do anything
>> more than basic editing I have to look up the commands I want with ^hapropos.
>> Is there a way to do this in vim without getting into emacs.
>>
>> Note: ^t is what a tab character looks like on the vim command line.
>
>  I sometimes deal with something a bit similar. For
> example if I want to change all the fancy "right single
> quote" marks from a Windows file into a plain apostrophe,
> "'" I use 'ga' on the first found character (the fancy
> quote) to see that the code is U+2019. Then I search for
> that, using \%u2019.
>  Would that help?

Using `yl` to yank the character and `<C-r>"` to paste it into the
command-line should be faster.

>
>  John Cordes
>
>
>
> --
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups "vim_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
> For more options, visit https://groups.google.com/d/optout.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to handle non-ascii characters?

Barry Gold
In reply to this post by jcordes
On 10/21/2017 9:39 AM, [hidden email] wrote:

> On Sat, Oct 21, 2017 at 08:43:23AM -0700, Barry Gold wrote:
>> Background: I write  documents in MS Word, but my target format is HTML. After
>> I do a Save as "Web Page (filtered)", I can use global replaces to get rid of
>> most of the cruft that Word generates, but I have a problem with non-ASCII
>> characters: cent sign, circle-r, dash, nbsp, etc.
>>
>> None of these looks like themselves when I edit the file with vim in a cygwin
>> Terminal window. I can search for [^ -~^t] to find the non-ASCII characters,
>> then go to the original word document to find out what the correct character
>> is. If I had only a few of these, that would be enough. But in a longer
>> document, a given non-ASCII can occur hundreds of times. So once I've found
>> (e.g.) an emdash, I want to replace _all_ occurrences with  "&mdash;". But I
>> have no way of representing the character I want to replace on the command
>> line.
>>
>> I usually bring up the HTML file in Emacs so I can tell it to do a replace all
>> on the character. I know emacs sort-of, but every time I want to do anything
>> more than basic editing I have to look up the commands I want with ^hapropos.
>> Is there a way to do this in vim without getting into emacs.
>>
>> Note: ^t is what a tab character looks like on the vim command line.
>   I sometimes deal with something a bit similar. For
> example if I want to change all the fancy "right single
> quote" marks from a Windows file into a plain apostrophe,
> "'" I use 'ga' on the first found character (the fancy
> quote) to see that the code is U+2019. Then I search for
> that, using \%u2019.
>   Would that help?
>

AHA!  Yes, that works.  This will do fine. Thank you.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to handle non-ascii characters?

Tony Mechelynck
 One or the other of you may be interested in the unicode.vim plugin,
https://vim.sourceforge.io/scripts/script.php?script_id=2822

It has several useful features related to digraphs and Unicode; one of
them is the :UnicodeName command which tells you a lot of information
for the character under the cursor and its composing characters if
any: for instance for я́ (Cyrillic lowercase ya with combining acute
accent) it tells me:

'я' U+044F Dec:1103 CYRILLIC SMALL LETTER YA (ja) &#x44F;
' ' U+0301 Dec:769 COMBINING ACUTE ACCENT &#x301;

The part in parentheses is the digraph (if any, and all of them if
there are several) for that character. If there exists a predefined
symbolic entity you see that instead of the hex entity at the end, for
instance for — (em dash):

'—' U+2014 Dec:8212 EM DASH (-M) &mdash;

An optional register argument tells it a register to save the message
(similar to :yank etc.).

Best regards,
Tony.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to handle non-ascii characters?

John Cordes
On Sun, Oct 22, 2017 at 01:50:22AM +0200, Tony Mechelynck wrote:

>  One or the other of you may be interested in the unicode.vim plugin,
> https://vim.sourceforge.io/scripts/script.php?script_id=2822
>
> It has several useful features related to digraphs and Unicode; one of
> them is the :UnicodeName command which tells you a lot of information
> for the character under the cursor and its composing characters if
> any: for instance for я́ (Cyrillic lowercase ya with combining acute
> accent) it tells me:
>
> 'я' U+044F Dec:1103 CYRILLIC SMALL LETTER YA (ja) &#x44F;
> ' ' U+0301 Dec:769 COMBINING ACUTE ACCENT &#x301;
>
> The part in parentheses is the digraph (if any, and all of them if
> there are several) for that character. If there exists a predefined
> symbolic entity you see that instead of the hex entity at the end, for
> instance for — (em dash):
>
> '—' U+2014 Dec:8212 EM DASH (-M) &mdash;
>
> An optional register argument tells it a register to save the message
> (similar to :yank etc.).
>
> Best regards,
> Tony.

 Thanks for pointing out this very interesting plugin, Tony. I
have installed it and am exploring it now.

 Regards,
 John

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to handle non-ascii characters?

Elijah Griffin
In reply to this post by Barry Gold
Barry Gold wrote:
> None of these looks like themselves when I edit the file with vim in a
> cygwin Terminal window. I can search for [^ -~^t] to find the non-ASCII
> characters, then go to the original word document to find out what the
> correct character is. If I had only a few of these, that would be
> enough. But in a longer document, a given non-ASCII can occur hundreds
> of times. So once I've found (e.g.) an emdash, I want to replace _all_
> occurrences with  "&mdash;". But I have no way of representing the
> character I want to replace on the command line.

I have a very similar problem to yours and have evolved some fixes that
I use. You've already gotten some replies, but maybe my methods would
help, too.

In my case, I paste content from web pages into Usenet posts and want to
have as much US-ASCII as possible for best readibility. To that end I
have a specific vimrc for news that fixes things with map!s. It could
easily be modified to a ':so script' usage, to fix things on command
or a 'autocmd BufRead *.html' script to fix thins on load.

In my vimrc:

   autocmd BufRead .article.* :so ~eli/.news_vimrc

And my news_vimrc looks like this:

:r! cat ~/.news_vimrc | mmencode -q
" smart quotes
map! =E2=80=99 '
map! =E2=80=98 '
map! =E2=80=9C "
map! =E2=80=9D "
map! =E2=80=B3 "
" ellipsis
map! =E2=80=A6 ...
" n-dash
map! =E2=80=93 --
" m-dash
map! =E2=80=94 --
" U+2212 minus
map! =E2=88=92 -
" U+2010 hyphen
map! =E2=80=90 -
"
" find non-ascii
map <F5> /[^ -~]<cr>
" add mime headers if leaving in non-ascii
map <F6> iContent-Type: text/plain; charset=3D"UTF-8"<cr>MIME-Version: 1.=
0<cr><esc>
map! <F6> Content-Type: text/plain; charset=3D"UTF-8"<cr>MIME-Version: 1.=
0<cr>
" general news settings
set ai sw=3D4 tw=3D72

Basically, I'm suggesting that you take all the charcters you find and
want to replace, and save the replacements in a script you can run
easily before looking for new characters that you want to fix.

I use http://qaz.wtf/u/ "Show unicode character" if needed to identify
characters, the plugin might suit you better.

And I have a long-standing macro:

        " Use * to "run" a line from the edit buffer
        " Mnemonic: * is executible in "ls -F"
        " Uses register y
        :map * "yyy@y

If I were you, I would make the commands, test them with *, then 'p'ut
them in the fix script.

That * command is one of three macros I consider essential. The other
two I think are less likely to be universally useful, but anyway:

        " Find previous space and split line on it
        " Mnemonic: 'S'pace
        :map S F r<CR>
        "
        " Double the character under the cursor
        " Mnemonic: fix C code like "if (0 = i) ..."
        :map = y p

Elijah
------
can type his entire vimrc from memory, and often does

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to handle non-ascii characters?

Tony Mechelynck
To each his/her taste of course, but IMHO all-ASCII does not always go
hand in hand with best legibility. What it does go hand in hand with
is best typability on English-language keyboards when no keymap is in
use.

My first HTML pages were in French and I took the trouble to replace
all French non-ASCII characters by their ASCII entities: &agrave;
&ccedil; &eacute; &iuml; &oelig; &ucirc; etc. etc. etc. For French the
result is still (barely) human-readable thanks to the many unaccented
Latin letters in the text.

My current project is a Russian-French dictionary, and replacing all
Cyrillic by numeric entities would have turned it completely into
gobbledygook. Here I have chosen in favour of UTF-8 with the help of
an owncoded keymap and an "international" Latin-alphabet keyboard
(except in rare cases such as &nbsp; written as such in otherwise
empty <td> table cells) and this suits me perfectly; even the French
text looks more readable to me now that I write it in UTF-8.

Best regards,
Tony.

On Mon, Oct 23, 2017 at 10:50 PM, Eli the Bearded
<[hidden email]> wrote:

> Barry Gold wrote:
>> None of these looks like themselves when I edit the file with vim in a
>> cygwin Terminal window. I can search for [^ -~^t] to find the non-ASCII
>> characters, then go to the original word document to find out what the
>> correct character is. If I had only a few of these, that would be
>> enough. But in a longer document, a given non-ASCII can occur hundreds
>> of times. So once I've found (e.g.) an emdash, I want to replace _all_
>> occurrences with  "&mdash;". But I have no way of representing the
>> character I want to replace on the command line.
>
> I have a very similar problem to yours and have evolved some fixes that
> I use. You've already gotten some replies, but maybe my methods would
> help, too.
>
> In my case, I paste content from web pages into Usenet posts and want to
> have as much US-ASCII as possible for best readibility. To that end I
> have a specific vimrc for news that fixes things with map!s. It could
> easily be modified to a ':so script' usage, to fix things on command
> or a 'autocmd BufRead *.html' script to fix thins on load.
>
> In my vimrc:
>
>    autocmd BufRead .article.* :so ~eli/.news_vimrc
>
> And my news_vimrc looks like this:
>
> :r! cat ~/.news_vimrc | mmencode -q
> " smart quotes
> map! =E2=80=99 '
> map! =E2=80=98 '
> map! =E2=80=9C "
> map! =E2=80=9D "
> map! =E2=80=B3 "
> " ellipsis
> map! =E2=80=A6 ...
> " n-dash
> map! =E2=80=93 --
> " m-dash
> map! =E2=80=94 --
> " U+2212 minus
> map! =E2=88=92 -
> " U+2010 hyphen
> map! =E2=80=90 -
> "
> " find non-ascii
> map <F5> /[^     -~]<cr>
> " add mime headers if leaving in non-ascii
> map <F6> iContent-Type: text/plain; charset=3D"UTF-8"<cr>MIME-Version: 1.=
> 0<cr><esc>
> map! <F6> Content-Type: text/plain; charset=3D"UTF-8"<cr>MIME-Version: 1.=
> 0<cr>
> " general news settings
> set ai sw=3D4 tw=3D72
>
> Basically, I'm suggesting that you take all the charcters you find and
> want to replace, and save the replacements in a script you can run
> easily before looking for new characters that you want to fix.
>
> I use http://qaz.wtf/u/ "Show unicode character" if needed to identify
> characters, the plugin might suit you better.
>
> And I have a long-standing macro:
>
>         " Use * to "run" a line from the edit buffer
>         " Mnemonic: * is executible in "ls -F"
>         " Uses register y
>         :map * "yyy@y
>
> If I were you, I would make the commands, test them with *, then 'p'ut
> them in the fix script.
>
> That * command is one of three macros I consider essential. The other
> two I think are less likely to be universally useful, but anyway:
>
>         " Find previous space and split line on it
>         " Mnemonic: 'S'pace
>         :map S F r<CR>
>         "
>         " Double the character under the cursor
>         " Mnemonic: fix C code like "if (0 = i) ..."
>         :map = y p
>
> Elijah
> ------
> can type his entire vimrc from memory, and often does
>
> --
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups "vim_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
> For more options, visit https://groups.google.com/d/optout.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to handle non-ascii characters?

Barry Gold
In reply to this post by Elijah Griffin
On 10/23/2017 1:50 PM, Eli the Bearded wrote:

> Barry Gold wrote:
>> None of these looks like themselves when I edit the file with vim in a
>> cygwin Terminal window. I can search for [^ -~^t] to find the non-ASCII
>> characters, then go to the original word document to find out what the
>> correct character is. If I had only a few of these, that would be
>> enough. But in a longer document, a given non-ASCII can occur hundreds
>> of times. So once I've found (e.g.) an emdash, I want to replace _all_
>> occurrences with  "&mdash;". But I have no way of representing the
>> character I want to replace on the command line.
> I have a very similar problem to yours and have evolved some fixes that
> I use. You've already gotten some replies, but maybe my methods would
> help, too.
>
> In my case, I paste content from web pages into Usenet posts and want to
> have as much US-ASCII as possible for best readibility. To that end I
> have a specific vimrc for news that fixes things with map!s. It could
> easily be modified to a ':so script' usage, to fix things on command
> or a 'autocmd BufRead *.html' script to fix thins on load.
>
> In my vimrc:
>
>     autocmd BufRead .article.* :so ~eli/.news_vimrc
>
> And my news_vimrc looks like this:
>
> :r! cat ~/.news_vimrc | mmencode -q
> " smart quotes
> map! =E2=80=99 '
> map! =E2=80=98 '
> map! =E2=80=9C "
> map! =E2=80=9D "
> map! =E2=80=B3 "
> " ellipsis
> map! =E2=80=A6 ...
> " n-dash
> map! =E2=80=93 --
> " m-dash
> map! =E2=80=94 --
> " U+2212 minus
> map! =E2=88=92 -
> " U+2010 hyphen
> map! =E2=80=90 -
> "
> " find non-ascii
> map <F5> /[^ -~]<cr>
> " add mime headers if leaving in non-ascii
> map <F6> iContent-Type: text/plain; charset=3D"UTF-8"<cr>MIME-Version: 1.=
> 0<cr><esc>
> map! <F6> Content-Type: text/plain; charset=3D"UTF-8"<cr>MIME-Version: 1.=
> 0<cr>
> " general news settings
> set ai sw=3D4 tw=3D72
>
> Basically, I'm suggesting that you take all the charcters you find and
> want to replace, and save the replacements in a script you can run
> easily before looking for new characters that you want to fix.
>
> I use http://qaz.wtf/u/ "Show unicode character" if needed to identify
> characters, the plugin might suit you better.
>
> And I have a long-standing macro:
>
> " Use * to "run" a line from the edit buffer
> " Mnemonic: * is executible in "ls -F"
> " Uses register y
> :map * "yyy@y
>
> If I were you, I would make the commands, test them with *, then 'p'ut
> them in the fix script.
>
> That * command is one of three macros I consider essential. The other
> two I think are less likely to be universally useful, but anyway:
>
> " Find previous space and split line on it
> " Mnemonic: 'S'pace
> :map S F r<CR>
> "
> " Double the character under the cursor
> " Mnemonic: fix C code like "if (0 = i) ..."
> :map = y p
>
I'm impressed that you can type your entire vimrc from memory. I'm
tempted to use some of that. If only I _understood_ it.


--
On Beta, we'd have earrings for that. You could buy them in any jewelry store.
http://www.conchord.org/xeno/bdgsig.html

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to handle non-ascii characters?

Elijah Griffin
Barry Gold wrote:

You wrote:
> I'm impressed that you can type your entire vimrc from memory. I'm
> tempted to use some of that. If only I _understood_ it.

Well the normal stuff that applies globablly. Stuff for specific classes
of files is a bit more difficult. :^) It's basically these three maps
and some :set options.


>> " Use * to "run" a line from the edit buffer
>> " Mnemonic: * is executible in "ls -F"
>> " Uses register y
>> :map * "yyy@y

:map   begin a key remap
     * remap key "*"
       "y into register y
         yy yank the current line
           @y execute the commands in register y

The beauty of this one is the ability to compose complex commands
(typically ":g/select/ s/this/that/" type stuff for me) and then
being able to 'u'ndo and fix the command if I don't get it right
the first time. It also is useful to keep commands in comments of
code.

>> " Find previous space and split line on it
>> " Mnemonic: 'S'pace
>> :map S F r<CR>

:map   begin a key remap
     S remap key "S"
       F ("F ") find previous " " on  current line
        r<CR> replace that space with carriage return

>> " Double the character under the cursor
>> " Mnemonic: fix C code like "if (0 = i) ..."
>> :map = y p

:map   begin a key remap
     = remap key "="
       y ("y ") yank character under cursor
         o put last yank

I remember learning a lot of vi tricks from comp.editors from people
doing things like the above breakdown. Approximately no one reads or
posts there any more.

Elijah

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.