rdfs:comment
| - The title of this proposed tip is a bit ambitious: graphics and drawing? I'm not sure that this page is really useful without something showing how it could be useful. Echo is ok for an occasional message, but not for a GUI. Netrw is an example of a Vim script that does complex presentation, without echo. Several tips use echohl/echon, but none discuss it as a topic, but there are lots of Vim commands, and I'm not sure that a tip on each is useful. JohnBeckett (talk) 09:52, August 7, 2013 (UTC)
|
abstract
| - The title of this proposed tip is a bit ambitious: graphics and drawing? I'm not sure that this page is really useful without something showing how it could be useful. Echo is ok for an occasional message, but not for a GUI. Netrw is an example of a Vim script that does complex presentation, without echo. Several tips use echohl/echon, but none discuss it as a topic, but there are lots of Vim commands, and I'm not sure that a tip on each is useful. JohnBeckett (talk) 09:52, August 7, 2013 (UTC) I found it useful because Vim comes so close to being a general purpose application scripting language but it is usally seen as lacks screen-drawing functions. There are patches that do expose the screen but they haven't been mainlined yet -- this method will obviously be obviated if they ever do. But it took me literally years to actually put all the parts together. For example, I have a nested list / dictionary editor that I've been sourcing for about 3 or 4 years which uses purely echo commands. This has the advantage of not needing to open a buffer and being a bit more straightfoward to code. The screen flicker is almost nonexistent even with the key held down, and certainly non-existent with single key presses. I went through a long time using "redraw! | echo" before I stumbled upon, randomly, the "se nomore" setting. And I went through a long time with it being monochromatic before I figured out that I can use "echon" to arbitrarily color texts -- so now the cursor selection is highlighted as "visual", I have different highlighting for types, and so on. It's really just a few lines of code away from being a nested file browser that doesn't need to load in a new tab. Basically, you can imagine it as a quick and dirty way for someone used to having minimal screen drawing functions to write some prettier scripts -- and it does actually work pretty well. Q335r49
|