From 7c7da5bcd494d7a53b40952232a889f59c4dfbf2 Mon Sep 17 00:00:00 2001 From: Stefan Huber Date: Mon, 23 Jun 2008 14:33:24 +0100 Subject: [PATCH] only load python in vimrc when opening c,cpp files --- INSTALL.txt | 19 +++++++++---------- pygdb.vim | 9 ++++++++- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/INSTALL.txt b/INSTALL.txt index b48a265..a7dd531 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -2,19 +2,18 @@ 1. Put the pygdb directory to somewhere, lets call it in this help file. 2. Add the following lines into your ~/.vimrc: - python << >> - import sys + """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + " pygdb + """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + + autocmd Filetype c,cpp :python import sys + autocmd Filetype c,cpp :python sys.path.append("") + autocmd Filetype c,cpp source /pygdb.vim + autocmd Filetype c,cpp call GDBMapDefaults() - #Do not use a ~ for home directory - pygdbdir = "" - sys.path.append(pygdbdir) - >> - - autocmd Filetype c,cpp source /pygdb.vim - autocmd Filetype c,cpp call GDBMapDefaults() where you replace by the corresponding path of pygdb. You may want to - add to the environment variable PATH such that you cou can call pygdb + add to the environment variable PATH such that you can call pygdb from console directly. If you like, you can add the following line. It leads to a configuration file diff --git a/pygdb.vim b/pygdb.vim index 7a8b89f..642b327 100644 --- a/pygdb.vim +++ b/pygdb.vim @@ -1,4 +1,11 @@ -"shuber, 2008-06-08 +"pygdb.vim - pygtk interface to gdb in connection with (g)vim +" Maintainer: Stefan Huber + + +if !has('python') + echo "Error: Required vim compiled with +python" + finish +endif if ! exists("g:pygdb") -- 2.30.2