FAQ
I'm learning Python and I've been looking for a good IDE to use with it.
I haven't found an IDE that has text editing capabilities close to
Vim/Emacs.

Much of my previous programming is with Emacs/PHP and I love the
auto-indenting, tab-indenting, well thought-out key strokes, and the
ability to ssh into a server and run Emacs.

I'd like to try out Vim while writing Python code (I'm using Webware).
Right now, the default settings using color coding, have an 8 space tab
and no autoindenting. I would like to have a tab space of 2 or 4 spaces
and have auto-indenting.

I have no idea how to configure Vim. I'm a total newbie. Can someone
please help me get started. I'm looking to configure Vim for Python.
Autoindenting and 4 space tabs are high priority now.

Thanks,

Randall

Search Discussions

  • Karl Scalet at Apr 15, 2003 at 7:24 am
    Hi Randall,

    Randall Smith wrote:
    I'm learning Python and I've been looking for a good IDE to use with it.
    I haven't found an IDE that has text editing capabilities close to
    Vim/Emacs.

    Much of my previous programming is with Emacs/PHP and I love the
    auto-indenting, tab-indenting, well thought-out key strokes, and the
    ability to ssh into a server and run Emacs.

    I'd like to try out Vim while writing Python code (I'm using Webware).
    Right now, the default settings using color coding, have an 8 space tab
    and no autoindenting. I would like to have a tab space of 2 or 4 spaces
    and have auto-indenting.

    I have no idea how to configure Vim. I'm a total newbie. Can someone
    please help me get started. I'm looking to configure Vim for Python.
    Autoindenting and 4 space tabs are high priority now.
    looking in my vimrc file:

    set autoindent
    set tabstop=4
    set shiftwidth=4
    set expandtab

    could give you a start

    Karl
  • Gerhard Haering at Apr 15, 2003 at 8:36 am

    Karl Scalet wrote:
    Hi Randall,

    Randall Smith wrote:
    I'm learning Python and I've been looking for a good IDE to use with
    it. I haven't found an IDE that has text editing capabilities close
    to Vim/Emacs. [...]
    I have no idea how to configure Vim. I'm a total newbie. Can someone
    please help me get started. I'm looking to configure Vim for Python.
    Autoindenting and 4 space tabs are high priority now.
    looking in my vimrc file:

    set autoindent
    set tabstop=4
    set shiftwidth=4
    set expandtab

    could give you a start
    No, no, no! That's evil!

    Tabs are 8 characters wide. Period. So you want something like this instead:

    " Tabulator policy:
    " - Show existing tabs as 8 spaces
    " - Tab key/autoindent/reindent insert 4 spaces
    set ts=8 sw=4 smarttab
    set expandtab

    The full glory of my .vimrc is attached ;-)

    -- Gerhard
    -------------- next part --------------
    An embedded and charset-unspecified text was scrubbed...
    Name: .vimrc
    Url: http://mail.python.org/pipermail/python-list/attachments/20030415/ee04fe87/attachment.pot
  • Mirko Zeibig at Apr 15, 2003 at 9:26 am
    Gerhard Haering wrote:
    Hello Gerhard,
    Karl Scalet wrote:
    looking in my vimrc file:

    set autoindent
    set tabstop=4
    set shiftwidth=4
    set expandtab

    could give you a start
    No, no, no! That's evil!

    Tabs are 8 characters wide. Period.
    says who?

    Anyway, a very handy setting for vim which will display tabs:
    ---
    "show tabs, EOL etc.
    set list
    set lcs=tab:?? "show tabs
    set lcs+=trail:? "show trailing spaces

    autocmd FileType make set noexpandtab
    ---
    and to use tabs in Makefiles

    Regards
    Mirko
    --
    "Ein, zwei, drei im Sauseschritt, saust die Zeit, wir sausen mit!"
    (Busch sein Willi, und nit sein Georg)
  • Gerhard Haering at Apr 15, 2003 at 10:07 am

    Mirko Zeibig wrote:
    Gerhard Haering wrote:
    Karl Scalet wrote:
    looking in my vimrc file: [...]
    set tabstop=4
    [...]
    No, no, no! That's evil!

    Tabs are 8 characters wide. Period.
    says who?
    If the Python interpreter encounters a tab character in Python source
    code, it treats it as an equivalent of an indentation of 8 spaces.

    Not knowing about this fact will only bite you if you mix tabs and
    spaces in Python sourcecode, which is a really silly thing to do in the
    first place (and python -t will warn you about it).

    There's plenty of other software and hardware that behaves the same,
    though I'm not aware of any standard that would mandate this behaviour.

    -- Gerhard
  • Luigi monaco at Apr 15, 2003 at 7:37 am

    On Tue, 15 Apr 2003 08:58:55 +0200, Randall Smith wrote:

    I'm learning Python and I've been looking for a good IDE to use with it.
    I haven't found an IDE that has text editing capabilities close to
    Vim/Emacs.

    Much of my previous programming is with Emacs/PHP and I love the
    auto-indenting, tab-indenting, well thought-out key strokes, and the
    ability to ssh into a server and run Emacs.

    I'd like to try out Vim while writing Python code (I'm using Webware).
    Right now, the default settings using color coding, have an 8 space tab
    and no autoindenting. I would like to have a tab space of 2 or 4 spaces
    and have auto-indenting.

    I have no idea how to configure Vim. I'm a total newbie. Can someone
    please help me get started. I'm looking to configure Vim for Python.
    Autoindenting and 4 space tabs are high priority now.

    Thanks,

    Randall
    Hi Randall,

    I had the same problems when I started with 'vim'. So here some initial
    stuff to faster do some finger practices ;-)

    <ESC>set tabstop= 4<CR>
    # set tabstop to 4 space length

    <ESC>set ai<CR>
    # set autoindent

    <ESC>set noai<CR>
    # set no autoindent

    <ESC>:mkv<CR>
    # write vim configuration file to actual directory
    # copy .vimrc to you ~/ directory, so it will be used by default.

    <ESC>set nu<CR>
    # enable line numbering

    <ESC>syntax enable<CR>
    # enable syntax highlighting

    <ESC>:%s/<PATTERN>/<SUBST>/
    # to substitute <PATTERN> with <SUBST>

    <ESC>dd<CR>
    # delete actual line

    <ESC>start#,end#d<CR>
    # to delete from line# start to line# end NOTE copied to buffer

    <ESC>P
    # insert buffer above actual position

    <ESC>p
    # insert buffer below actual position

    hth

    Luigi aka zdys
  • Padraig at Apr 15, 2003 at 9:34 am

    Randall Smith wrote:
    I'm learning Python and I've been looking for a good IDE to use with it.
    I haven't found an IDE that has text editing capabilities close to
    Vim/Emacs.

    Much of my previous programming is with Emacs/PHP and I love the
    auto-indenting, tab-indenting, well thought-out key strokes, and the
    ability to ssh into a server and run Emacs.
    When learning vim myself I wrote this:
    http://www.pixelbeat.org/vim.tips

    Here's my vim settings
    http://www.pixelbeat.org/settings/.vimrc

    Note you might want to try some of the scintilla
    based editors (SciTE/anjuta/...)

    P?draig.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedApr 15, '03 at 6:58a
activeApr 15, '03 at 10:07a
posts7
users6
websitepython.org

People

Translate

site design / logo © 2022 Grokbase