vim 是笔者常用的一个编辑器(目前转到了 neovim,neovim 配置),结合 tmux、iterm2、zsh、autojump 等命令行工具和 Dash,Alfread 等工具就能在终端下愉快开发了。在 vim 下写 python 一般有两个常用的插件,一个是 python-mode,一个是 jedi-vim。笔者选择了 python-mode,因为它功能很强大,笔者的一套配置在服务器和本地开发几乎就是一样的体验。python-mode 功能很全,补全、重构、静态检查、自动格式化等都有,看下官网的特性:
Why Python-mode?Be more productive: Pymode saves time by bring all tools necessary for professional developers so that you can focus on bigger things. It has been finely tuned based on decades of experience working with Vim and is constantly kept uptodate.
Get smart assistance: Pymode knows all about your code. We use the best-in-class intellisense code completion, on-the-fly error checking and quick-fixes; easy project navigation and much more.
Use the full power and capabilities of Vim: Unlike traditional IDEs which can only provide a small subset of Vim functionalities, you can do everything and anything that you can in Vim.
Modular structure: We attempt to be create Python-mode in the same principles of python: i.e. have a modular structure, so that as and when better libraries evolve, we can provide you the best experience, while abstracting the details so that you can get back to what you do best.
Written mostly in Python: 96.1% written in Python. Well we love Python :)
The plugin contains all you need to develop python applications in Vim.Support Python version 2.6+ and 3.2+
Syntax highlighting
Virtualenv support
Run python code (r)
Add/remove breakpoints (b)
Improved Python indentation
Python motions and operators (]], 3[[, ]]M, vaC, viM, daC, ciM, ...)
Improved Python folding
Run multiple code checkers simultaneously (:PymodeLint)
Autofix PEP8 errors (:PymodeLintAuto)
Search in python documentation (K)
Code refactoring
Intellisense code-completion
Go to definition (g)
And more, more ...
下面是某不可见网站的示例视频,大家可以看下:https://www.zhihu.com/video/937270284336828416