vim tips
.vimrc

vim tips

流浪 posted @ 2007年9月01日 09:08 in Vim tips , 4571 阅读

在一打开的全部缓冲区内搜索并替换一个string。

把下面的函数放到配置文件中

function AllBuffers(cmnd)
  let cmnd = a:cmnd
  let i = 1
  while (i <= bufnr("$"))
    if bufexists(i)
      execute "buffer" i
      execute cmnd
    endif
    let i = i+1
  endwhile
endfun

":call AllBuffers("%s/foo/bar/ge|update")

在命令模式执行:
:call AllBuffers("%s/string1/string2/g")
Avatar_small
Angluca 说:
2010年2月09日 22:43

不错呀,以前替换所有文件的时候,刚好就缺这个,受教了。~囧

Avatar_small
run 3 说:
2020年4月14日 14:41

It is wonderful to be here with everyone, I have a lot of knowledge from what you share, to say thank you, the information and knowledge here helps me a lot

Avatar_small
happy wheels 说:
2020年4月14日 14:42

Your feedback helps me a lot, A very meaningful event, I hope everything will go well

Avatar_small
Bihar Board Model Pa 说:
2022年9月13日 16:33

Bihar State Vidyalay Pariksha Samiti, Patna Board and others have designed and suggested the State Elementary Level Primary Education Class 2nd Grade study & learning material as Bihar Board 2nd Class Model Paper 2023 with Mock Test and Practice Questions for Term1 & Term 2 Exams of the Course. Bihar Board Model Paper Class 2 All Regional Students of Bihar can download the BSEB STD-2 Question Paper 2023 Pdf to All Languages and Subjects for SCERT & NCERT Syllabus students of Hindi Medium, English Medium and Urdu Medium Students Studding in Government & Private Schools of the State & Central Board.

Avatar_small
wordle hint 说:
2022年9月16日 11:33

Your comments are very helpful, thank you very much.

Avatar_small
jacksmith 说:
2023年5月15日 17:32

So happy to be here and playing the game I love.

Avatar_small
CBSE 10th Sanple Pa 说:
2023年8月23日 17:55

Students who have Completed their Preparation can Start Practicing the CBSE 10th Class Guess Paper 2024. we Suggest the Students Solved Question Paper for Practice Purpose, in fact by Practicing Question Paper Students can get the brief idea about the Public Examination 2024.CBSE Examination will be Conducted in both Hindi and English Medium. we Request the Students to Check their CBSE 10th Sanple Paper 2024 Class Exam 2024 Date and Start their Preparation by Downloading the CBSE 10th Class Previous Paper Pdf. Actually, don’t Forget to refer the important Questions Subject Wise 2024 in order to get good marks in All the Subjects.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter