vim编辑器python开发_描述一下您为Python/Django开发定制的Vim编辑器?

我最近在Python/Django开发中完全转向了Vim。我花了很多时间来定制它,直到今天,上帝知道我很难找到适合Python/Django开发的最佳vim插件的帮助。

我决定问这个问题,这样像我这样的人就能直接从你的经历中受益:

您已经构建了完美的Python/Djangoish Vim编辑器?为我们描述它(插件,脚本,customized.vimrc,colorschemes等等)。

谢谢

我的配置

好的,这是我自己的配置。实际上,我已经选择创建一个简单的Vim配置,这样我就可以掌握我选择安装的少量插件,而不是创建一大堆我永远都不会掌握或使用的插件。这是我使用最多的插件列表:对于文件管理

代码完成由Omnicompletion处理,Omnicompletion在Vim中是默认的

Pyflakes脚本以动态突出显示Python代码并发出警告

另外,我在$HOME/.vim/ftplugin/中创建了一个python.vim文件,其中包含这个脚本,因此我可以通过运行Shift+e从vim运行python代码:" Execute file being edited with + e:

map :w:!/usr/bin/env python %

我还收集了一些有用的.vimrc定制:set nocompatible " use vim defaults

set number " show line numbers

colorscheme desert

set tags=tags;$HOME/.vim/tags/ "recursively searches directory for 'tags' file

set expandtab " tabs are converted to spac

set tabstop=4 " numbers of spaces of tab character

set shiftwidth=4 " numbers of spaces to (auto)indent

set showcmd " display incomplete commands

set hlsearch " highlight searches

set incsearch " do incremental searching

set ruler " show the cursor position all the time

set numberwidth=4 " line numbering takes up 5 spaces

set ignorecase " ignore case when searching

set nowrap " stop lines from wrapping

filetype plugin indent on " turn on the indent plugins

syntax on " syntax highlighing

" TagList Plugin Configuration

let Tlist_Ctags_Cmd='/usr/bin/ctags' " point taglist to ctags

let Tlist_GainFocus_On_ToggleOpen = 1 " Focus on the taglist when its toggled

let Tlist_Close_On_Select = 1 " Close when something's selected

let Tlist_Use_Right_Window = 1 " Project uses the left window

let Tlist_File_Fold_Auto_Close = 1 " Close folds for inactive files

" Omnicompletion functions

autocmd FileType python set omnifunc=pythoncomplete#Complete

autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS

autocmd FileType html set omnifunc=htmlcomplete#CompleteTags

autocmd FileType css set omnifunc=csscomplete#CompleteCSS

au FileType py set expandtab

au FileType py set foldmethod=indent

map :previous " map F2 to open previous buffer

map :next " map F3 to open next buffer

map :NERDTreeToggle " map F4 to open NERDTree

map :TlistToggle " map F5 to toggle the Tag Listing

map " taglist - map Ctrl-LeftArrow to jump to the method/property under your cursor

map " taglist - map Ctrl-RhitArrow to jump back to your source code

map :tabnext " map Alt-RightArrow to jump to the next tab

map :tabprevious " map Alt-LeftArrow to jump to the previous tab

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值