3

In the right-hand-side of a keymapping, you can do something like :call FileTypeToggle("")<Left><Left> to start a function call at the command line, move the cursor in between the quotes, and wait for the user to fill in the argument and hit <CR> manually.

How can you do the same from within a function? I've tried a bunch of permutations of execute, call, normal, and nothing seems to work. I either get errors about trailing characters (<Left><Left>) or it executes the function without waiting for user input.

ivan
  • 1,145

1 Answers1

5

Use the input() function.

let cmd = input("", "call FileTypeToggle(\"\")\<left>\<left>")
exe cmd
garyjohn
  • 36,494