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 >
jpeters Offline





Group: Members
Posts: 804
Joined: April 2006
Posted: Dec. 10 2007,08:11 QUOTE

Using Vim has saved me endless hours recently (writing a testing program with lots of repetitous entering of data into arrays). One of the features that really came in handy was block visual mode (in 7.1) <control-v>.  For example, highlight a column in specified rows (e.g., "45 <down arrow>", and change them (e.g., "r somekey").  

Recording repetitious keystrokes was also a blessing.  Start recording with "q somekey" and end with "q".  Repeat with "n @ somekey", where 'n' is number of repetitions and 'somekey' is the buffer you initially chose.   Other very helpful features:

1. Search and replace  (example:     :467,695 s/old/replace/ )
2. Set markers:  (example: "mc") and return to marked line (example 'c )
3. Being able to specify repetition of any operation by putting a number in front (e.g. , "3yy" "45p" pastes 3 lines 45 times)
4.  The ability to abandon the mouse completely.  A mouse is great for a two minute task, but using the keyboard is much quicker. Vim has key assignments for everything.
Back to top
Profile PM 
lucky13 Offline





Group: Members
Posts: 1478
Joined: Feb. 2007
Posted: Dec. 11 2007,00:21 QUOTE

jpeters, I don't know if you saw my question in the Nov testing thread. I wanted to know if your extension is patched or the plain 7.1 sources. I'd already compiled 7.1-unpatched on my hard drive install with the intention of copying the patches from my FreeBSD ports directory and recompiling when I saw your extension had been submitted.

In addition to the things you mentioned, I like how easy it is to work on larger files with folding.
http://www.linux.com/articles/114138

Here's one of my fave "cheatsheets":
http://www.rayninfo.co.uk/vimtips.html

One of the cool things about vim is that it can be extended and scripted to handle a variety of tasks. One of my favorites from vimscripts is potwiki, a personal plaintext wiki (which is easy to convert to whichever markup language):
http://www.vim.org/scripts/script.php?script_id=1018

I've also used vimpress (WordPress blogging tool script) but I'm too addicted to using DeepestSender for my blogging.
http://www.vim.org/scripts/script.php?script_id=1953

(and just for fun... try
:help holy-grail
:help!
)


--------------
"It felt kind of like having a pitbull terrier on my rear end."
-- meo (copyright(c)2008, all rights reserved)
Back to top
Profile PM WEB 
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: Dec. 11 2007,02:28 QUOTE

Quote
Here's one of my fave "cheatsheets":
http://www.rayninfo.co.uk/vimtips.html
a lot of stuff to digest there. Thanks.

One thing I find appealing about projects that are as ubiquitous as Vim is that they sometimes have their own official documentation domain:
http://vimdoc.sourceforge.net/

Quote
One of the features that really came in handy was block visual mode (in 7.1)
It's also available in 6.x, although I'm not certain it's in DSL's version (many features are disabled to save space). In visual mode I've found that inserting text requires Shift+i rather than just i. I'm not sure why this is, except maybe just using i will switch to regular insert mode.


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





Group: Members
Posts: 1478
Joined: Feb. 2007
Posted: Dec. 11 2007,03:55 QUOTE

Quote
One thing I find appealing about projects that are as ubiquitous as Vim is that they sometimes have their own official documentation domain

I see one of the links is this:
http://www.moolenaar.net/habits.html

I came across his video presentation of that on Google/youtube a few months ago if anyone's interested. It's 80 minutes.
http://youtube.com/watch?v=eX9m3g5J-XA


--------------
"It felt kind of like having a pitbull terrier on my rear end."
-- meo (copyright(c)2008, all rights reserved)
Back to top
Profile PM WEB 
jpeters Offline





Group: Members
Posts: 804
Joined: April 2006
Posted: Dec. 11 2007,06:30 QUOTE

Quote (lucky13 @ Dec. 10 2007,19:21)
jpeters, I don't know if you saw my question in the Nov testing thread. I wanted to know if your extension is patched or the plain 7.1 sources.

vim_7.1.unc was compiled from source.  Sorry, I didn't see your question.  I'm completely burned out right now completing a testing program in TCLTK, so will check out your links later.

Quote
In visual mode I've found that in    serting text requires Shift+i rather than just i. I'm not sure why this is, except maybe just using i will switch to regular insert mode


'Insert' isn't used with visual mode, so you're just switching out of visual mode into regular command mode. You can do the same thing by just hitting "v" again. Visual mode is for blocking out text for cut & paste, replace functions, etc.
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