Skip to content

Commit 4327fdf

Browse files
committed
Add 'g:pymode_paths'.
1 parent 9956aba commit 4327fdf

File tree

4 files changed

+19
-1
lines changed

4 files changed

+19
-1
lines changed

Changelog.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Changelog
22
=========
33

4+
* Add 'pymode_paths' option
5+
46
## 2012-04-18 0.6.3
57
-------------------
68
* Fix pydocs integration

README.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,9 @@ Other stuff
263263

264264
Default values: ::
265265

266+
" Additional python paths
267+
let g:pymode_paths = []
268+
266269
" Load breakpoints plugin
267270
let g:pymode_breakpoint = 1
268271

doc/pymode.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ to install the pylint or rope library on your system.
4343
The script provides the following options that can customise the behaviour the
4444
PythonMode. These options should be set in your vimrc.
4545

46+
|'pymode_paths'| Additional python paths for pymode
47+
4648
|'pymode_doc'| Turns off the documentation script
4749

4850
|'pymode_doc_key'| Key for show documentation
@@ -116,6 +118,13 @@ PythonMode. These options should be set in your vimrc.
116118
To enable any of the below options you should put the given line in your
117119
'$HOME/.vimrc'. See |vimrc-intro|.
118120

121+
------------------------------------------------------------------------------
122+
*'pymode_paths'*
123+
Values: List of strings
124+
Default: [].
125+
126+
This option set additional python import paths
127+
119128
------------------------------------------------------------------------------
120129
*'pymode_doc'*
121130
Values: 0 or 1.

plugin/pymode.vim

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,19 @@ endif
3636

3737
" DESC: Fix python path
3838
if !pymode#Default('g:pymode_path', 1) || g:pymode_path
39+
40+
call pymode#Default('g:pymode_paths', [])
41+
3942
python << EOF
4043
import sys, vim, os
4144

4245
curpath = vim.eval("getcwd()")
4346
libpath = os.path.join(os.path.dirname(os.path.dirname(
4447
vim.eval("expand('<sfile>:p')"))), 'pylibs')
4548

46-
sys.path = [libpath, curpath] + sys.path
49+
sys.path = [libpath, curpath] + vim.eval("g:pymode_paths") + sys.path
4750
EOF
51+
4852
endif
4953

5054

0 commit comments

Comments
 (0)