I am writing my first vim plugin (viml + python). One command that the plugin has is GetStepCommand (), and it basically extracts data from a remote data source, I massage the data a bit and copy it to the buffer so that the user can start editing it. There is a parameter that the user must provide "GetStepsCommand", and this is the search path where the data is located, for example: / projects / procedure / step
Now this path can be long, and it is easy to miss something. Therefore, I wanted to implement my own tab completion for the parameter part. Vim is already engaged in automatic completion of the command by tabulation, but, of course, he cannot know how to complete the parameter (I will allow something myself).
But first, I need to know: - if / how I can intercept a keystroke in command mode - get / get the command line that the user is currently writing - check if it works in command line or insert / view mode - and finally return the updated command line (tab completed), so that the user can continue writing to ':' after pressing the key.
Any pointers, tips, articles, tutorials ... ie highly appreciated
vim vim plugin
Kristoffer nordstrΓΆm
source share