Monday, August 20, 2018

I tried a Vim without frills, and it taught me I've been living in luxury

Just to see what it meant, I tried a Small Vim (instead of my usual
Big) with Motif GUI (instead of my usual GTK2), and it taught me I've
been living in luxury. Here are some highlights of what what I found
out (for anyone who might be interested):

- No expression evaluation, therefore both "if" and "else" branches of
every :if statement become comments. This make some things very hard
to customize in the vimrc. It was to be expected, but I hadn't
realized how hard. For instance the usual ":if has(...) ... elseif
has(...)" etc. construct to select the right operand for the "set
guifont" option becomes meaningless.
- No syntax highlighting. For instance the help becomes a drab dark
grey on light grey everywhere without the usual purple tags, green
links, etc.: yes it makes a difference. :colorscheme with no argument
answers "unknown", with an argument it gives an error during attempted
execution of the colorscheme script.
- The 'guifont' format is the old "other-X11" format, like GTK1 used
to have. You know (or maybe you don't), stuff like

:set guifont=-*-courier-medium-r-normal-*-10-*-*-*-m-*-*

":set guifont=*" does pop up a menu, with surprizingly few choices,
and most of them give, when I click OK, an error popup saying I
selected an invalid font. Running "xlsfont" in a shell shows why: most
supposedly monospaced fonts are actually scalable fonts, whose only
size is 0-0-0-0. Setting that (or replacing all sizes by *) for such a
font is possible in Motif, but it gives only one size which for me is
much too big. The only monospace fonts installed here (on my openSUSE
15.0 system) which come in more than one preset size are Adobe Courier
and B&H Lucida Typewriter (which can be set by starting the 'guifont'
setting with -*-courier- or -*-lucidatypewriter- respectively).

It _is_ possible to write a vimrc so that a specific part is executed
only by builds with -eval, namely, write first the part for +eval
builds, as follows:

" anything here or above (with no :if statements)
" is for both +eval and -eval builds.
" It has to be craftily written to avoid syntax errors
" without the possibility to use :if has() or :if exists()
if 1
...
" this is for +eval builds only
...
finish
endif
" anything here or below will be executed only by -eval builds

If expression evaluation is not compiled-in, the whole if statement
(even "if 1") becomes a comment, therefore -eval builds don't see the
:finish statement inside that "comment" and they start merrily
executing after the outermost :endif.

So it is possible. Maybe someday I'll add something like that at the
beginning and end of my vimrc.

Best regards,
Tony.

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: