一个用Python给Vim做的插件,PythonVim做插件,[Python]代码fu
一个用Python给Vim做的插件,PythonVim做插件,[Python]代码fu
[Python]代码
function! Google()python << EOM# coding=utf-8import vimimport reimport webbrowserline = vim.current.linerow,col = vim.current.window.cursorprint colstart = end = colwhile True: if line[start].isspace(): break start-=1while True: if line[end].isspace(): break end+=1word = line[start+1:end]if not word or word.isspace(): print 'You cannot call Google in a space position!'else: try: url = 'http://www.google.com/search?q='+word webbrowser.open(url) print 'Google : %s' % word except: print 'Failed! : Cannot access Google!'EOMendfunctioncommand Google :call Google()
相关内容
- 人人网相册下载,人人网相册,RRAD.py# cod
- python生成随机mac地址,python生成mac,#!/usr/bin/p
- 挑选文件夹里面宽大于300图片,挑选文件夹300,需要用到
- python 实现简单的SYSLOG服务器,并写入MYSQL数据库,sys
- 根据目录下的文件名生成SQL语句,文件名生成sql语句
- 自动生成 unity_build.cpp,unity_build.cpp,自动生成 unity_b
- 用Python做Port Forwarding,pythonforwarding,recipe-48373
- 解析xml文本,xml文本,[Python]代码#
- RSA算法的简单实现,RSA算法简单实现,[Python]代码#!
- 用python+PYQT4写的一个俄罗斯方块游戏,pythonpyqt4,[Pytho
评论关闭