Open for-coursera opened 8 years ago
Hi, unfortunately this wouldn't be so easy to add as one might expect.
I'm aware it's a common feature of many plugins to enable/disable functionality for a given filetype. This is hard-ish for this plugin because highlighting of "troll" chars is added on a per-window (vim window) basis. This was not an intentional decision, it's the way vim enables adding highlight groups dynamically. More about this can be read in vim's help :h matchadd()
.
Would you mind sharing a bit how would you use the disable feature if it existed? Why would you disable this plugin in markdown files?
Bruno,
Thanks for you interest and explanation!
As per your question, it's pretty simple: I use Vim for my writings in Russian (UTF-8), too (be it Markdown, HTML, plain text or something else) – and troll-stopper, as one may expect, starts to highlight characters it thinks are wrong (like Russian letters "с", "о", "е", "а", etc) :).
Hey, that makes sense.
How about adding an option g:whitelist_troll_stopper = ['с', 'о'...]
so that those characters are never highlighted?
This could make sense as you might have Russian characters in the actual code files as a part of strings or comments.
But doesn't that destroy the whole idea of the plugin? :) Especially, in this particular case – since switching between languages now and then may introduce additional typos in the code...
Having said that, I've turned to the original mimic for the time being, running it as external command from Vim. It's not that handy, sure, but after you've described the possible difficulties of enabling the plugin per filetype, I think it just doesn't worth your time and efforts to address the situation of such rarity :).
But still, thanks again for your interest!
btw it also highlights patched font's symbols, e.g. https://github.com/ryanoasis/vim-devicons
Hey @vyorkin, can you elaborate a bit? Are you saying patched font's symbols are highlighted when this plugin is installed? If yea, which symbols exactly?
Yeah, sure!
Here is the font that I'm using:
Its taken from the nerd fonts repo
I'm also using the vim nerdtree plugin & vim-devicons and all together it looks like this:
I'm still not sure about the cause of the problem, maybe it isn't related to your vim plugin at all...
For now i just let g:webdevicons_enable_nerdtree = 0
to disable devicons in nerdtree.
@vyorkin Your screenshot links appear to be broken. Can you add new links?
Feel free to open an issue on vim-devicons/issues if it infact does turn out not to have to do with vim-troll-stopper
in some ascii art, it also exist some speacial characters considered to be incorrect unicode character by this plugin. if it can exist a method, when enter some filetypes, or run some command, execute
highlight TrollStopper ctermbg = NONE guibg = NONE
after leave this filetype, or stop this command, execute
highlight TrollStopper ctermbg = red guibg = #FF0000
perhaps this problem can be solved.
Is it possible to stop the plugin for certain filetypes? Something like
may be? (The example above one doesn't work but I use it here only to illustrate the idea...)
EDITED: Or, may be, vice versa, only enable it for some filetypes?