[Tutor] (no subject)

Andrei Kulakov ak@silmarill.org
Tue, 18 Sep 2001 05:04:13 -0400


On Tue, Sep 18, 2001 at 04:54:17AM -0400, Ignacio Vazquez-Abrams wrote:
> On Tue, 18 Sep 2001, Ajaya Babu wrote:
> 
> > I am using python on windows with IDLE but I want to shift to Linux
> > permanently. Can any one suggest me good editor which supports python,
> >  like giving keywords in different colour and auto indentation ).
> 
> My Editor of Choice(tm) under Linux is vim. It has syntax highlighting for
> most languages you'll use including Python, but (unfortunately?) only
> autoindents for C/C++. I use it straight from the command line, but it also
> comes with a psuedo-GUI version called gvim.

There is a way to do python auto-indenting in vim, observe:

autocmd BufNewFile,BufRead *.py set textwidth=79 expandtab smartindent
cinw=try,if,def,except,for,while,else,elif,class,finally
autocmd BufRead *.py set tabstop=4
autocmd BufRead *.py %retab

Note that 1st and 2nd line should be one line. This goes to your .vimrc,
of course.

Ajaya: vim also allows python scripting. If you're using debian, you can
get package called vim-python, which includes scripting support. Vim uses
a very unusual technique called "modal editing", it takes some time to get
used to but is faster and more powerful in the end (IMHO). There is a more
traditional editor on linux that supports python highlighting and
autoindent - EMACS (and it's flavor XEMACS).

There is a #vim channel on irc.openprojects.net - you can ask questions if
you run into problems. There's also a #python channel on that network.

- Andrei 
> 
> -- 
> Ignacio Vazquez-Abrams  <ignacio@openservices.net>
> 
> 
> _______________________________________________
> 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