> -----Original Message-----
> From: Thomas Michael Engelke [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, November 16, 2006 10:42 AM
> To: vim-Mailingliste
> Subject: Upcase every keyword while editing
> 
> Hello!
> 
> I am looking for a way to mimic a functionality I've seen in 
> the editor ED4Win (http://www.softasitgets.com/). What I want 
> to do is to automagically upcase every written word that is 
> considered a keyword.
> I program in Progress 4GL and use the syntax file from the 
> gvim standard distribution.
> 
> Theoretically, in my understanding of the problem, I would 
> need to write a function to check the word before the cursor 
> against the keywords list and map this one to something. 
> Usually, I leave the boundaries of a keyword by using either 
> space, tab, ":", ",", enter or ".". So I would have to map 
> this function to every of those keys in insert mode.

That is exactly why I wrote:
" SrchRplcHiGrp - Search and replace based on a syntax highlight group
" http://www.vim.org/script.php?script_id=848

Put your cursor on the word highlighted the colour that you want uppercased.
:SRChooseHiGrp
Or
:SRChooseHiGrp!

Visually select the range you want (or ggVG for whole file):
:'<,'>SRHiGrp 

The defaults selected will uppercase the words.

I wrote it mainly since I work with SQL and like the keywords uppercased.
But you can do anything with Vim's regex to the matches.

HTH,
Dave

Reply via email to