Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Wildcards in Spell-check?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Ian Donegan  
View profile  
 More options Oct 31 2012, 4:49 pm
From: Ian Donegan <donega...@gmail.com>
Date: Wed, 31 Oct 2012 13:49:22 -0700 (PDT)
Local: Wed, Oct 31 2012 4:49 pm
Subject: Wildcards in Spell-check?

I am trying to find a way to use pattern recognition in spell-check. At the moment, I am not even sure if that is possible, but it seems like it should be. If I want to have a url in a file with ":set spell" I have to either mark the link as correct or deal with the red hilighting. Is there any way to white-list everything that starts with "http://"? Thanks in advance.  


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ben Fritz  
View profile  
 More options Nov 1 2012, 10:34 am
From: Ben Fritz <fritzophre...@gmail.com>
Date: Thu, 1 Nov 2012 07:34:23 -0700 (PDT)
Local: Thurs, Nov 1 2012 10:34 am
Subject: Re: Wildcards in Spell-check?

On Wednesday, October 31, 2012 3:49:22 PM UTC-5, Ian Donegan wrote:
> I am trying to find a way to use pattern recognition in spell-check. At the moment, I am not even sure if that is possible, but it seems like it should be. If I want to have a url in a file with ":set spell" I have to either mark the link as correct or deal with the red hilighting. Is there any way to white-list everything that starts with "http://"? Thanks in advance.

Well, spelling integrates with syntax highlight. You could define a simple syntax to recognize the URLs and disallow spelling in that syntax region.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ian Donegan  
View profile  
 More options Nov 1 2012, 10:22 pm
From: Ian Donegan <donega...@gmail.com>
Date: Thu, 1 Nov 2012 19:22:23 -0700 (PDT)
Local: Thurs, Nov 1 2012 10:22 pm
Subject: Re: Wildcards in Spell-check?

On Thursday, November 1, 2012 10:34:23 AM UTC-4, Ben Fritz wrote:
> On Wednesday, October 31, 2012 3:49:22 PM UTC-5, Ian Donegan wrote:

> > I am trying to find a way to use pattern recognition in spell-check. At the moment, I am not even sure if that is possible, but it seems like it should be. If I want to have a url in a file with ":set spell" I have to either mark the link as correct or deal with the red hilighting. Is there any way to white-list everything that starts with "http://"? Thanks in advance.

> Well, spelling integrates with syntax highlight. You could define a simple syntax to recognize the URLs and disallow spelling in that syntax region.

Great. Thanks for the response. I am relativity new to Vim though, so I have no idea how I would go about setting up syntax hilighting rules. The closest thing that I could find in the help file was something about "contains=@NoSpell" but I do not really understand it. How would I go about setting it up, or at least, where could I read more about it?

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ben Fritz  
View profile  
 More options Nov 2 2012, 11:00 am
From: Ben Fritz <fritzophre...@gmail.com>
Date: Fri, 2 Nov 2012 08:00:28 -0700 (PDT)
Local: Fri, Nov 2 2012 11:00 am
Subject: Re: Wildcards in Spell-check?

On Thursday, November 1, 2012 9:22:23 PM UTC-5, Ian Donegan wrote:
> On Thursday, November 1, 2012 10:34:23 AM UTC-4, Ben Fritz wrote:

> > Well, spelling integrates with syntax highlight. You could define a simple syntax to recognize the URLs and disallow spelling in that syntax region.

> Great. Thanks for the response. I am relativity new to Vim though, so I have no idea how I would go about setting up syntax hilighting rules. The closest thing that I could find in the help file was something about "contains=@NoSpell" but I do not really understand it. How would I go about setting it up, or at least, where could I read more about it?

:help syntax
:help :syn-match

If you are just editing a plaintext file with no existing syntax highlighting, it is very easy. Assuming you have "syntax on" in your .vimrc somewhere, just do something like this:

  :syntax match NoSpellURL 'http://\S*' contains=@NoSpell

You can type this directly, put it in a mapping or command, or put this in a file with pretty much any name you want, in ~/.vim/syntax, and set the syntax to the chosen name to activate it. E.g. if you name the file ~/.vim/txtspell.vim you can do :set syntax=txtspell to apply the rule.

It gets somewhat more complicated if you have an existing syntax you want to enhance with this rule but is still quite possible. The "after directory" is useful for this, i.e. ~/.vim/after/syntax.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ian Donegan  
View profile  
 More options Nov 2 2012, 1:57 pm
From: Ian Donegan <donega...@gmail.com>
Date: Fri, 2 Nov 2012 10:57:02 -0700 (PDT)
Local: Fri, Nov 2 2012 1:57 pm
Subject: Re: Wildcards in Spell-check?

Well, I thank you, Ben Fritz. I stuck that line in my .vimrc file and it fixed my problem for the most part. I still do not understand all of the syntax behind it yet but I should be able to figure the rest out with the help of the manual. It has been a pleasure learning from you.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ben Fritz  
View profile  
 More options Nov 2 2012, 3:59 pm
From: Ben Fritz <fritzophre...@gmail.com>
Date: Fri, 2 Nov 2012 12:59:45 -0700 (PDT)
Local: Fri, Nov 2 2012 3:59 pm
Subject: Re: Wildcards in Spell-check?

On Friday, November 2, 2012 12:57:02 PM UTC-5, Ian Donegan wrote:

> >   :syntax match NoSpellURL 'http://\S*' contains=@NoSpell

> Well, I thank you, Ben Fritz. I stuck that line in my .vimrc file and it fixed my problem for the most part. I still do not understand all of the syntax behind it yet but I should be able to figure the rest out with the help of the manual. It has been a pleasure learning from you.

If you never apply any other syntax highlighting, I suppose adding it to your .vimrc will work.

But more likely eventually you'll edit something syntax highlighted. I suggest wrapping it in a command or syntax plugin of your own.

See :help new-filetype for detecting when to apply the plugin. See :help usr_44.txt for setting up the syntax plugin itself.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ian Donegan  
View profile  
 More options Nov 2 2012, 4:28 pm
From: Ian Donegan <donega...@gmail.com>
Date: Fri, 2 Nov 2012 13:28:12 -0700 (PDT)
Local: Fri, Nov 2 2012 4:28 pm
Subject: Re: Wildcards in Spell-check?

That is probably what I will end up doing. I discovered that if I just have it in my .vimrc file, it will not take effect when I restore a session, or like you said, when I edit file types that have other syntax highlighting.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »