python文件是否需要与Pythonmode插件在同一个驱动器上才能实现其功能

2024-09-30 14:38:14 发布

您现在位置:Python中文网/ 问答频道 /正文

我在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文件,然后尝试保存该文件,我会得到以下错误消息:

enter image description here

如果我将文件pi.py移到M:驱动器,那么一切都很好,但是肯定要在^{中使用文件,这不应该是一个条件,即正在编辑的文件与vim在同一个驱动器上?在

我可以更改Python-mode的设置,使其在其他驱动器的文件上工作吗?在


编辑 Python模式有以下设置,看起来很有前途:

" Additional python paths
let g:pymode_paths = []

所以在vimrc中我添加了

让g:pymode_paths=['p:\Comp Apps\Python\']

但是如果我从那个位置打开一个.py文件,我会得到同样的错误消息。在


Tags: 文件mapreturnmodeactionvimrccr驱动器