忽略屏幕较少内的行号选择 [英] To ignore linenumber's selection in Less inside Screen
问题描述
我想为Screen开发一个选择工具,该工具忽略选择中的前导空格和数字.
I would like to develop a selection-tool for Screen which ignores the leading spaces and numbers in selection.
问题
- 什么会影响屏幕中选择工具
C-a Esc
的代码? - 要使算法从选择开始就忽略行号和空格:
替代文本http://files.getdropbox.com/u/175564/%20selection-less.png
以下Perl-regex似乎与行首匹配
The following Perl-regex seems to match the beginning of the line
{5}[1-9]{1-4} {8} # not tested
选择工具显然可以通过将选择的增加与当前选择串联在一起来工作.例如,选择了一行.我选择另一个:将新行添加到选择队列.反之亦然,以减少选择.
The selection tool apparently works by concatenating an increase in selection to the current selection. For instance, one line is selected. I select another one: a new line is added to the selection queue. The reverse is true also for a decrease in selection.
我想把Perl的正则表达式上,当所述选择obverses
I want to put the Perl regex on when the selection obverses \n
such that the ignorance of the line is considered.
推荐答案
我认为您想选择列.这比正则表达式要容易得多.
I think you want to select columns. That'd be much easier than a regex.
在屏幕联机帮助页中:
c or C to set the left or right margin respectively. If no
repeat count is given, both default to the current
cursor position.
Example: Try this on a rather full text screen: "C-a [
M 20 l SPACE c 10 l 5 j C SPACE".
This moves one to the middle line of the screen, moves
in 20 columns left, marks the beginning of the paste
buffer, sets the left column, moves 5 columns down, sets
the right column, and then marks the end of the paste
buffer. Now try:
"C-a [ M 20 l SPACE 10 l 5 j SPACE"
and notice the difference in the amount of text copied.
因此,在屏幕快照中,按C-a [
,将光标移动到文本的开头,按SPACE
,然后按c
.移至选择的末尾,然后再次按SPACE
.现在您有了想要的文字.
So, in your screenshot, press C-a [
, move the cursor to the beginning of your text, press SPACE
and then press c
. Move to the end of your selection and then press SPACE
again. Now you have the text you want.
希望这不是太多信息.您用初学者标记了它,所以我不确定您是Perl还是屏幕初学者.
Hope this wasn't too much info. You tagged it with beginner so I wasn't sure if you were a perl or screen beginner.
这篇关于忽略屏幕较少内的行号选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!