G
G
gylah-u2022-01-07 12:03:24
vim
gylah-u, 2022-01-07 12:03:24

How to make vim configuration like this?

Hello,
I want to make a bind in NeoVim that will do the following:
Imagine I have a variable, and I stand on the line with it, pressing some keys, for example F5, it will immediately be written:
print("varName: {}".format(varName))
I saw such a plugin in VSCode before, is it possible to do is it in vim?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
U
uvelichitel, 2022-01-07
@uvelichitel

One-liner like this (write in .vimrc)

nnoremap <F5> ciw<Esc>oprint("<C-R>": {}".format(<C-R>"))<Esc>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question