平时大项目用ide就,写小脚本的时候就直接vim了。之前懒得配置什么vim插件,因为写的小脚本用不到什么库,大部分就是re模块处理字符串就,最近写的脚本比较烦,所以给vim配一个自动提示。
1.github上两个项目
https://github.com/tpope/vim-pathogen
https://github.com/davidhalter/jedi-vim/tree/e66c2e12e64c7f895342d4d9bcc596ea7eabfdf4
2.本地环境
vim ~/.vimrc
execute pathogen#infect()
syntax on
filetype plugin indent on
3.快捷键
jedi-vim的leader键是g
- Completion <C-Space>(control+空格)
- Goto assignments <leader>g (typical goto function)(:g g)
- Goto definitions <leader>d (follow identifier as far as possible, includes imports and statements)(:g d)
- Show Documentation/Pydoc K (shows a popup with assignments)
- Renaming <leader>r (:g r)
- Usages <leader>n (shows all the usages of a name) (:g n)
- Open module, e.g. :Pyimport os (opens the os module)