VIM笔记--搜索文本时忽略大小写&高亮显示查找文本
2012-09-20 11:19
453 查看
忽略大小写
/searchword\c
或者修改设置
:set ignorecase
或者
:set ic
高亮显示
:set hlsearch
取消高亮显示
:set nohlsearch
如何查找同时包含两个查找字符的行
/searchword\c
或者修改设置
:set ignorecase
或者
:set ic
高亮显示
:set hlsearch
取消高亮显示
:set nohlsearch
如何查找同时包含两个查找字符的行
Finding two words in either orderEdit Finding two words in either order sectionEdit You can search for a line that contains two words, in any order. For example, the following pattern finds all lines that contain both "red" and "blue", in any order: .*red\&.*blue In a pattern, \& separates alternates, each of which has to match at the same position. The two alternates in this example are: .*red (will match all characters from the beginning of a line to the end of the last "red"); and .*blue (will match all characters from the beginning of a line to the end of the last "blue"). A line which contains both "red" and "blue" will match both alternates, starting at the beginning of the line. The pattern .*red\&.*blue finds the last alternate (but only if all alternates match at the same position), so if you are highlighting matches, you will see text matched by .*blue highlighted. An alternative procedure is to use a pattern that explicitly finds "red" followed by "blue", or "blue" followed by "red": \(red.*blue\)\|\(blue.*red\) To search for lines that contain only the whole words "red" and "blue", in either order, use one of the following patterns: .*\<red\>\&.*\<blue\> \(\<red\>.*\<blue\>\)\|\(\<blue\>.*\<red\>\) |
相关文章推荐
- VIM笔记--搜索文本时忽略大小写&高亮显示查找文本
- VIM中自己没记住的小技巧,行内搜索和搜索当前word和忽略大小写查找和缩进代码和光标返回
- vim高亮显示文本
- vim使用技巧之一: 取消搜索高亮显示
- 在Linux的vi编辑器中,如何开启或关闭忽略大小写查找文本
- Vim查找忽略大小写
- MacBook设置终端命令行的颜色高亮显示及自动补全忽略大小写
- asp实现关键词不区分大小写搜索并高亮显示
- NT_iOS笔记—CoreText添加文字背景色(搜索的高亮显示)
- C# 利用正则表达式进行忽略大小写的字符串替换的应用--自定义高亮显示
- [置顶]Emacs for vi Users | Emacs 和 Vim 基础键对应 ----<编辑器文本操作,搜索/替换/正则操作>
- asp实现关键词不区分大小写搜索并高亮显示
- Vim 高亮显示单词并查找
- vim 忽略大小写查找字符串
- Linux 笔记 #01# 搭建 Python 环境 & vim 代码高亮
- asp实现关键词不区分大小写搜索并高亮显示
- 让Vim查找字符忽略大小写
- 【C1FlexGrid&C1DataGrid】高亮显示表格中的查找结果
- vim 取消查找到的字符一直高亮显示
- vim 中修改查找字符串时高亮显示的颜色