vim-utils / vim-troll-stopper Goto Github PK
View Code? Open in Web Editor NEWStop Unicode trolls from messing with your code.
License: MIT License
Stop Unicode trolls from messing with your code.
License: MIT License
I have 175KB plaintext file with some very large lines. The largest one has 20K characters. All characters are standard ASCII chars, none of them are trollish.
If I open this file and :set nowrap
, Vim becomes very slow and laggy. Disabling vim-troll-stopper
plugin solves it.
The same happens when I open an SVG file, because several lines are very long.
Ideas for solutions:
:TrollStart
to enable it; :TrollStop
to disable it (I think this is already implemented); :TrollToggle
to toggle it. Alternatively, could be :TrollOn
and TrollOff
. Maybe even :Trollolo
to toggle it.Is it possible to stop the plugin for certain filetypes? Something like
autocmd FileType mkd let g:loaded_troll_stopper = 0
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?
I dropped troll_stopper.vim into my vim\vim74\plugin folder. Upon starting vim, I see this error in a popup:
Error detected while processing C:/vim/App/vim/vim74/plugin/troll_stoppe
r.vim:
line 275:
E713: Cannot use empty key for Dictionary
E15: Invalid expression: { "\u00A0": ' ', "\u2000": ' ', "\u2001": ' ', "\u2002": ' ',
Followed by this red error in the vim window:
Error detected while processing function <SNR>20_HighlightTrolling:
line 2:
E121: Undefined variable: s:troll_regex
E116: Invalid arguments for function matchadd
I'm sure I've either done something wrong in installing, or I'm missing some dependency. Can you give an example of "Use your favorite plugin manager"?
TrollStopper works fine on Vim 8.x, but when I try and use it on Vim 7.4.160 (which is the system Vim that ships with CentOS 7.3) I get the following error:
Error detected while processing function <SNR>28_HighlighTrolling:
line 7:
E118: Too many arguments for function: matchadd
Any ideas?
\ "\u200B": '',
should do the trick
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.