I’m considering trying to create a custom Plugin - but I wanted to see if anyone has come across something similar before trying to embark on my own.
Essentially I want something that’ll replace text in the IDE (for readability sake). I want to take the following string:
this._
and replace with something else, possibly just _
. However I want this to just be a visual change, not an actual change in the document itself. My reason for wanting to do this is the following piece of code is difficult for the eye to parse:
if (this._root) {
this._flattenTree(d).forEach(n => {
n.pack = this._root;
});
this._root.data(this._d);
this._render();
When reading the top line the eye is drawn to this
before root
, while the underscore looks like a space to the eye. This makes it slower (and I find more annoying) to read code. So I want to hide all the this._
possibly swapping with just an underscore so it reads as _.root
or similar.
I can’t actually change the code to that, because then it’d be invalid, and getting team adoption to make that sort of change might be difficult because it’s quite non-standard in the community.
Does this seem like something that’s feasible to do within Sublime? Does anyone know of a plugin that might already do this? Or can anyone give me a starter for 10 (that’ll compliment my effort after reading some Plugin creation 101)?