Tuesday, July 31, 2012

Split editor vertically to show code comments on the right

I occasionally dabble with assembly code and one of the things which can take more time than writing the instructions is keeping your in-line comments (or following line continuation) correctly formatted so that they don't wrap. My preference would be to keep assembly instructions on the left and associated comments on the right, rather than stacked. The problem which I'm trying to solve is having to spend time formatting multi-line comments myself and the trade-off between comprehensive comments and distance between lines of assembly.

I recently had a thought about splitting the editor screen to implement this automatically. The novel bit is that long, single-line comments could wrap in the right-hand pane. This would, however, mean that they would need to flow faster than the code, so a system which vertically-centres the comment for the current line of assembly would be required, perhaps with a brighter colour than other comments.

The nice thing is that the code would remain editable in other editors. The code would simply contain (possibly very long) single-line, end-of-line comments. It would work with almost all assembly languages since they generally have a single character (a # or ;) to start a comment. An enhancement would be to recognise escape characters for pseudo line-breaks, tabs, numbered lists or wiki text, etc.

So to my question: how easy would it be to implement this in vim? I've searched through the archives and seen this (http://www.vim.org/scripts/script.php? script_id=4105) which appears to do something similar - but it's not quite similar enough.

By way of full disclosure I should add that I'm a complete and utter, total vim-script noob, but I'm willing to hack away if I'm given some pointers on how it could be (reasonably easily) implemented.

Regards

Michael

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment