VIM の基本を学ぶために小さな Python スクリプトを作成しています (私は VIM の初心者です)。omnicompletion で動作するように VIM を構成しましたが、動作します。たとえば、str と書くとします。次に、ctr+x、ctr+o を押すと、すべての文字列メソッドが提案されます。ただし、私のコードには次のようなものがあります。
for line in inFile.readlines():
something = line.rpartition(" ")[0]
line.rpart と入力した後、VIM で rpartition メソッド名をオートコンプリートしてもらいたいです。行オブジェクトの型を知っているとは思いませんが、Python ライブラリの知識に基づいて、VIM にコンテキストを認識しない補完リストを提案してもらいたいと思います。たとえば、日食で完了しようとすると
anObject.rpart
anObject とは関係なくても、rpartition メソッドを提案してくれます。
これを VIM で動作させることは可能ですか?
ありがとう。
私の .vimrc ファイル:
set showcmd
set textwidth=80
set expandtab
set smarttab
set tabstop=4
set shiftwidth=4
set softtabstop=4
set number
set autoindent
filetype indent on
filetype plugin on
autocmd BufRead,BufNewFile *.py syntax on
autocmd BufRead,BufNewFile *.py set ai
autocmd BufRead *.py set smartindent cinwords=if,elif,else,for,while,with,try,except,finally,def,class
set modeline
syntax on
" Closes the Omni-Completion tip window when a selection is
" made
autocmd CursorMovedI * if pumvisible() == 0|pclose|endif
autocmd InsertLeave * if pumvisible() == 0|pclose|endif