Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore URIs #34

Open
leycec opened this issue Apr 14, 2020 · 2 comments
Open

Ignore URIs #34

leycec opened this issue Apr 14, 2020 · 2 comments

Comments

@leycec
Copy link

leycec commented Apr 14, 2020

It'd be swell if Spelunker were URI-aware. Currently, both [Neo]Vim's default spell checker and Spelunker incorrectly spell check words embedded within URIs. While we can't do much about [Neo]Vim, Spelunker should ideally auto-whitelist (i.e., not spell check) anything matching a URI.

Under the default spell checker, doing so is mostly trivially. For example, this well-documented one-liner excludes all URIs in Python comments and strings from spell checking when added to ~/.vim/after/syntax/python.vim:

syntax match NoSpellUriPython '\w\+:\/\/[^[:space:]]\+' transparent contained containedin=pythonComment,python.*String contains=@NoSpell

Of course... Spelunker ignores that entirely. URI substrings are yet again highlighted as spelling mistakes, much to the consternation of the spelling Nazi inside all of us. Cue sad panda.

sadpanda

It'd be a spelling miracle on Earth if Spelunker instead either:

  • Preserved backward compatibility with the above sort of logic assuming usage of the default spell checker or...
  • Included similar logic as above in a Spelunker-specific way to ignore URIs across various popular filetypes.

Thanks for all the generous volunteerism over the years, @kamykn. Let's keep on spelunkin'!

@leycec
Copy link
Author

leycec commented Apr 14, 2020

oh. I see from that #20 that this feature request may have been overly optimistic:

It is difficult to add same behavior for Spelunker.vim, because it does not parse the texts.

Perhaps Spelunker should parse the texts. If Spelunker doesn't parse the current buffer in some way, how exactly does it handle CamelCase, snake_case, acronyms, and so on? Is there really no way for Spelunker to at least post-process the results of whatever is parsing the current buffer to filter out false positives like URIs and `-delimited substrings?

Spelunker is such a dramatic improvement over the default spell checker. It'd be the shame of 2020 if this is ultimately infeasible due to "reasons." 😭

If Spelunker itself can't filter out false positives, is there at least a way for end users themselves to do so (e.g., by manually adding some kind of syntax match commands to ~/.vim/after/syntax/{filetype}.vim files)? If there already is a way for us to do that, it'd be awesome if that were documented somewhere. But maybe it already is and I just missed the memo. </sigh>

kamykn added a commit that referenced this issue Apr 16, 2020
@kamykn
Copy link
Owner

kamykn commented Apr 19, 2020

Hi, @leycec!
Thank you for your feedback.
I decided to add new option for this Issue.

  1. Disable URI checking.
let g:spelunker_disable_uri_checking = 1
  1. Disable checking words in backtick/backquote. (Ignore words inside backtick/backquote(`) #20)
let g:spelunker_disable_backquoted_checking = 1

And now, you can use these options.
Please update the plugin and try new option!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants