[Tutor] vim as a python editor

2010-12-15 Thread Paul Griffiths
Hi - I'm a beginner at programming and Python.

I have been looking for an editor to replace Idle and tried out a few.
I liked Geany but decided on vim because I am also learning Linux
and the vim skills might be useful.  I run Python 2.6.5 on Ubuntu 10.04.

How have those of you who use vim configured it?  I have looked
on the web but got a bit confused by the advice and options.

I am currently following some of the advice in the on-line tutorial at
http://openbookproject.net/thinkcs/python/english2e/app_c.html and

- installed the full version of vim (sudo apt-get install vim-gnome)
- created a .vimrc file in my home directory and entered
syntax enable
filetype indent on
set et
set sw=4
set smarttab
map  :w\|!python %

- added the following to .bashrc:
EDITOR=vim
export EDITOR

I open up a terminal in the folder where I keep my python files and
create two additional tabs in this terminal.  I use the first tab to
run python, the second one to run vim and the third one for running
linux commands such as ls to list the folder contents.

Is this is a reasonable approach?  Thank you for any feed back.


PaulG
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] vim as a python editor

2011-01-07 Thread Paul Griffiths
On 5 January 2011 11:54, Sean Carolan  wrote:

> > How have those of you who use vim configured it?  I have looked
> > on the web but got a bit confused by the advice and options.
>
> My setup includes:
>
> autoindent turned on at 4 spaces
> ftplugin for "folding" functions like eclipse (this is my favorite!
> you just push f to expand a function)
> minibufexplorer for opening multiple files
> taglist for jumping around your code to different functions (needs
> exuberant ctags)
>
> Here are some instructions for setting most of these up:
>
> http://dancingpenguinsoflight.com/2009/02/python-and-vim-make-your-own-ide/
>

Thank you Sean for the above link, and to everyone else who replied.  There
is obviously a lot that can be done with vim, but I will take your advice
and build up these skills gradually and try to concentrate on learning
python!

I've learned that:

- gvim may suit me better than vim
- a tabbed console is not as good as having a separate window for vim, the
python interpreter and the shell. (thank you Alan)
- re-configuring the Caps Lock to be an extra Esc saves time
- I must learn how to  'fold' functions
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Tutor Digest, Vol 83, Issue 22

2011-01-07 Thread Paul Griffiths
Date: Fri, 7 Jan 2011 21:25:08 -

> From: "Alan Gauld" 
> To: tutor@python.org
> Subject: Re: [Tutor] vim as a python editor
> Message-ID: 
> Content-Type: text/plain; format=flowed; charset="iso-8859-1";
>reply-type=original
>
> "Paul Griffiths"  wrote
>
> > I've learned that:
> > ...
> > - re-configuring the Caps Lock to be an extra Esc saves time
>
> Huh? How do you use that? Its a new one on me. Why would
> two escape keys be useful?
>

I can touch type, and find the 'proper' Esc key is too far away for my
little finger to reach comfortably.
The Caps Lock key is easier to reach.


>
> > - I must learn how to  'fold' functions
>
> Read the vim help.
>
> Also read about ctags - they work with python code too.
> Combining ctags with vim gives you some very powerful
> navigation tools - ie put the cursor on a function name and
> hit the tags key to go directly to the function definition.
> Even if it's in another file...
>
> HTH,
>
> yes, thanks for that


> --
> Alan Gauld
> Author of the Learn to Program web site
> http://www.alan-g.me.uk/
>
>
>
>
> --
>
> ___
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>
>
> End of Tutor Digest, Vol 83, Issue 22
> *
>
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] vim as a python editor

2011-02-08 Thread Paul Griffiths
On 8 February 2011 04:44, Alexander Fairley wrote:

> Some high profile ruby hackers have put together a pretty snazzy set of
> vim/gvim configs together on github at
>
> https://github.com/carlhuda/janus
>
>
Thank you, but I think this only works on OSX?  I use Ubuntu and if I
understand your link correctly, gvim has the equivalent functionality.



> On the topic of configuring Capslock to be an escape key, it's because
> that's where the "meta" key used to be on old school unix keyboards, and so
> it makes you double plus unix if you reconfigure things that way(also has
> the plus of rendering emacs a lot more usable).
>


Sorry, I don't know what 'meta' key and 'double plus' means.   What I've now
done, using Preferences > Keyboard, is to swap the functionality of the Esc
and Caps Lock keys.  This helps me because I'm a fairly competent touch
typist.  Every time I need to press Esc on a default keyboard, I have to
lift my left hand from the asdf home keys to get at it.  This 'breaks the
flow' and gets quite annoying after a while.


>
> On Fri, Jan 7, 2011 at 7:22 PM, Steven D'Aprano wrote:
>
>> Alan Gauld wrote:
>>
>>> "Paul Griffiths"  wrote
>>>
>>>> I've learned that:
>>>> ...
>>>>
>>>> - re-configuring the Caps Lock to be an extra Esc saves time
>>>>
>>>
>>> Huh? How do you use that? Its a new one on me. Why would two escape keys
>>> be useful?
>>>
>>
>> What if you want to escape the escape, so that (say) esc-C is the same as
>> just C?
>>
>>
>> Not-very-helpfully y'rs,
>>
>> --
>> Steven
>>
>>
>> ___
>> Tutor maillist  -  Tutor@python.org
>> To unsubscribe or change subscription options:
>> http://mail.python.org/mailman/listinfo/tutor
>>
>
>
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor