gpt4 book ai didi

python-rope/ropevim 无法正常工作

转载 作者:太空宇宙 更新时间:2023-11-03 16:04:43 26 4
gpt4 key购买 nike

我已经安装了这些,pip list:

rope (0.10.3)
ropemode (0.3)
ropevim (0.7.0)

我拥有的所有 vim 插件:

Plugin 'gmarik/vundle'
Plugin 'scrooloose/nerdtree'
Plugin 'jistr/vim-nerdtree-tabs'
Plugin 'altercation/vim-colors-solarized'
Plugin 'kien/ctrlp.vim'
Plugin 'SirVer/ultisnips'
Plugin 'honza/vim-snippets'
Plugin 'jiangmiao/auto-pairs'
Plugin 'scrooloose/nerdcommenter'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'Valloric/YouCompleteMe'
Plugin 'majutsushi/tagbar
Plugin 'Yggdroot/indentLine'
Plugin 'xolox/vim-misc'
Plugin 'xolox/vim-session'
Plugin 'tpope/vim-surround'
Plugin 'tpope/vim-repeat'
Plugin 'tpope/vim-fugitive'
Plugin 'vim-scripts/VisIncr'
Plugin 'easymotion/vim-easymotion'
Plugin 'godlygeek/tabular'
Plugin 'ternjs/tern_for_vim'
Plugin 'scrooloose/syntastic'
Plugin 'Shutnik/jshint2.vim'

Plugin 'python-rope/ropevim'

: map

n  [m          *@:call <SNR>108_Python_jump('?^\s*\(class\|def\)')<CR>
n [[ *@:call <SNR>108_Python_jump('?^\(class\|def\)')<CR>
n ]m *@:call <SNR>108_Python_jump('/^\s*\(class\|def\)')<CR>
n ]] *@:call <SNR>108_Python_jump('/^\(class\|def\)')<CR>
î *@:call AutoPairsJump()<CR>
ð *@:call AutoPairsToggle()<CR>
n <C-A> * ggVG
s <C-H> * <C-G>c
x <Tab> * :call UltiSnips#SaveLastVisualSelection()<CR>gvs
s <Tab> * <Esc>:call UltiSnips#ExpandSnippetOrJump()<CR>
n <CR> o<Esc>
n <C-N> * :bnext<CR>
n <C-P> * :bprevious<CR>
s <C-R> * <C-G>"_c<C-R>
<Space> <Plug>(easymotion-f)
,, <Plug>(easymotion-prefix)
n ,ca <Plug>NERDCommenterAltDelims
x ,cu <Plug>NERDCommenterUncomment
n ,cu <Plug>NERDCommenterUncomment
x ,cb <Plug>NERDCommenterAlignBoth
n ,cb <Plug>NERDCommenterAlignBoth
x ,cl <Plug>NERDCommenterAlignLeft
n ,cl <Plug>NERDCommenterAlignLeft
n ,cA <Plug>NERDCommenterAppend
x ,cy <Plug>NERDCommenterYank
n ,cy <Plug>NERDCommenterYank
x ,cs <Plug>NERDCommenterSexy
n ,cs <Plug>NERDCommenterSexy
x ,ci <Plug>NERDCommenterInvert
n ,ci <Plug>NERDCommenterInvert
n ,c$ <Plug>NERDCommenterToEOL
x ,cn <Plug>NERDCommenterNested
n ,cn <Plug>NERDCommenterNested
x ,cm <Plug>NERDCommenterMinimal
n ,cm <Plug>NERDCommenterMinimal
x ,c<Space> <Plug>NERDCommenterToggle
n ,c<Space> <Plug>NERDCommenterToggle
x ,cc <Plug>NERDCommenterComment
n ,cc <Plug>NERDCommenterComment
n ,o * :<C-U>CtrlP<CR>
n ,c * :SyntasticCheck<CR>
n ,9 * :9wincmd w<CR>
n ,8 * :8wincmd w<CR>
n ,7 * :7wincmd w<CR>
n ,6 * :6wincmd w<CR>
n ,5 * :5wincmd w<CR>
n ,4 * :4wincmd w<CR>
n ,3 * :3wincmd w<CR>
n ,2 * :2wincmd w<CR>
n ,1 * :1wincmd w<CR>
n ,n * :NERDTreeToggle<CR>
n ,r * :Java %<CR>
n ,s * :JavaSearchContext<CR>
n ,d * :JavaDocSearch -x declarations<CR>
n ,i * :JavaImportOrganize<CR>
n ,os * :OpenSession<CR>
n ,sv * :source $MYVIMRC<CR>
n ,v :e $MYVIMRC<CR>
n ,w * :wall<CR>
n ,q * :bp<CR>:bd #<CR>
n ,p "+p
v ,p "+p
n ,y "+y
v ,y "+y
x S <Plug>VSurround
n cS <Plug>CSurround
n cs <Plug>Csurround
n ds <Plug>Dsurround
v gx <Plug>NetrwBrowseXVis
n gx <Plug>NetrwBrowseX
x gS <Plug>VgSurround
n ySS <Plug>YSsurround
n ySs <Plug>YSsurround
n yss <Plug>Yssurround
n yS <Plug>YSurround
n ys <Plug>Ysurround
v <Plug>NetrwBrowseXVis * :<C-U>call netrw#BrowseXVis()<CR>
n <Plug>NetrwBrowseX * :call netrw#BrowseX(expand((exists("g:netrw_gx")? g:netrw_gx : '<cfile>')),netrw#CheckIfRemote())<CR>
<Plug>(easymotion-prefix)N <Plug>(easymotion-N)
<Plug>(easymotion-prefix)n <Plug>(easymotion-n)
# ----- other easymotion-perfix ------- #

