What Vim command(s) can be used to quote/unquote words?

前端 未结 16 881
余生分开走
余生分开走 2020-12-12 08:36

How can I quickly quote/unquote words and change quoting (e.g. from \' to \") in Vim? I know about the surround.vim plugin, but I would like to use

16条回答
  •  自闭症患者
    2020-12-12 09:16

    Here are some simple mappings that can be used to quote and unquote a word:

    " 'quote' a word
    nnoremap qw :silent! normal mpea'bi'`pl
    " double "quote" a word
    nnoremap qd :silent! normal mpea"bi"`pl
    " remove quotes from a word
    nnoremap wq :silent! normal mpeld bhd `ph
    

提交回复
热议问题