我在windows机器上使用了python-mode
的插件gVim
。在
我的vimrc
文件中有以下python-mode
特定设置:
"------------------------------------------------------------
" settings for Python-mode
" "-----------------------------------------------------------
map <Leader>g :call RopeGotoDefinition()<CR>
let ropevim_enable_shortcuts = 1
let g:pymode_rope_goto_def_newwin = "vnew"
let g:pymode_rope_extended_complete = 1
let g:pymode_breakpoint = 0
let g:pymode_syntax = 1
let g:pymode_syntax_builtin_objs = 0
let g:pymode_syntax_builtin_funcs = 0
map <Leader>b Oimport ipdb; ipdb.set_trace() # BREAKPOINT<C-c>
"Better navigating through omnicomplete option list
set completeopt=longest,menuone
function! OmniPopup(action)
if pumvisible()
if a:action == 'j'
return "\<C-N>"
elseif a:action == 'k'
return "\<C-P>"
endif
endif
return a:action
endfunction
inoremap <silent><C-j> <C-R>=OmniPopup('j')<CR>
inoremap <silent><C-k> <C-R>=OmniPopup('k')<CR>
这些都是在this tutorial中提出的。在
vimrc
在我的M:
驱动器上。在
现在,如果我打开vim(设置为在M:
驱动器中打开),然后在P:
驱动器上打开一个python文件,然后尝试保存该文件,我会得到以下错误消息:
如果我将文件pi.py
移到M:驱动器,那么一切都很好,但是肯定要在^{
我可以更改Python-mode
的设置,使其在其他驱动器的文件上工作吗?在
编辑 Python模式有以下设置,看起来很有前途:
" Additional python paths
let g:pymode_paths = []
所以在vimrc
中我添加了
让g:pymode_paths=['p:\Comp Apps\Python\']
但是如果我从那个位置打开一个.py文件,我会得到同样的错误消息。在
如果我执行
:lcd %:p:h
,那么python模式插件似乎可以工作了。我也可以在我的vimrc
中使用set autochdir
:不确定使用此设置是否有任何缺点。在相关问题 更多 >
编程相关推荐