0

I remember vaguely, that we could highlight chunks in vi. Is there anyway to do that in a console? eg: In the image, I wanted to select the numbers only, but highlighting only captures complete lines, not discontinuous chunks. I hope I am clear what I mean.

Let me know if its possible and theres a way.

Thanks.

alt text

0

5 Answers 5

1

Works for me with gnome-terminal. Open the gconf-editor:

Alt+F2 > gconf-editor

and go to

/apps/gnome-terminal/profiles/Default

The key word_chars should have the value -A-Za-z0-9,./?%&#:_=+@~

1

I'm not 100% sure if you're asking about doing this in vi or from some other terminal input. If you're talking about some terminal input, well I'd say just pipe it to vi or write to a file you open in vi.

As for highlighting a column in vi I have a screencast episode that covers it. It's called visual select mode and you can do column visual select: http://lococast.net/archives/241

You basically want to use ctrl-v to start the mode and then move as you normally would to get your selection.

0

If you are using Gnome Terminal, you can make a square selection by holding down Ctrl before making the selection with your mouse.

Not sure if that is what you mean though... (Your question isn't very clear!)

1
  • yes, your answer is correct too. Oct 28, 2010 at 13:42
0

use ctrl to select a block. use shift to change that block size.

0

If you want to use the full power of vim then you can pipe output into vim.

$ ./ascript.sh | vim -

The output will appear in vim and you can use the full power of vim to do what you will. To select a block as you say above, you can move to a corner of your block of numbers and do Ctrl+V to start "visual block mode". Select the block, and then to copy it to the X clipboard you can do

  • "*p to copy to the X11 clipboard - use the middle mouse button to paste elsewhere
  • "+p to copy to the standard clipboard - use Ctrl+V to paste elsewhere

Of course if it is a one time command that is already on the terminal then this isn't an option, but I've found these techniques useful along the way, so hopefully other readers of this question also will.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .