
Ask HN: Are there any IDEs or editors that support editable views of code/text? - andywood
What I am imagining is this: The underlying file format does not change. You can specify some sort of bidirectional transformation, via regexes or maps or something. The editor presents you with an editable view of the text, with this transformation applied. When you make edits, the reverse transformation is applied to the underlying file.<p>Think of it as a vastly expanded version of git&#x27;s &#x27;change line feed&#x27; options. Your team likes tabs but you like spaces? Edit in spaces view - they never get into the file. Your team likes veryLongDescriptiveCamelCaseNames, but you like to kp it trs? Edit in terse view - the file is always camelCased.<p>I&#x27;m not really looking for a solution to one or both of these problems in particular, though. I&#x27;m really looking for an editor that even has a notion of &quot;editable -views- of text&quot; to begin with. Does this exist?
======
frou_dh
You could implement the 2 transformations using any language you like, and
then hook into your editor of choice's on-load/on-save API, to pipe the text
through the external programs.

~~~
andywood
Aha! I had not thought to look for such a hook. Are they common? This is very
close to what I'm looking for, thank you. Then, to toggle, I guess I would
automate closing and reopening the file.

Edit: Oops. Now I'm thinking this would _probably_ break all code analysis
features. It would be nice if there was a notion of a 'view' that is very
superficial and doesn't impact the code analysis.

~~~
frou_dh
All programmer editors should at least have some mechanism to notify you when
loads/saves occur. But you might need to use whatever the editor's embedded
scripting language is to do the actual child process launching and to do
something non-standard with their output.

In Sublime Text for example, the above would be writing a Python class that
handles some of these events:

[https://www.sublimetext.com/docs/3/api_reference.html#sublim...](https://www.sublimetext.com/docs/3/api_reference.html#sublime_plugin.EventListener)

...probably by making use of the subprocess module from Python's standard
library:

[https://docs.python.org/3.3/library/subprocess.html](https://docs.python.org/3.3/library/subprocess.html)

------
0942v8653
For a lite version of this, take a look at Vim's conceal patch:
[http://vim.wikia.com/wiki/Patch_to_conceal_parts_of_lines](http://vim.wikia.com/wiki/Patch_to_conceal_parts_of_lines)

