Meino Christian Cramer schrieb:
Hi,in the beginning I often wrote shell scripts, which uses $variableinstead of the better${variable} . So I would like to write a short vim script which inserts the "{}" around the name of the variable. It should work, when the cursor is somewhere over the name of the variable.The first step is done: The script can select the word withviw ... But what then ? Thank you very much for any help in advance! Happy editing and have a nice weekend! mcc I use the following mappings anyway (in .vimrc): " autocomplete parentheses and brackets (insert mode) imap ( ()<Left> imap [ []<Left> imap { {}<Left> " " autocomplete parentheses and brackets (visual mode)" uses the above insert mode mappings vmap ( s(<Esc>pvmap [ s[<Esc>p vmap { s{<Esc>pNow mark the word with viwand type { Regards, F. Mehner
