Folks, posting here to gauge interest before adding an issue on
GitHub: What interest is there in adding a command line option that
causes vim to return the current value of VIMRUNTIME?

The use case is to find macros, etc., dynamically, e.g., in one's
.bashrc, et al, with minimum hardcoding. Example: I have the following
lines in one of my BASH dotfiles (lines broken and \ added for
readability):

# if available, use a better less  - warning, this is gross but unavoidable
vimrntm=$(vim --not-a-term -T dumb --cmd 'echo $VIMRUNTIME' --cmd quit | \
tr -d '\n\r' |sed -E 's,[^/]+,,')
vimless=${vimrntm}/macros/less.sh
[[ -x ${vimless} ]] && alias less=${vimless} || { \
    echo; echo You may want to find less.sh manually, using pure less
for now.; \
    echo; }

What I'd really like is "vimrntm=$(vim --get-vimruntime)", which would
simply print out an appropriately terminated string containing the
value, e.g., /usr/share/vim/vim81.

Note that I don't set VIMRUNTIME anywhere, I am simply trying to
retrieve it in the most efficient way. On the various platforms I work
on, it may be /usr/share/vim/vim74, ...81, ...82, etc., or absent.

Thoughts?

Thanks,

P

Peter Whittaker

-- 
-- 
You received this message from the "vim_dev" 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_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/CAGeouKHzbpEu_Oe3BfK-Cr%3DKnhVUK3LYceG2Fb%3DLJEn--yTdKA%40mail.gmail.com.

Raspunde prin e-mail lui