Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
Pages: (6) </ 1 [2] 3 4 5 6 >/

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: Vim tips< Next Oldest | Next Newest >
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: Dec. 11 2007,14:06 QUOTE

Quote
'Insert' isn't used with visual mode, so you're just switching out of visual mode into regular command mode.
I think you may have misunderstood me. I wasn't speculating whether or not insert mode can be used with visual block, because I know it can be.

Press Ctrl+v
Highlight a vertical line
Press Shift+i
Type something (it will first appear on only one line)
Press Esc

After thinking about it, it seems the Shift would be necessary to distinguish between inserting in block mode and switching out.


--------------
http://www.tldp.org/LDP/intro-linux/html/index.html
Back to top
Profile PM WEB 
jpeters Offline





Group: Members
Posts: 804
Joined: April 2006
Posted: Dec. 11 2007,15:26 QUOTE

Quote (mikshaw @ Dec. 11 2007,09:06)
Quote
'Insert' isn't used with visual mode, so you're just switching out of visual mode into regular command mode.
I think you may have misunderstood me. I wasn't speculating whether or not insert mode can be used with visual block, because I know it can be.

I guess I don't  :)

<shift-i> takes you out of visual mode and into regular insert command mode. To get back to block visual mode, you'd have to <exc> out of insert and then <ctr v> again. (at least that's the way it works in 7.1)
Back to top
Profile PM 
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: Dec. 11 2007,21:25 QUOTE

I don't know about 7.1; I'm still using 6.3
As it appears to me, the above series of commands does indeed take you out of visual block mode as you said, but not before inserting the typed text on every line that was marked with the visual block.


--------------
http://www.tldp.org/LDP/intro-linux/html/index.html
Back to top
Profile PM WEB 
jpeters Offline





Group: Members
Posts: 804
Joined: April 2006
Posted: Dec. 11 2007,23:38 QUOTE

Quote (mikshaw @ Dec. 11 2007,16:25)
I don't know about 7.1; I'm still using 6.3
As it appears to me, the above series of commands does indeed take you out of visual block mode as you said, but not before inserting the typed text on every line that was marked with the visual block.

Hey....that works!   Although the highlighting goes off and and shifts out of visual mode, the esc key indeed writes to the previously highlighted column.  That's very cool....Thanks for finding that little gem!  Having the visual mode is much faster that using the automated key function, with the added advantage that you don't have to know the exact number of lines to repeat  (because you can see and adjust the highlighted column before running the task).

(BTW....I'm not sure how you found that trick....you're not reading the manual, are you? )  
:)

Edit: That certainly was a timely tip; saved me at least an hour this evening!!
Back to top
Profile PM 
jpeters Offline





Group: Members
Posts: 804
Joined: April 2006
Posted: Dec. 12 2007,06:23 QUOTE

Quote (mikshaw @ Dec. 10 2007,21:28)
Quote
Here's one of my fave "cheatsheets":
http://www.rayninfo.co.uk/vimtips.html
a lot of stuff to digest there.

I'm also going through it.  First thing I spotted:

" :'a,'bg/fred/s/dick/joe/igc  VERY USEFUL "

Very cryptic  :)

I like the 'fold' feature, which saves opening up several copies and getting a lot of .swp files, etc..   Thanks for the links!
Back to top
Profile PM 
27 replies since Dec. 10 2007,08:11 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

Pages: (6) </ 1 [2] 3 4 5 6 >/
reply to topic new topic new poll
Quick Reply: Vim tips

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code