在Vim中用引号将两个单词括起来 [英] Surround two words with quotes in Vim

查看:211
本文介绍了在Vim中用引号将两个单词括起来的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用vim-surround和以下文本. (*是光标的位置)

I am working with vim-surround and the following text. (* is the place of the cursor)

This is a lo*ng line and I want to highlight two words

我想在引号中同时包含长词和行词,以便使其成为

I want to surround both the words long and line within quotes, so that it becomes

This is a "long line" and I want to highlight two words

是否可以在不进入可视模式的情况下做到这一点?

Is it possible to do it without getting into visual mode?

推荐答案

尝试:ys2w"(ys需要运动或文本对象,然后是要包围的字符).

Try: ys2w" (ys takes a motion or text object, and then the character with which you want to surround).

这篇关于在Vim中用引号将两个单词括起来的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