I need some help with writing a python plugin.

I know how to create a plugin but I can't find a way to run a forward or any normal mode stuff. I know I can run commands like echo with self.vim.command('echo "Hello"'). But how can I run a forward like fc to find the nearest c character in the line with python? Also, I would like to run a search with /, how can I do that?.

The only solution that comes to my mind is writing a vimscript function and call it in python with exec function(). But I would have to write one function for each thing I need. I would call it a workaround. I need a solution. Any ideas?


1 Answer 1


you can use the “normal! fc” in as an ex command to run a normal mode command. The ! sign diasables mapping, so will use the command’s original difinition in vim.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.