2008/05/29
2008/05/13
Using :vimgrep inside VIM
Grep is really power tool under the UNIX domain. From Vim 7, an internal `grep` was provided by Vim.
Using `:vimgrep` is fairly easy, just in command mode, type in
Let's do something to help us! Put this into your ~/.vimrc file.
After that, you will be able to use the <F3> and <shift>-<F3> navigate the `quickfix` list easily. :D
Using `:vimgrep` is fairly easy, just in command mode, type in
:vim[grep][!] /{pattern}/[g][j] {file} ...The `grep` result will be put into the `quickfix` list. The `:cnext`, and `:cprevious` can be used to navigate the `quickfix` list.
Let's do something to help us! Put this into your ~/.vimrc file.
" We can navigate the list by using theand
map <F3> :cnext
map <S-F3> :cprevious
After that, you will be able to use the <F3> and <shift>-<F3> navigate the `quickfix` list easily. :D
2008/05/09
Tip for trouble shooting the VIM syntax highlight
It is easy to do a VIM syntax highlight file, while it is a little difficult for you to do the trouble shooting, especially when you do a recursive pattern match with `contains`, `nextgroup` keywords.
Here is a small tip can help you a little bit.
put this into your ".vimrc" file
For the next time, when you met some syntax highlight error, you can key in <F12> at the error place, VIM will tell you "what kind syntax ID that it is thing under the given position".
Keep fun! :)
Here is a small tip can help you a little bit.
put this into your ".vimrc" file
" display the syntax name under the cursor
map <F12> :echo synIDattr(synIDtrans(synID(line("."), col("."), 1)), "name")
For the next time, when you met some syntax highlight error, you can key in <F12> at the error place, VIM will tell you "what kind syntax ID that it is thing under the given position".
Keep fun! :)
订阅:
博文 (Atom)
BlockChain 相关电子书
@copyright of Sam Chadwick - https://thehub.thomsonreuters.com/groups/bitcoin/blog/2017/09/10/blockchain-paper Blockchain Papers A c...
-
兴趣是最好的老师, 世界上没有完美的系统,电子车票系统也是如此。 这个PDF里讲述了一个MIT的三位学生发现了波士顿地铁电子车票系统的漏洞的故事。 国内的这种研究的精神似乎少了一些! 我们的教育导向太死板了!
-
火车停了 话说列宁,斯大林,赫鲁晓夫,勃列日涅夫,戈尔巴乔夫五人同坐一列社会主义号火车前进, 突然火车停了,车长过来报告,前面铁路断了,列宁:"说发动一次星期六义务劳动把它修好",斯大林一瞪眼:"一定有阶级敌人搞破坏,抓起来枪毙",赫若有 ...
-
Apple (TM) iPhone (TM) 3G 版本 Zippy 2008年6月9日在旧金山发布。 看看这次 Steve Jobs 给我们带来了什么? 8G内存的版本价格为 $199 = ¥1400 : 3G UMTS, Wifi, Apple's design. ...