x <Plug>(easymotion-activate) * :<C-U>call EasyMotion#activate(1)<CR>
nos<Plug>(easymotion-activate) * :<C-U>call EasyMotion#activate(0)<CR>
<Plug>(easymotion-dotrepeat) * :<C-U>call EasyMotion#DotRepeat()<CR>
# ----- Other easymotion options ------ #

n <SNR>74_: * :<C-U><C-R>=v:count ? v:count : ''<CR>
v <Plug>VgSurround * :<C-U>call <SNR>73_opfunc(visualmode(),visualmode() ==# 'V' ? 0 : 1)<CR>
v <Plug>VSurround * :<C-U>call <SNR>73_opfunc(visualmode(),visualmode() ==# 'V' ? 1 : 0)<CR>
n <Plug>YSurround * :<C-U>set opfunc=<SNR>73_opfunc2<CR>g@
n <Plug>Ysurround * :<C-U>set opfunc=<SNR>73_opfunc<CR>g@
n <Plug>YSsurround * :<C-U>call <SNR>73_opfunc2(v:count1)<CR>
n <Plug>Yssurround * :<C-U>call <SNR>73_opfunc(v:count1)<CR>
n <Plug>CSurround * :<C-U>call <SNR>73_changesurround(1)<CR>
n <Plug>Csurround * :<C-U>call <SNR>73_changesurround()<CR>
n <Plug>Dsurround * :<C-U>call <SNR>73_dosurround(<SNR>73_inputtarget())<CR>
n <Plug>SurroundRepeat * .
n <Plug>NERDCommenterAltDelims * :call <SNR>60_SwitchToAlternativeDelimiters(1)<CR>
x <Plug>NERDCommenterUncomment * :call NERDComment("x", "Uncomment")<CR>
n <Plug>NERDCommenterUncomment * :call NERDComment("n", "Uncomment")<CR>
x <Plug>NERDCommenterAlignBoth * :call NERDComment("x", "AlignBoth")<CR>
n <Plug>NERDCommenterAlignBoth * :call NERDComment("n", "AlignBoth")<CR>
x <Plug>NERDCommenterAlignLeft * :call NERDComment("x", "AlignLeft")<CR>
n <Plug>NERDCommenterAlignLeft * :call NERDComment("n", "AlignLeft")<CR>
n <Plug>NERDCommenterAppend * :call NERDComment("n", "Append")<CR>
x <Plug>NERDCommenterYank * :call NERDComment("x", "Yank")<CR>
n <Plug>NERDCommenterYank * :call NERDComment("n", "Yank")<CR>
x <Plug>NERDCommenterSexy * :call NERDComment("x", "Sexy")<CR>
n <Plug>NERDCommenterSexy * :call NERDComment("n", "Sexy")<CR>
x <Plug>NERDCommenterInvert * :call NERDComment("x", "Invert")<CR>
n <Plug>NERDCommenterInvert * :call NERDComment("n", "Invert")<CR>
n <Plug>NERDCommenterToEOL * :call NERDComment("n", "ToEOL")<CR>
x <Plug>NERDCommenterNested * :call NERDComment("x", "Nested")<CR>
n <Plug>NERDCommenterNested * :call NERDComment("n", "Nested")<CR>
x <Plug>NERDCommenterMinimal * :call NERDComment("x", "Minimal")<CR>
n <Plug>NERDCommenterMinimal * :call NERDComment("n", "Minimal")<CR>
x <Plug>NERDCommenterToggle * :call NERDComment("x", "Toggle")<CR>
n <Plug>NERDCommenterToggle * :call NERDComment("n", "Toggle")<CR>
x <Plug>NERDCommenterComment * :call NERDComment("x", "Comment")<CR>
n <Plug>NERDCommenterComment * :call NERDComment("n", "Comment")<CR>
s <Del> * <C-G>c
s <BS> * <C-G>c
s <C-Tab> * <Esc>:call UltiSnips#ListSnippets()<CR>
<Plug>NERDTreeFocusToggle & :call <SNR>53_NERDTreeFocusToggle()
<Plug>NERDTreeSteppedClose & :call <SNR>53_NERDTreeSteppedClose()
<Plug>NERDTreeSteppedOpen & :call <SNR>53_NERDTreeSteppedOpen()
<Plug>NERDTreeMirrorToggle & :call <SNR>53_NERDTreeMirrorToggle()
<Plug>NERDTreeMirrorOpen & :call <SNR>53_NERDTreeMirrorOrCreate()
<Plug>NERDTreeTabsFind & :call <SNR>53_NERDTreeFindFile()
<Plug>NERDTreeTabsToggle & :call <SNR>53_NERDTreeToggleAllTabs()
<Plug>NERDTreeTabsClose & :call <SNR>53_NERDTreeCloseAllTabs()
<Plug>NERDTreeTabsOpen & :call <SNR>53_NERDTreeOpenAllTabs()
n <M-Right> <C-W><
n <M-Left> <C-W>>
n <M-Up> <C-W>+
n <M-Down> <C-W>-
n <F2> * :call NumberToggle()<CR>

:imap

i  <BS>        *@<C-R>=AutoPairsDelete()<CR>
i î *@<Esc>:call AutoPairsJump()<CR>a
i ð *@AutoPairsToggle()
i â *@<C-R>=AutoPairsBackInsert()<CR>
i å *@<C-R>=AutoPairsFastWrap()<CR>
i <C-H> *@<C-R>=AutoPairsDelete()<CR>
i <CR> &@<CR><SNR>59_AutoPairsReturn
i <Space> *@<C-]><C-R>=AutoPairsSpace()<CR>
i " *@<C-R>=AutoPairsInsert('"')<CR>
i ' *@<C-R>=AutoPairsInsert('''')<CR>
i ( *@<C-R>=AutoPairsInsert('(')<CR>
i ) *@<C-R>=AutoPairsInsert(')')<CR>
i [ *@<C-R>=AutoPairsInsert('[')<CR>
i ] *@<C-R>=AutoPairsInsert(']')<CR>
i ` *@<C-R>=AutoPairsInsert('`')<CR>
i { *@<C-R>=AutoPairsInsert('{')<CR>
i } *@<C-R>=AutoPairsInsert('}')<CR>
i <Up> * pumvisible() ? "\<C-P>" : "\<Up>"
i <Down> * pumvisible() ? "\<C-N>" : "\<Down>"
i <Plug>ISurround * <C-R>=<SNR>73_insert(1)<CR>
i <Plug>Isurround * <C-R>=<SNR>73_insert()<CR>
i <Plug>NERDCommenterInsert * <Space><BS><Esc>:call NERDComment('i', "insert")<CR>
i <Plug>AutoPairsReturn & <SNR>59_AutoPairsReturn
i <SNR>59_AutoPairsReturn * <C-R>=AutoPairsReturn()<CR>
i <C-Tab> * <C-R>=UltiSnips#ListSnippets()<CR>
i <C-G>S <Plug>ISurround
i <C-G>s <Plug>Isurround
i <Tab> * <C-R>=UltiSnips#ExpandSnippetOrJump()<CR>
i <NL> * <C-X><C-O><C-P>
i <C-N> * pumvisible() ? "\<C-N>" : "\<C-N>"
i <C-P> * pumvisible() ? "\<C-P>" : "\<C-P>"
i <C-S> <Plug>Isurround
i kj <Esc>

:version 显示 -python +python3

我没有在.vimrc中添加ropevim的任何配置。现在,整个键绑定(bind)不起作用。如果我输入 :Rope 和 tab,什么也不会显示。但是 :h rod 将显示文档

安装时有什么遗漏吗?或者任何配置都应该放入 .vimrc 中?

最佳答案

:map 显示什么? :imap 对于 Ctrl-] 显示什么?我的 ~/.vimrc 中有这个:

let ropevim_vim_completion=1
let ropevim_extended_complete=1
let ropevim_codeassist_maxfixes=1
let ropevim_goto_def_newwin="tabnew"
let ropevim_autoimport_modules = ["os.*","traceback", "xml.etree"]
"imap <c-space> <C-R>=RopeCodeAssistInsertMode()<CR>

au FileType python
\ noremap <silent> <buffer> <C-]> :RopeGotoDefinition<CR>
<小时/>

好的,所以问题出在 vim 上,它不支持 Python 2 插件。 Rope 尚不兼容 py3k。 (编辑:rope 现在完全支持 Python 3)

(甚至稍后编辑:这是正确且真实的,但我认为整个 Ropevim 已弃用。安装正确的 LSP 客户端(neovim 原生),python-lsp-serverpylsp-rope 通过 pip 的 Python 模块,并使用它来代替)

关于python-rope/ropevim 无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39952334/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com