Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

share|improve this question
add comment

5 Answers 5

up vote 1 down vote accepted

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,./?%&#:_=+@~

share|improve this answer
add comment

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.

share|improve this answer
add comment

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!)

share|improve this answer
    
yes, your answer is correct too. –  theTuxRacer Oct 28 '10 at 13:42
add comment

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

share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.