开发者

Vim, vimgrep, and file caching

开发者 https://www.devze.com 2022-12-22 15:45 出处:网络
My entire source code base is < 20MB. I want it all loaded in memory in the background. So that when I do vimgrep **/*.cpp **/*.cxx **/*.hpp , it doesn\'t ahve to 开发者_开发技巧do file IO since vi

My entire source code base is < 20MB. I want it all loaded in memory in the background. So that when I do vimgrep **/*.cpp **/*.cxx **/*.hpp , it doesn't ahve to 开发者_开发技巧do file IO since vim has loaded all the files into memory already.

How can I achieve this?

Thakns!


If a file is already loaded into a buffer when you do :vimgrep then vim will search the buffer instead of the file on disk, so you could start vim with all the files on the command line:

$ vim *.cpp *.cxx *.hpp
... vim loads...
:vimgrep /stuff/ *.cpp *.hpp


copy your files to a ramfs partition (volatile) and do your thing there. and don't forget to copy the processed files back to a non-volatile partition

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号