![]() |
ubuntu.com - launchpad.net - ubuntu help
|
|
|||||||
Hello, Unregistered You are browsing a READ only archive of the main support categories pre 4/21/2008. You will not be able to post or reply any threads in this section.
Ubuntu 9.10 is out!!!
When downloading Ubuntu 9.10 please consider using bittorrent to get your copy of Ubuntu. The Ubuntu Developers Summit for Lucid Lynx will be held the week of 16-Nov-2009 till 20-Nov-2009 in Dallas, TX USA. Visit the the Ubuntu wiki for more information about UDS and how to participate remotely. |
|
General Help All your general support questions for Ubuntu, Kubuntu, Edubuntu and Xubuntu. |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
100% Pure Ubuntu
![]() Join Date: Oct 2005
Location: @ /home
Beans: 884
Ubuntu Karmic Koala (testing)
|
enabling indentation in VIM when using python
When I open a python file with vim and start coding it does not indent code after the colon ":". I have installed vim-python. Anyone knows how to do it?
|
|
|
|
|
|
#2 |
|
Dipped in Ubuntu
![]() Join Date: Jan 2005
Location: Sweden
Beans: 586
|
Re: enabling indentation in VIM when using python
vim-python is useful for actually scripting vim itself using Python, just so you know. To enable automatic indenting in vim/gvim, some features must be enabled in your personal configuration file. There are lots of different sorts of indenting in vim, but I prefer to use autoindent and smartindent. The filetype must be set too - this happens automatically if you launch (g)vim with a *.py file as argument or you can set it using :set filetype=python.
Here is my current ~/.vimrc for reference: Code:
set nocompatible syntax on set background=light set showmatch set ignorecase set showmode set ts=4 set sw=4 set autoindent set smartindent " Mappings nmap <C-N> :noh <CR> Since I want the same settings for gvim, I source my .vimrc in my ~/.gvimrc: Code:
so ~/.vimrc " Grab the console vim settings colo buttercream set guifont=Bitstream\ Vera\ Sans\ Mono\ 9 Håkan |
|
|
|
|
|
#3 |
|
100% Pure Ubuntu
![]() Join Date: Oct 2005
Location: @ /home
Beans: 884
Ubuntu Karmic Koala (testing)
|
Re: enabling indentation in VIM when using python
Thanks hw-tph,
|
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|