Monday, February 20, 2017

Re: Developing a simple vim script:Program-test-tune-loop?

A few tips to get you started...

(0) Read `:h usr_41.txt`.

(1) Vimscript autocompletion is available (see `:h i_CTRL-X_CTRL-V`).

(2) See `:h :@`. This command will allow you to copy a region of Vimscript into a register and then run the contents of that register (useful for quickly testing a small snippet).

(3) Put autocommands in a block like this:

augroup [GROUP NAME HERE]
autocmd!
[YOUR AUTOCOMMANDS HERE...]
augroup END

This will allow you to source the same script (with ":so %") after writing it. All of the commands will be deleted and then created again fresh.

(4) Declare functions with :function! instead of :function. This will force the re-definition of the function whenever the script is sourced again.

Happy Vimming!
Jason

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment