English 中文(简体)
如何在Vim一度将案卷中的所有具体字句从上到下级?
原标题:How to change all specified words in a file from upper to lower case at once in Vim?
  • 时间:2012-04-17 22:08:39
  •  标签:
  • vim

我有案卷,我多次在上案件中写了同样的措辞。 我的大麻一劳永逸地从上到下几句,但后来的几句除外。 这是可能的吗? 我在这里和那里发现了一些暗淡之处,但是在所有这一切中,都需要将 cur子放在 word子上。

问题回答
:%s/.@<!<THEWORD>/theword/g

将“THEWORD和“>theword”改为有关实际字数的适当分类等值。

:%s/.*/L&/g

Of course it must be proper regular expression. This one takes all(.*), the rest is up to you.

详情如下:

:1,$s/([^.]ss*)MYWORD/1myword/g

这将用我的言辞取代所有MYWORD,除非它有一个或一个以上的空间。 这不会在一线开始时改变MYWORD。 对这些人来说,你可以连任:

:1,$s/^MYWORD/myword/




相关问题
Autoupdate VIM Plugins?

Is it possible to update vim plugins automatically?

how to unindent in vim without leaving edit mode?

I m writing a lot of python code recently, and i used the tab-to-space mode in vim. I was just wondering how would i unindent in vim without leaving edit mode for example after i finished if...: block....

Scrolling inside Vim in Mac s Terminal

I ve been googling around trying to figure out if it s possible to use my mouse wheel to scroll while inside Vim in Mac s Terminal, with no luck. It seems as if only X11 or iTerm support this. Before ...

Vim - Deleting XML Comments

How do I delete comments in XML? If the opening and the closing comment tags are on the same line, I use :g/^<!--.*-->$/d to delete the comment. How to delete the comments that are spread ...

Limiting a match in vim to certain filetypes?

I have the following in my .vimrc to highlight lines longer than 80 chars: highlight OverLength ctermbg=red ctermfg=white guibg=#592929 match OverLength /\%81v.*/ This works quite well. However, the ...

Profiling Vim startup time

I’ve got a lot of plugins enabled when using Vim – I have collected plugins over the years. I’m a bit fed up with how long Vim takes to start now, so I’d like to profile its startup and see which of ...

热门标签