Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设我想在文件的一部分中找到单词“asd”的出现次数,例如,从第 21 行到第 234 行。我将如何在 VIM 中做到这一点?
试试这个计数 :21,234s/asd//gn
:21,234s/asd//gn
编辑
既然你的 vim 太老了,试试 greping 和 count like
sed -n 21,234p filename | grep -o asd | wc -l