Soy*_*yuz 12 linux vim terminal
在使用Vim时,在可视模式下,选择文本然后调用冒号命令显示: '<,'>
而不是:
像我在做其他事情时所显示的那样(例如打开文件).
什么'<,'>
意思?
使用linux (debian)
,gnome-terminal
,vim7.2
NPE*_*NPE 27
这意味着您键入的命令:'<,'>
将对您选择的文件部分进行操作.
例如,:'<,'>d
将删除所选块,而:d
删除光标下的行.
同样,:'<,'>w fragment.txt
将所选块写入调用的文件fragment.txt
.
两个以逗号分隔的内容('<
和'>
)是与所选区域的开头和结尾相对应的标记.从帮助页面(:help '<
):
*'<* *`<*
'< `< To the first line or character of the last selected
Visual area in the current buffer. For block mode it
may also be the last character in the first line (to
be able to define the block). {not in Vi}.
*'>* *`>*
'> `> To the last line or character of the last selected
Visual area in the current buffer. For block mode it
may also be the first character of the last line (to
be able to define the block). Note that 'selection'
applies, the position may be just after the Visual
area. {not in Vi}.
Run Code Online (Sandbox Code Playgroud)
以这种方式使用时,标记只是指定后面命令的范围(请参阅参考资料:help range
).它们当然可以与其他行号说明符混合使用.例如,以下命令将删除从所选区域的开头到文件末尾的所有行:
:'<,$d