You are not logged in.

#1 2008-11-28 08:41:04

jaideep_jdof
Member
From: Delhi, India
Registered: 2006-06-05
Posts: 311

vim and python settings

How do i enable python code completion in vim and if possible support for django. What command do I have to place in my vimrc and in which line.

Offline

#2 2008-11-28 09:38:42

N30N
Member
Registered: 2007-04-08
Posts: 273

Re: vim and python settings

First google result: UsingVimWithDjango.

Offline

#3 2008-12-02 11:38:44

jaideep_jdof
Member
From: Delhi, India
Registered: 2006-06-05
Posts: 311

Re: vim and python settings

Following my .vimrc file entry but the colorscheme set in the file doesn't apply in gvim:

colorscheme desert
set nocompatible
syntax on

" Omni Complete
autocmd FileType python set omnifunc=pythoncomplete#Complete
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags
autocmd FileType php set omnifunc=phpcomplete#CompletePHP
autocmd FileType c set omnifunc=ccomplete#Complete

" Python tab settings
set ai
set ts=4
set sts=4
set et
set sw=4

Offline

#4 2008-12-02 12:53:20

rson451
Member
From: Annapolis, MD USA
Registered: 2007-04-15
Posts: 1,233
Website

Re: vim and python settings

Phrakture wrote the python omni complete vim plugin.  You may want to check that out.


archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson

Offline

#5 2008-12-02 14:46:39

jaideep_jdof
Member
From: Delhi, India
Registered: 2006-06-05
Posts: 311

Re: vim and python settings

But i am not asking about the omni complete, I am asking about colorscheme not applying. I am sorry I should have started a new thread.

Following is my vimrc file contents:

colorscheme desert
set nocompatible
syntax on

" Omni Complete
autocmd FileType python set omnifunc=pythoncomplete#Complete
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags
autocmd FileType php set omnifunc=phpcomplete#CompletePHP
autocmd FileType c set omnifunc=ccomplete#Complete

" Python tab settings
set ai
set ts=4
set sts=4
set et
set sw=4

Offline

#6 2008-12-02 14:55:29

rson451
Member
From: Annapolis, MD USA
Registered: 2007-04-15
Posts: 1,233
Website

Re: vim and python settings

gvim uses .gvimrc, could it be this simple?  Or possibly desert is not a gvim color scheme.


archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson

Offline

#7 2008-12-02 15:00:29

jaideep_jdof
Member
From: Delhi, India
Registered: 2006-06-05
Posts: 311

Re: vim and python settings

Gvim has desert in its color scheme list,<colorscheme desert> the is not even working in terminal with vim, i have googled it up and the option seems to be correct.

Offline

#8 2008-12-03 04:56:46

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: vim and python settings

You don't actually need those omnifunc settings - they should be set automatically in the /usr/share scripts.

Does C-x,C-o do anything for you?

Offline

#9 2008-12-03 05:32:41

jaideep_jdof
Member
From: Delhi, India
Registered: 2006-06-05
Posts: 311

Re: vim and python settings

yes the C-x and C-o shortcuts works. So do i need these omni setting in my .vimrc. Is there a command to check whether these omni modules are active or not

Last edited by jaideep_jdof (2008-12-03 05:34:52)

Offline

#10 2008-12-03 09:29:27

Nikitka
Member
From: Zelenograd, Moscow, Russia
Registered: 2007-12-26
Posts: 11

Offline

#11 2008-12-03 12:03:59

jaideep_jdof
Member
From: Delhi, India
Registered: 2006-06-05
Posts: 311

Re: vim and python settings

I found out that gvim uses .gvimrc for configuation so do i have to place all the entries from my .vimrc to .gvimrc

Offline

#12 2008-12-03 13:02:07

DonVla
Member
From: Bonn, Germany
Registered: 2007-06-07
Posts: 997

Re: vim and python settings

just "ln -s ~/.vimrc ~/.gvimrc"

Offline

#13 2008-12-03 13:39:35

sveri80
Member
Registered: 2008-11-12
Posts: 38

Re: vim and python settings

My gvim uses the options from .vimrc correctly without a .gvimrc!

Offline

#14 2008-12-03 14:39:20

j.roszk
Member
From: Poznan/Poland
Registered: 2008-05-22
Posts: 29
Website

Re: vim and python settings

Use :scriptnames in vim and gvim to see that vim uses only .vimrc, and gvim sources both. Use .gvimrc only for gvim-specific options.

Offline

#15 2008-12-04 04:41:50

jaideep_jdof
Member
From: Delhi, India
Registered: 2006-06-05
Posts: 311

Re: vim and python settings

Thanks all of you for the inputs

Offline

Board footer

Powered by FluxBB