Finally, it's a working solution for displaying vi mode in the prompt.