【发布时间】:2014-03-21 05:17:16
【问题描述】:
我想在 vi 编辑器中看到 first 5 lines after the match found。命令是什么?
我只知道这些命令
/Incident Id: 给出从头到尾的所有行
:g/Incident ID:只给出匹配词隐藏所有不匹配
但是如何在找到匹配词后显示前 5 行...?
示例与预期输出:
我有 8 行文本,我搜索 事件 ID
Incident ID: 1392875740716 <<<Match word here
URL: /Project/jsps/ErrorPage.jsp
java.lang.NullPointerException
at java.util.Calendar.setTime(Calendar.java:1092)
at com.cando.restaurant.utils.DateRange.createForWeek(DateRange.java:54)
at org.springframework.transaction.interceptor.TransactionInterceptor :110)
at org.springframework.aop.framework.ReflectiveMethodInvocation
at org.springframework.aop.interceptor.ExposeInvocationInterceptor
预期输出
Incident ID: 1392875740716 <<<Match word here
URL: /Project/jsps/ErrorPage.jsp
java.lang.NullPointerException
at java.util.Calendar.setTime(Calendar.java:1092)
at com.cando.restaurant.utils.DateRange.createForWeek(DateRange.java:54)
【问题讨论】: