当前位置:网站首页>Sentence s, paragraph P in VIM text object
Sentence s, paragraph P in VIM text object
2022-06-11 03:40:00 【sayWhat_ sayHello】
introduction
It has been used for nearly half a year ideaVim 了 , It's time to feed back to the community ~~
vim Most text objects in text objects are easy to understand . This article mainly aims at the sentences and paragraphs which are seldom used and difficult to understand , Show and understand the code .
reference
Text
Here we need to understand their definition first :
The sentence s
A sentence begins with ‘.’、’!’ perhaps ‘?’ ending and Followed by a line break 、 Spaces or tabs . End punctuation
Any number of closed parentheses and quotation marks can appear between and white space characters : ‘)’、’]’、’"’ and ‘’’. Paragraphs and subsections
The boundary of is also regarded as the boundary of the sentence .
If ‘cpoptions’ contain ‘J’ Sign a , Then there must be at least two spaces after punctuation , And tabs
Not treated as white space characters .
In coding, our sentences do not represent a single line , It strictly follows the above definition .
The paragraph p
A paragraph begins with each Blank line Or the paragraph macro command starts , Paragraph macros consist of ‘paragraphs’ The characters that appear in pairs in the options
Defined by . Its default value is “IPLPPPQPP TPHPLIPpLpItpplpipbp”, That's the macro “.IP”、".LP"
etc. ( These are nroff macro , So the full stop must appear in the first column ). Section boundaries are also considered paragraph boundaries .
Be careful Blank line ( Contain only blank lines ) No Paragraph boundaries .
Also want to Be careful : This does not include the ‘{’ or ‘}’. But if ‘cpoptions’ It contains ‘{’ sign
position , So the first column ‘{’ Can be used as a paragraph boundary posix .
Case study
For example, the cursor is as shown in the figure :
Think about pressing vis, What will we choose ?
Here the sentence is bounded by the paragraph .
We return to the original state and press vip:
Now a full stop has been added to the original basis .
At this time vis Then the part before the space is selected as the sentence .
summary
Sentences seem tasteless when used in code . In my initial understanding , The sentence should be one line , But I want to understand, because there are many quick operations in the line . For example, select a row :V, Repetitive :yydd And so on. , There's really no need to do more .
Paragraphs can be used between blank lines : { or } Jump , More commonly used .
边栏推荐
- [elt.zip] openharmony paper Club - multi tier storage hierarchical data compression
- JS to realize coritization
- Multi thread alternate output ab
- postgresql 语句
- 基于SSM框架的学生老师考试管理系统
- If not, use the code generator to generate a set of addition, deletion, modification and query (2)
- WEB上传文件预览
- 潮玩力真火力!年轻人第一台巨幕影院?酷开电视Max 86“庞然来袭
- Logical deletion_ Swagger2 framework integration
- Canvas rotation drawing H5 animation JS effect
猜你喜欢

Computer vision (AI) interview

three. JS cool technology background H5 animation

Delete the watermark of the picture uploaded by CSDN

Run Skynet for the first time

【ELT.ZIP】OpenHarmony啃论文俱乐部——快速随机访问字符串压缩

基于SSM框架的学生老师考试管理系统

Course classification tree structure display

Canvas drawing -- how to place the drawing in the center of the canvas

2022 年 5 月产品大事记

PostgreSQL source code learning (XX) -- fault recovery ① - transaction log format
随机推荐
基于SSM框架的连锁超市购物零售后台管理系统
OpenGL Chapter 10 illuminant
PostgreSQL source code learning (21) -- fault recovery ② - transaction log initialization
摘桃子(双指针)
OPENSSL ASN.1, DER, PEM, X509
three.js炫酷科技感背景h5动画
Simple image browsing with fragment
Canvas interactive star animation background JS special effect
OPENSSL ASN. 1, DER, PEM, X509
Iqoo 8 measured hands-on experience: return of the king, never high profile
/10个值得推荐的学习编程的网站 世界已经进入了互联网的时代。据最近发布的一篇《2016年互联网趋势》报告显示,中国已成为互联网市场的领导者,中国互联网用户的数量达到了6.68亿。可以预见,有
Understand single chip microcomputer drive 8080lcd
pmm监控oracle
Canvas rotation drawing H5 animation JS effect
/The world of 10 recommended websites for learning programming has entered the era of the Internet. According to a recently released Internet trends 2016 report, China has become a leader in the Inter
rt-thread测试
JS to realize coritization
ARM开发板方案与厂商分析
Pthread in the multithreaded Trilogy
Opencv实现纵横比保持的图像缩放