[已解决]vim的:%!xxd中的%是什么意思?

Vim、Emacs配置和使用
回复
烟波钓叟
帖子: 112
注册时间: 2015-04-04 23:20
系统: linux & windows

Re: vim的:%!xxd中的%是什么意思?

#2

帖子 烟波钓叟 » 2016-12-16 15:47

应该是所有行、整个文本的意思。

代码: 全选

:%d
'%'代表所有行。删除整个文本。

代码: 全选

:1d
删除第一行。

代码: 全选

:1,.d
'.'代表当前行。把第一行到当前行删除。

代码: 全选

:.,$d
'$'代表最后一行。把当前行到最后一行删除。
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: vim的:%!xxd中的%是什么意思?

#3

帖子 poloshiao » 2016-12-16 16:50

http://blog.vgod.tw/2009/12/08/vim-chea ... ogrammers/
給程式設計師的 Vim 入門圖解說明

段落(paragraph)、區塊(block)
% 跳到目前對應的括號上(適用各種括號,有設定好的話連 HTML tag 都能跳)
onlylove
论坛版主
帖子: 5213
注册时间: 2007-01-14 16:23

Re: vim的:%!xxd中的%是什么意思?

#4

帖子 onlylove » 2016-12-16 20:22

看在你认真学习的份上
请在vim 里面输入 :help %
科学之子
帖子: 2284
注册时间: 2013-05-26 6:58
系统: Debian 9

Re: vim的:%!xxd中的%是什么意思?

#5

帖子 科学之子 » 2016-12-16 21:36

onlylove 写了:看在你认真学习的份上
请在vim 里面输入 :help %
感谢回复,不过貌似没有描述"匹配全部行"

代码: 全选

*%*
%			Find the next item in this line after or under the
			cursor and jump to its match. |inclusive| motion.
			Items can be:
			([{}])		parenthesis or (curly/square) brackets
					(this can be changed with the
					'matchpairs' option)
			/* */		start or end of C-style comment
			#if, #ifdef, #else, #elif, #endif
					C preprocessor conditionals (when the
					cursor is on the # or no ([{
					following)
			For other items the matchit plugin can be used, see
			|matchit-install|.  This plugin also helps to skip
			matches in comments.

			When 'cpoptions' contains "M" |cpo-M| backslashes
			before parens and braces are ignored.  Without "M" the
			number of backslashes matters: an even number doesn't
			match with an odd number.  Thus in "( \) )" and "\( (
			\)" the first and last parenthesis match.

			When the '%' character is not present in 'cpoptions'
			|cpo-%|, parens and braces inside double quotes are
			ignored, unless the number of parens/braces in a line
			is uneven and this line and the previous one does not
			end in a backslash.  '(', '{', '[', ']', '}' and ')'
			are also ignored (parens and braces inside single
			quotes).  Note that this works fine for C, but not for
			Perl, where single quotes are used for strings.

			Nothing special is done for matches in comments.  You
			can either use the matchit plugin |matchit-install| or
			put quotes around matches.

			No count is allowed, {count}% jumps to a line {count}
			percentage down the file |N%|.  Using '%' on
			#if/#else/#endif makes the movement linewise.
回复