Some tips to get started. You can just type vimscript on the command line. (The command line being that bottom line inside of vim). You can use "source file" on the command line to pull in and run scripts.
You can use "echo" to get information. There is also "echom" which also adds the output to a list you can display using ":messages" (or :mes)
Comments are anything after a double quote (")
The "pipe" symbol separates commands, allowing several on a line (|)
To make the current line "continue" the prior line, start it with backslash (\)
Vimscript has variables, strings, lists, dictionaries, regex, functions, for loops, while loops, exception handling
:let mapleader = "-"This allows a variety of commands like the following:
" generate empty h3 :nnoremap <leader>h o<h3></h3><esc>hhhh " capitalize the current line nnoremap <leader>c :.!tr '[a-z]' '[A-Z]'<CR>The following runs an external command on the current line.
" swap bytes nnoremap <leader>t :.!./vim_swap<CR>The comma is thus far unused in vim, and can be used as a single keystroke way to do something, such as this, which calls a vimscript function "CheckAB()".
noremap , :call CheckAB()<CR>
Tom's Electronics pages / tom@mmto.org