from Hacker News

Ask HN: Are there any IDEs or editors that support editable views of code/text?

by andywood on 2/28/18, 6:28 PM with 4 comments

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.

Think of it as a vastly expanded version of git's 'change line feed' 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.

I'm not really looking for a solution to one or both of these problems in particular, though. I'm really looking for an editor that even has a notion of "editable -views- of text" to begin with. Does this exist?

  • by frou_dh on 2/28/18, 7:06 PM

    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.
  • by 0942v8653 on 2/28/18, 10:19 PM

    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