On Sunday, February 8, 2015 at 5:16:21 AM UTC+8, Jacky Liu wrote:
> Here is the VimL code I wrote:
>
> " Use some wierd Unicode chars to mark the region, '+' being put here as a contrast.
> syntax region myCmdLine matchgroup=myCmdLine_ start=/[⣱+]/ end=/[⡇⡗⡧+]/
> hi link myCmdLine _LightGreen_233b5a
> hi link myCmdLine_ Normal
>
> syntax keyword myCmdName man bind less containedin=myCmdLine contained
> hi link myCmdName _Green_233b5a
>
> And here's its effect on some simple demonstrating text (see attached image file)
>
> With '+' as the marker all three syntax keywords were correctlly recognized, but not with the abnormal Unicode chars
>
> Another thing is using '*' to do a quick search would work normally, as would do the following search command:
>
> /\<man\|bind\|less\>
>
> 'iskeyword' or 'regexpengine' option seems have no effect here.
>
> Should this be considered a bug?
Update:
I've found a solution. Although a slight modification to Vim source would be involved, it solves the problem without any seeming side effects.
The method is changing the classification of certain characters as one desire, by modifying this file: vim74/src/mbyte.c:
/*
* Get class of a Unicode character.
* 0: white space
* 1: punctuation
* 2 or bigger: some class of word character.
*/
int
utf_class(c)
int c;
{
/* sorted list of non-overlapping intervals */
static struct clinterval
{
unsigned short first;
unsigned short last;
unsigned short class;
} classes[] =
{
{0x037e, 0x037e, 1}, /* Greek question mark */
{0x0387, 0x0387, 1}, /* Greek ano teleia */
{0x055a, 0x055f, 1}, /* Armenian punctuation */
{0x0589, 0x0589, 1}, /* Armenian full stop */
{0x05be, 0x05be, 1},
{0x05c0, 0x05c0, 1},
... ...
the above list in mbyte.c defines character slices within the unicode table and how they are to be classified. change the last value to '1' will make that segment punctuation characters, and after recompile&install, word boundry would apply where they appear.
There's another data structure in the same file which specifies the display width of characters:
/*
* For UTF-8 character "c" return 2 for a double-width character, 1 for others.
* Returns 4 or 6 for an unprintable character.
* Is only correct for characters >= 0x80.
* When p_ambw is "double", return 2 for a character with East Asian Width
* class 'A'(mbiguous).
*/
int
utf_char2cells(c)
int c;
{
/* Sorted list of non-overlapping intervals of East Asian double width
* characters, generated with ../runtime/tools/unicode.vim. */
static struct interval doublewidth[] =
{
{0x1100, 0x115f},
{0x11a3, 0x11a7},
{0x11fa, 0x11ff},
{0x2329, 0x232a},
{0x2e80, 0x2e99},
{0x2e9b, 0x2ef3},
... ...
Characters specified by this list would be drawn as double width, this is when the 'ambiwidth' option was set to "double".
The unicode table is so immense that it's not possible to make one classification of characters that suits everybody, so I think the above would be sometimes inevitable
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 vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Tuesday, February 24, 2015
Re: Enable Syntax on Xml Large File only on drawed window
On Tue, Feb 24, 2015 at 11:04 AM, Ben Fritz <fritzophrenic@gmail.com> wrote:
On Tuesday, February 24, 2015 at 9:24:34 AM UTC-6, Ni Va wrote:
> Hi,
>
> After applying this http://vim.wikia.com/wiki/Faster_loading_of_large_files, my big xml file is quick loaded.
>
> Then how can I set syn=xml only for drawed part of file in order to be as fast as possible to view colored part of file?
>
> Thank you
You can't enable syntax highlighting for only part of a file. Syntax highlighting always applies to the entire file.
I don't know if this would be helpful or fit your work flow, but I just tried it and it seems to work ok with a C file anyway. You can try to use Christian Brabandt's NrrwRgn plugin to open the section of interest in a 'narrowed region' and then enable syntax highlighting in only that region. Doing this did not effect the syntax highlighting of the full file, only the narrowed section.
You might try it out and see if it suits your fancy.
Cheers,
Ethan Alan
--
--
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 vim_use+unsubscribe@googlegroups.com.
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 vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Re: Enable Syntax on Xml Large File only on drawed window
On 2015-02-24, Ben Fritz wrote:
> On Tuesday, February 24, 2015 at 9:24:34 AM UTC-6, Ni Va wrote:
> > Hi,
> >
> > After applying this
> > http://vim.wikia.com/wiki/Faster_loading_of_large_files, my big
> > xml file is quick loaded.
> >
> > Then how can I set syn=xml only for drawed part of file in order
> > to be as fast as possible to view colored part of file?
> >
> > Thank you
>
> You can't enable syntax highlighting for only part of a file.
> Syntax highlighting always applies to the entire file.
You can change where syntax synchronization starts, though, which
might help. See
:help :syn-sync
Regards,
Gary
--
--
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 vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
> On Tuesday, February 24, 2015 at 9:24:34 AM UTC-6, Ni Va wrote:
> > Hi,
> >
> > After applying this
> > http://vim.wikia.com/wiki/Faster_loading_of_large_files, my big
> > xml file is quick loaded.
> >
> > Then how can I set syn=xml only for drawed part of file in order
> > to be as fast as possible to view colored part of file?
> >
> > Thank you
>
> You can't enable syntax highlighting for only part of a file.
> Syntax highlighting always applies to the entire file.
You can change where syntax synchronization starts, though, which
might help. See
:help :syn-sync
Regards,
Gary
--
--
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 vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Re: Enable Syntax on Xml Large File only on drawed window
On Tuesday, February 24, 2015 at 9:24:34 AM UTC-6, Ni Va wrote:
> Hi,
>
> After applying this http://vim.wikia.com/wiki/Faster_loading_of_large_files, my big xml file is quick loaded.
>
> Then how can I set syn=xml only for drawed part of file in order to be as fast as possible to view colored part of file?
>
> Thank you
You can't enable syntax highlighting for only part of a file. Syntax highlighting always applies to the entire file.
--
--
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 vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
> Hi,
>
> After applying this http://vim.wikia.com/wiki/Faster_loading_of_large_files, my big xml file is quick loaded.
>
> Then how can I set syn=xml only for drawed part of file in order to be as fast as possible to view colored part of file?
>
> Thank you
You can't enable syntax highlighting for only part of a file. Syntax highlighting always applies to the entire file.
--
--
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 vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Enable Syntax on Xml Large File only on drawed window
Hi,
After applying this http://vim.wikia.com/wiki/Faster_loading_of_large_files, my big xml file is quick loaded.
Then how can I set syn=xml only for drawed part of file in order to be as fast as possible to view colored part of file?
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 vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
After applying this http://vim.wikia.com/wiki/Faster_loading_of_large_files, my big xml file is quick loaded.
Then how can I set syn=xml only for drawed part of file in order to be as fast as possible to view colored part of file?
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 vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Monday, February 23, 2015
Re: Combine . with @:
On Mon, Feb 23, 2015 at 06:46:07PM -0600, Tim Chase wrote:
> On 2015-02-23 15:47, Paolo Bolzoni wrote:
> > It is possible to change the meaning of . so it repeats the last
> > command, whatever it was a normal command or a ex command? I find
> > confusing that I can type dw..., but not :cNext<cr>..
> As others have mentioned, there's no way to expand the behavior of
> the "." command to include things other than normal-mode changes. But
> as you've found, using "@:" re-executes the last Ex command. However,
> since it's a macro, subsequent executions can be performed with "@@"
> which I find MUCH easier to type. And, as you detail, I do it
> frequently with ":cn"ext to browse the quick-fix results. On rare
> occasions where I'm doing a lot of them, I'll do a temporary
> (non-.vimrc) mapping, something like
> :nnoremap <space> :cn<cr>
> which lets me just hit the space-bar to jump to the next result.
I found a leader command useful:
let mapleader = ','
nnoremap <Leader>hhh :call HelpgrepScrollers()<CR>
function! HelpgrepScrollers()
silent! nmap <F6> :cnext<CR>
silent! nmap <S-F6> :cprev<CR>
echo 'helpgrep scrollers :cn and :cp mapped to F6 and S-F6'
endfunction
--
_|_ _ __|_|_ ._ o|
|_(_)(_)|_| ||_)||<
|
--
--
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 vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
> On 2015-02-23 15:47, Paolo Bolzoni wrote:
> > It is possible to change the meaning of . so it repeats the last
> > command, whatever it was a normal command or a ex command? I find
> > confusing that I can type dw..., but not :cNext<cr>..
> As others have mentioned, there's no way to expand the behavior of
> the "." command to include things other than normal-mode changes. But
> as you've found, using "@:" re-executes the last Ex command. However,
> since it's a macro, subsequent executions can be performed with "@@"
> which I find MUCH easier to type. And, as you detail, I do it
> frequently with ":cn"ext to browse the quick-fix results. On rare
> occasions where I'm doing a lot of them, I'll do a temporary
> (non-.vimrc) mapping, something like
> :nnoremap <space> :cn<cr>
> which lets me just hit the space-bar to jump to the next result.
I found a leader command useful:
let mapleader = ','
nnoremap <Leader>hhh :call HelpgrepScrollers()<CR>
function! HelpgrepScrollers()
silent! nmap <F6> :cnext<CR>
silent! nmap <S-F6> :cprev<CR>
echo 'helpgrep scrollers :cn and :cp mapped to F6 and S-F6'
endfunction
--
_|_ _ __|_|_ ._ o|
|_(_)(_)|_| ||_)||<
|
--
--
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 vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Re: Combine . with @:
On 2015-02-23 15:47, Paolo Bolzoni wrote:
> It is possible to change the meaning of . so it repeats the last
> command, whatever it was a normal command or a ex command? I find
> confusing that I can type dw..., but not :cNext<cr>..
As others have mentioned, there's no way to expand the behavior of
the "." command to include things other than normal-mode changes. But
as you've found, using "@:" re-executes the last Ex command. However,
since it's a macro, subsequent executions can be performed with "@@"
which I find MUCH easier to type. And, as you detail, I do it
frequently with ":cn"ext to browse the quick-fix results. On rare
occasions where I'm doing a lot of them, I'll do a temporary
(non-.vimrc) mapping, something like
:nnoremap <space> :cn<cr>
which lets me just hit the space-bar to jump to the next result.
Also, just in case you need it, "g&" is an obscure "across all lines
in the file, repeat the last substitution with the same flags"
command, even if it's several items back in your command-line history.
:help g&
:help @@
-tim
--
--
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 vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
> It is possible to change the meaning of . so it repeats the last
> command, whatever it was a normal command or a ex command? I find
> confusing that I can type dw..., but not :cNext<cr>..
As others have mentioned, there's no way to expand the behavior of
the "." command to include things other than normal-mode changes. But
as you've found, using "@:" re-executes the last Ex command. However,
since it's a macro, subsequent executions can be performed with "@@"
which I find MUCH easier to type. And, as you detail, I do it
frequently with ":cn"ext to browse the quick-fix results. On rare
occasions where I'm doing a lot of them, I'll do a temporary
(non-.vimrc) mapping, something like
:nnoremap <space> :cn<cr>
which lets me just hit the space-bar to jump to the next result.
Also, just in case you need it, "g&" is an obscure "across all lines
in the file, repeat the last substitution with the same flags"
command, even if it's several items back in your command-line history.
:help g&
:help @@
-tim
--
--
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 vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Posts (Atom)