Not开发者_JAVA技巧 looking for the help file, more for the motivation why would one use these commands?
I don't recall ever using :list
in over a dozen years of Vim use.
:print
I use often in this form:
:g/re/p
Where re
is a regular expression. Handy for seeing where a string appears in a file without having to move through it.
:list
looks neat, though. Perhaps I should :s/p/l/
in the previous command. :-)
I use :print
occasionally when I want to print only a chunk of code. If you have a block of text being visually selected, the command will operate only on what is selected.
The :list
command does the same thing, but makes an effort to output things like control characters in a more readable fashion.
I think those are simply old Ex commands, originating from the original vi. It’s useful if you use Ex mode often (see :help Ex-mode
). But I use them very seldom.
精彩评论