Quantcast
Channel: Active questions tagged keymapping - Stack Overflow
Viewing all articles
Browse latest Browse all 74

Execute key RHS expression in Vim imperatively

$
0
0

Given a string of inputs, it is possible to execute it using :normal!: :normal! ihello will go into insert mode and write the text 'hello'.

When mapping keys to expressions we can use a similar, albeit incompatible syntax. In Lua, we could, for example, define

vim.keymap.set('n', 's', '<c-a>y')

Given such a string, '<c-a>y', how would we execute it imperatively from within Lua/Vimscript without a key binding, similar to what is possible with :normal!?


Viewing all articles
Browse latest Browse all 74

Trending Articles