想处理一个比较大的文件,处理之后还用在vim中编辑。但是vim处理比较慢,就想试试python 但是我不太懂python。想看看大家有没有谁会在vim中写python的谢谢。 目标:读取文件,把每一行的第一个单词做为字典的名,生成一个字典,传递给vim 文件是这种格式的: aa aaa aaa aaa aaa aa aaa aa aaa aa aa aaa 我只会文件读取的部分: python 《 EOF f0=file('vimim_wubi.txt','r') dat0=f0.readlines() f0.close() EOF 谢谢...
by fengidri - Linux环境编程 - 2012-03-06 15:47:50 阅读(2323) 回复(8)
http://www.petersblog.org/node/752 本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/82392/showart_1866330.html
最近总是在不同的机器间切换,而且有时会把windows上的python拷贝到linux上编辑然后执行,总是遇到很多的对齐问题 请问大家这种情况应该怎么办啊,我现在把我的vim设置了 set tabstop=4 set shiftwidth=4 set expandtab 但还是有这个问题,应该怎样解决?多谢,最近被这个问题很是烦恼
哪位大虾能给讲一下怎么把vim配置成一个适合编写python的编辑器?我在网上搜索,看到很多都是在windows下用vim的,按照那个设置,自己设置不好。 谁给讲讲在ubuntu下怎么配置vim,能够方便的写python程序? 我希望实现的功能如下: 1、tab的宽度是4个空格 2、最好能有自动缩进 3、自动补齐 其他就无所谓了。
在使用vim读代码时,用 gg=VG 重排代码很有用。可是不知道为甚对python代码,重排出错。需要设置什么,还是需要插件? 以以下代码为例: [code]# wordfreq.py import string def compareItems((w1,c1), (w2,c2)): if c1 > c2: return - 1 elif c1 == c2: return cmp(w1, w2) else: return 1 def main(): print "This program analyzes word frequency in a file" print "and prints a report on the n most frequent words.\n...
http://www.vim.org/scripts/script.php?script_id=4303 用python重写了,速度大幅提高,链接里gif为老的演示,webm是新的演示
vi /etc/vimrc
内容如下:
syntax on
set background=dark
:set ts=4 et sw=4 sts=4
set autoindent
set tabstop=4
set expandtab
set shiftwidth=4
filetype indent 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
vim python 自动补全插件:pydiction 下载:pydiction 这是一个相当不错的 python 代码自动完成的脚本。 可以实现下面python代码的自动补全: 简单python关键词补全 python 函数补全带括号 python 模块补全 python 模块内函数,变量补全 from module import sub-module 补全 pydiction 插件安装 pydiction 1.0 之后版本安装配置 适用vim7之后的版本。 1.python_pydiction.vim 将文件 python_pydiction.vim 放到 ~/.vim/afte...
" Make external commands work through a pipe instead of a pseudo-tty "set noguipty " You can also specify a different font, overriding the default font "if has('gui_gtk2') " set guifont=Bitstream\ Vera\ Sans\ Mono\ 12 "else " set guifont=-misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-1 "endif " If you want to run gvim with a dark background, try using a different " colorscheme or running...