vim – 如果不在行的末尾插入,则限制文本宽度不能按预期工作
发布时间:2020-12-15 21:33:10 所属栏目:安全 来源:网络整理
导读:我知道我们可以使用:set tw = 80来限制文本宽度.但是,如果我们在结束之前插入文本,则此函数根本不起作用. 例如,假设我们输入“您希望通过电子邮件向您发送问题的回复吗?” 如果我们继续在“?”之后输入,则tw工作正常.但是如果我们在说“have”之前插入它,
我知道我们可以使用:set tw = 80来限制文本宽度.但是,如果我们在结束之前插入文本,则此函数根本不起作用.
例如,假设我们输入“您希望通过电子邮件向您发送问题的回复吗?” 如果我们继续在“?”之后输入,则tw工作正常.但是如果我们在说“have”之前插入它,即使它超过指定的文本宽度也不会中断. 有没有办法在后一种情况下使这项工作? 解决方法
这可能是使用
formatoptions 或
formatexpr 配置的,但我不知道如何.
另一种解决方案是在视线选择上使用gq手动格式化,即如果文本宽度> = tw则添加断裂线. >在另一个文本块中键入您喜欢的任何文本,从而使其宽度为80个字符或更多 从 Format the lines that {motion} moves over. Formatting is done with one of three methods: 1. If 'formatexpr' is not empty the expression is evaluated. This can differ for each buffer. 2. If 'formatprg' is not empty an external program is used. 3. Otherwise formatting is done internally. In the third case the 'textwidth' option controls the length of each formatted line (see below). If the 'textwidth' option is 0,the formatted line length is the screen width (with a maximum width of 79). The 'formatoptions' option controls the type of formatting fo-table. [..] 有关Vim文本宽度如何工作的更多信息,请查看 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- Angular 6 Meta服务,包含来自Web服务的动态元数据
- 2、Angular JS 学习笔记 - 双向数据绑定和Scope概念
- Macvim Surround插件
- Angular 4:“AbstractControl”类型上不存在属性“push”和
- 最近用到Bootstrap Multiselect来详细了解一下
- playframework-2.0 – 如何使用build.sbt(而不是Build.scal
- AngularJS-在路由到其他控制器之前提示用户以保存更改
- 斯卡拉的一般有限状态机(传感器)
- bash flock:如果无法获取锁定则退出
- 详解基于Bootstrap+angular的一个豆瓣电影app