Notes about my editor of choice.
I am very proud of my first vim plugin: sphinx.vim
For now, only creating and changing headings is mapped on the F1-F6 keys. More will follow.
Normally the following snippet would suffice:
fun! Vimfun()
python pyfun()
endfun
But if you want to pass parameters, you’ll need something like this (please correct me if I’m wrong).
fun! Vimfun(x)
python import vim
python f(vim.eval(str('a:x')))
endfun
python << EOF
def f(x):
print x
EOF
" run it
call Vimfun('Hello!')
See also: :help usr_28. Set folding for XML (in .vimrc):
" XML syntax folding
let g:xml_syntax_folding=1
au FileType xml setlocal foldmethod=syntax
Shortcuts (from nion’s blog on 2009-03-23):
| zf | create folder |
| zd | delete folder under cursor |
| zD | delete folder recursive |
| zE | delete all folders in file |
| zo | open folder under curso |
| zO | open folder recursive |
| zc | close folder under cursor |
| zC | same as zc recursive |
| za | open folder if closed, close folder if opened |
Want easy templates? See http://www.vim.org/scripts/script.php?script_id=2540!