Insert predefined text on keyboard shortcut

后端 未结 6 961
悲&欢浪女
悲&欢浪女 2021-02-07 04:27

I often insert binding.pry to my ruby files when I debug them. As I use Vim I\'d love to automate it to avoid retyping it every time. How could I do it?

Th

6条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-07 05:01

    Easiest is an abbreviation that is triggered from insert mode:

    :ia debug binding.pry
    

    Now, when you type debug, the text binding.pry is inserted on a new line.

    Documentation: :help abbreviations

提交回复
热议问题