The best advice I can give is that you read:
:help usr_41.txt
which will give you a good overview of the basics. Then find some things that you want to do and create functions for them. While you're doing this, make heavy use of:
:help function-list
to get an idea of what all the built in functions are. Most of it is fairly similar to other scripting languages (albeit a harsher syntax), so any experience you have of text manipulation in python or whatever will be useful.
Also, look on the vim scripts page and Google to get examples of existing scripts to help expand your knowledge.
Finally (and probably most importantly), don't be afraid to ask on stackoverflow or the Vim mailing list and there'll be plenty of support for any problems you may have.
Learn Vimscript the Hard Way is worth checking out too.
http://learnvimscriptthehardway.stevelosh.com/
I'm in a similar situation. It's still on my "to read" list, but I just found Scripting the Vim editor today. The articles from IBM's DeveloperWorks are usually very good, so probably worth checking out.
Al gave you a good answer. I'd also add vim.wikia that has a few tips related to your question.
On a side note.
I wouldn't say that ma10jd'a20kp
is more elegant. I see the following problems:
:normal!
),<esc>
when the cursor is on the first column), If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With