On Sep 16, 12:18 pm, Christian Brabandt <[email protected]> wrote:
> Hi vim_use!
>
> On Mi, 16 Sep 2009, Christian Brabandt wrote:
>
> > …col("."), 0), "name") !~# 'String')…
>
> That should have been sqlString obviously. You can check, with the
> command that has been given as example under :h synIDattr() and you
> can possibly make it available as command (I have this in my .vimrc):
> ,----
> | if has('user_commands')
> | command! -nargs=0 WhatSyntax echo synIDattr(synID(line("."),
> col("."), 1), "name")
> | endif
> `----
>
> regards,
> Christian
> --
> :wq!
Thanks a lot.
Whith the below code I change all ocurrences of the word under cursor
to upper case only if syntax not contains String nor Comment re-build
it in one line).
the perfect solution would be: function changeInCode(pattern,whatSyntax
(es),...), but at the moment my poor map works well.
nmap <A-u> ma*:%s//\=((synIDattr(synID(line('.'), col('.'), 0),
'name') !~? 'String') && (synIDattr(synID(line('.'), col('.'), 0),
'name') !~? 'Comment'))?(toupper(submatch(0))):submatch(0)<CR>`a
Regards, M
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---