DSL Tips and Tricks :: Vim tips



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.

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

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.

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

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.

Next Page...
original here.