Setting termcap entries: avoid literal Esc?

8 views
Skip to first unread message

Lifepillar

unread,
Aug 8, 2022, 8:06:31 AM8/8/22
to vim...@googlegroups.com
In my vimrc I have entries such as these:

set <s-right>=^[f
set <a-h>=^[h

where ^[ is a literal Esc. Is it possible to perform such assignments
without using a literal Esc? For other entries I am able to use the
& form (say, &t_BE = "\033[?2004h"). I am asking specifically about
entries like the above, which either don't have a corresponding option
in Vim AFAIK (<a-h>) or which have an option with special characters
(t_%i).

I am using Vim 9 script, if that matters.

Thanks,
Life.

M

unread,
Aug 8, 2022, 8:28:10 AM8/8/22
to vim...@googlegroups.com


пн, 8 авг. 2022 г. в 15:06, Lifepillar <lifep...@lifepillar.me>:
--
--
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+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/tcqu7q%24ddd%241%40ciao.gmane.io.

I believe it's only possible by using execute

    execute "set <a-h>=\<esc>h"

Kind regards,
Matvey

Bram Moolenaar

unread,
Aug 8, 2022, 9:06:47 AM8/8/22
to vim...@googlegroups.com, Lifepillar
Something like this doesn't work for options with a <> name:

&<S-right> = "\<Esc>f"

But this does:

exe "set <S-right>=\<Esc>f"


--
GALAHAD: Camelot ...
LAUNCELOT: Camelot ...
GAWAIN: It's only a model.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Lifepillar

unread,
Aug 8, 2022, 10:19:43 AM8/8/22
to vim...@googlegroups.com
Thank you both! I hadn't thought about using execute.

Life.

Reply all
Reply to author
Forward
0 new messages