No generic solution for this exists, so sorry: I anticipate disappointment.
You might be able to build a Visual Studio plugin with an implementation of this, but it isn't a standard solution on any platform besides maybe Vi/Vim or Emacs (and even then I'm not sure).