[Tutor] Vim scripting using Python? (Was "Re: Really Newbie!")

Andrei Kulakov ak@silmarill.org
Mon, 26 Nov 2001 17:01:20 -0500


On Mon, Nov 26, 2001 at 01:48:01PM -0500, dman wrote:
> On Mon, Nov 26, 2001 at 05:22:41PM +0100, programer@iquebec.com wrote:
> | At 01:34 26/11/01 -0500, Andrei wrote:
> | >The 2 most popular editors are vim (www.vim.org) and emacs (emacs.org).
> | >I personally prefer vim, which is incidentally is also scriptable in
> | >python, unlike emacs. However, both are rather complex, so if you don't
> | >figure them out right away, you should probably use one of those
> | >slightly souped-up editors like notepad+ or ultraedit.. They're almost
> | >as simple as notepad but give you extra niceties like syntax
> | >highlighting, etc.
> |
> | I know Vim, but I didn't know that it should be driven through
> | Python-scripts.
> | 
> | May you give some URL about it, please?
> 
> :help python
> 
> vim must have been compiled with python support enabled.  It can also
> be scripted using perl, ruby, or tcl.

In addition: in debian, you have a package vim-python, although you might want
to get vim6, with folds and special support for python indenting style (put
this in your vimrc):

augroup Python
    au!
    au BufNewFile *.py 0read ~/.templates/python.py
    " see also :help smartindent , cinwords
    au FileType python set autoindent smartindent sts=4 sw=4 tw=80 fo=croq

    " turn off the C preprocessor indenting
    " (allow comments in Python to be indented properly)
    au FileType python inoremap # X^H#
    au FileType python set foldenable
augroup END


> 
> See 
> 
> :version
> 
> Look for "+python".  If you see "-python" then your copy was compiled
> without python support.
> 
> 
> -D
> 
> (wow, the sigs are just a list of strings in a python script, and one
> is chosen using randmon.choice().  In the last several messages I've
> posted the sigs are actually related to the message)
> 
> -- 
> 
> (E)ighteen (M)egs (A)nd (C)onstantly (S)wapping
> 
> 
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor

-- 
Cymbaline: intelligent learning mp3 player - python, linux, console.
get it at: cy.silmarill.org