| 日历 |
|
|
| 网志分类 |
|
| 最新的评论 |
|
| 站内搜索 |
|
| 友情链接 |
|
0014328
|
|
软件技术爱好者,热爱开源和Linux,喜欢C++/Python,欢迎交流。
Email:brothertian@gmail.com
Msn:brothertian@hotmail.com |
|
软件工具
| 编号 |
软件名称 |
下载地址 |
软件介绍 |
| 1 |
Workrave |
http://sourceforge.net/project/showfiles.php?group_id=62552 |
WorkRave可以按照你设置的时间间隔弹出提示窗口强制你休息,防止你太沉醉于工作以致于损害了身体。休息的过程中,还可以跟着它一起做做操。通过设置咖啡时间提醒你在长时间工作后起来活动活动。一天工作结束,它也会友好地提示你不要再对着电脑。 |
| 2 |
Launchy |
http://launchy.net |
Launchy is a free windows utility designed to help you forget about your start menu, the icons on your desktop, and even your file manager.
Launchy indexes the programs in your start menu and can launch your documents, project files, folders, and bookmarks with just a few keystrokes!
|
|
好久没有上来更新了,前段时间工作很忙,快过年了总算稍微轻松一点了。
去年年底去参加了软件设计师考试,通过了,今天去填了张表。想想毕业到现在5年多了,这是我第一次静下心来参加考试,虽然不去谈证书的含金量有多少,也算是自己的一个小小的成绩吧。:-)
|
Turbogears是python的轻量级web开发框架,之前也关注过zope,但感觉很难学,一直没有入门。最近发现了Turbogears,喜欢它“不重复发明轮子”的设计思想,所以开始学习它。经过一阵子的折腾,总算是入门了,同时也感觉到,它在设计思想上虽然最大限度的借助了已有组件的助力,但同时也存在一定风险,特别是当其中某个组件的架构发生重大变化时,可能会使Turbogears本身的架构收到严重影响。可能这只是我的一点肤浅的认识,继续关注Turbogears。
|
发现一关于结构化文本转换的文章, ”txt2tags 多模式结构化文本“。
直接支持从单一格式文本 t2t 到多种格式的文本输出,包括:
- HTML
- XHTML
- SGML
- LaTeX
- UNIX man
- MoinMoin
- Magic Point presentation
- PageMaker 6.0 documen等。
|
在使用vim之前也徘徊了好久,boa、drpython、eclipse+pydev、wingide、pythonwin、idle等等,用下来总觉得要么不顺手、要么bug较多。其中eclipse+pydev在功能和方便性上做得不错,可惜内存占用过多,我的本本经不起折腾。于是想到了vim这个强大的编辑器。
关于在vim里搭建python环境的文章也有不少,我也不打算重复,只是想把使用中感觉较好的几个插件和配置记录在这里,以便自己和朋友们参考。
- 操作系统:windows XP SP2。
- python:Python2.4,我安装ActivePython,里面带了windows支持包。
- vim:gvim 7.0,支持ole。
- ctags+taglist:语法分析,生成和显示tag点。
- minibufexpl:Mini Buffer Explorer,在vim上实现多文档tab效果。
- supertab:使用tab键实现自动补全功能,很方便,强力推荐。
- insenvim:智能语法分析和自动提示。需要perl支持,我安装了ActivePerl。
- python_fold:支持python的语句块、类的折叠,在对于单个大文件很实用。
- runscript:运行python script。
- 调试python:使用python自带的pdb,在vim的配置文件_vimrc里配置。请参考这篇文章:《Debugging Python in VIM》 。这篇文章展现了vim配置文件里使用python来实现定制功能的技术,很值得学习和借鉴。
这篇文章主要是介绍vim下python开发环境的支持插件,没有涉及其它开发语言环境的配置。下面贴出了我现在所用的_vimrc配置文件,是我基于其他人的配置文件基础上修改了的,其中不止涉及了python的开发环境,希望能对大家有所借鉴。
set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin
"set ffs=unix
set diffexpr=MyDiff()
function MyDiff()
let opt = '-a --binary '
if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
let arg1 = v:fname_in
if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
let arg2 = v:fname_new
if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
let arg3 = v:fname_out
if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
silent execute '!D:\Vim\vim70\diff ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3
endfunction
hi HL_HiCurLine ctermfg=blue ctermbg=cyan guifg=blue guibg=cyan
let HL_HiCurLine= "HL_HiCurLine"
set formatoptions=tcrqn2
set guifont=FixedsysTTF:h14 "如果没有这个字体那就不要加
set tabstop=4
set softtabstop=4
set shiftwidth=4
"colorscheme darkblue "在gvim下可以看到有多少coloscheme
color desert
set lsp=0
set sw=4 " shiftwidth
set et " expandtab
"set wm=8 " wrapmargin
set lbr "不在单词中间断行
set fo+=mB "打开断行模块对亚洲语言支持
set bs=2 " backspace
set ru " ruler
set ic " ignorecase "忽略大小写 但是输入中有大写的话不忽略
set is " incsearch
set scs " smartcase: override the 'ic' when searching
" if search pattern contains uppercase char
set nu "显示行号
set wmnu
set wildignore=*.bak,*.o,*.e,*~
iab #i #include
iab #d #define
iab #e #endif
set cst
set csto=1
set tags=./tags,../tags,../../tags,../../../tags,D:/Microsoft\ Visual\ Studio/VC98/Include/tags,D:/MinGW/include
set cspc=3 " show file path's last three part
set grepprg=grep\ -nH
map <F2> :Tlist<cr>
"map <F2> :WMToggle<cr>
"代码折叠快捷方式
map <F3> zO
map <F4> zc
map <F5> zR
map <F6> zM
"map <F7> :cn<CR>
"
set vb t_vb= " set visual bell and disable screen flash
set backup " enable backup and define the backup file
set backupext=.bak
set hlsearch " hlsearch
" allow backspacing over everything in
" the insert mode
set backspace=indent,eol,start
set dir=D:\vim\temp
" 设置swap文件的目录上面
set backupdir=D:\vim\temp
"设置备份文件的目录上面 我不喜欢看到每个目录下都有备份 因为一般备份用不到
"下面是设置自动folder的 而且是根据写C代码设置的 如果你不喜欢使用folder那么可以省略掉
"au BufReadPost *.h,*.c,*.cpp,*.java,*.pl syn region myFold start="{" end="}" transparent fold
"au BufReadPost *.h,*.c,*.cpp,*.java,*.pl syn sync fromstart
"au BufReadPost *.h,*.c,*.cpp,*.java,*.pl set foldmethod=syntax
"set foldlevel=0
set foldmarker={,}
set foldmethod=marker
set foldlevel=100 " Don't autofold anything (but I can still fold manually)
set foldopen-=search " don't open folds when you search into them
set foldopen-=undo " don't open folds when you undo stuff
"-------------------------------------------------------------------------------
" C-support.vim
"-------------------------------------------------------------------------------
let g:C_AuthorName = 'J.T Jacky'
let g:C_AuthorRef = ''
let g:C_Email = 'brothertian@gmail.com'
let g:C_Company = 'Baosight'
"-------------------------------------------------------------------------------
" C++
"-------------------------------------------------------------------------------
set sm
set cin
set cino=:0g0t0(sus
"-------------------------------------------------------------------------------
" copy from web
"-------------------------------------------------------------------------------
set history=1000 " How many lines of history to remember
set cf " enable error files and error jumping
set clipboard+=unnamed " turns out I do like is sharing windows clipboard
set ffs=dos,unix,mac " support all three, in this order
filetype plugin on " load filetype plugins
set viminfo+=! " make sure it can save viminfo
set isk+=_,$,@,%,#,- " none of these should be word dividers, so make them not be
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Vim UI
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set lsp=0 " space it out a little more (easier to read)
set wildmenu " turn on wild menu
set ruler " Always show current positions along the bottom
set cmdheight=1 " the command bar is 2 high
"set number " turn on line numbers
set lz " do not redraw while running macros (much faster) (LazyRedraw)
"set hid " you can change buffer without saving
set backspace=2 " make backspace work normal
set whichwrap+=<,>,h,l " backspace and cursor keys wrap to
set mouse=a " use mouse everywhere
set shortmess=atI " shortens messages to avoid 'press a key' prompt
set report=0 " tell us when anything is changed via :...
set noerrorbells " don't make noise
" make the splitters between windows be blank
set fillchars=vert:\ ,stl:\ ,stlnc:\
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Visual Cues
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"set showmatch " show matching brackets
"set mat=5 " how many tenths of a second to blink matching brackets for
"set nohlsearch " do not highlight searched for phrases
set incsearch " BUT do highlight as you type you search phrase
set listchars=tab:\|\ ,trail:.,extends:>,precedes:<,eol:$ " what to show when I hit :set list
set lines=80 " 80 lines tall
set columns=160 " 160 cols wide
set so=0 " Keep 10 lines (top/bottom) for scope
set novisualbell " don't blink
set noerrorbells " no noises
set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [ASCII=\%03.3b]\ [HEX=\%02.2B]\ [POS=%04l,%04v][%p%%]\ [LEN=%L]
set laststatus=2 " always show the status line
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Text Formatting/Layout
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set fo=tcrqn " See Help (complex)
"set ai " autoindent
"set si " smartindent
set cindent " do c-style indenting
filetype indent on
"set tabstop=8 " tab spacing (settings below are just to unify it)
"set softtabstop=8 " unify
"set shiftwidth=8 " unify
"set noexpandtab " real tabs please!
set nowrap " do not wrap lines
set guioptions+=b "添加水平滚动条
"set smarttab " use tabs at the start of a line, spaces elsewhere
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Folding
" Enable folding, but by default make it act like folding is off, because folding is annoying in anything but a few rare cases
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"set foldenable " Turn on folding
"set foldmethod=indent " Make folding indent sensitive
"set foldlevel=100 " Don't autofold anything (but I can still fold manually)
"set foldopen-=search " don't open folds when you search into them
"set foldopen-=undo " don't open folds when you undo stuff
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" File Explorer
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let g:explVertical=1 " should I split verticially
let g:explWinSize=20 " width of 35 pixels
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Win Manager
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let g:winManagerWidth=20 " How wide should it be( pixels)
"let g:winManagerWindowLayout = 'FileExplorer,TagsExplorer|BufExplorer' " What windows should it
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" CTags
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let Tlist_Ctags_Cmd = 'D:\Vim\Intellisense\cppft\ctags.exe' " Location of ctags
let Tlist_Sort_Type = "name" " order by
let Tlist_Use_Right_Window = 1 " split to the right side of the screen
let Tlist_Compart_Format = 1 " show small meny
let Tlist_Exist_OnlyWindow = 1 " if you are the last, kill yourself
let Tlist_File_Fold_Auto_Close = 0 " Do not close tags for other files
let Tlist_Enable_Fold_Column = 0 " Do not show folding tree
let g:ctags_path='D:\Vim\Intellisense\cppft\ctags.exe'
let g:ctags_statusline=1
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Minibuf
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let g:miniBufExplTabWrap = 1 " make tabs show complete (no broken on two lines)
let g:miniBufExplModSelTarget = 1
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Matchit
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let b:match_ignorecase = 1
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Perl
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let perl_extended_vars=1 " highlight advanced perl vars inside strings
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" cscope
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"if has("cscope")
" set csprg=D:\Vim\vim70\cscope.exe
" set csto=0
" set cst
" set nocsverb
" " add any database in current directory
" if filereadable("cscope.out")
" cs add cscope.out
" " else add database pointed to by environment
" elseif $CSCOPE_DB != ""
" cs add $CSCOPE_DB
" endif
" set csverb
"endif
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Custom Functions
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Select range, then hit :SuperRetab($width) - by p0g and FallingCow
function! SuperRetab(width) range
silent! exe a:firstline . ',' . a:lastline . 's/\v%(^ *)@<= {'. a:width .'}/\t/g'
endfunction
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Useful abbrevs
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"iab xasp <%@language=jscript%><CR><%<CR><TAB><CR><BS>%><ESC><<O<TAB>
"iab xdate <c-r>=strftime("%d/%m/%y %H:%M:%S")<cr>
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" python
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
if has("autocmd")
" 自动检测文件类型并加载相应的设置
filetype plugin indent on
" Python 文件的一般设置,比如不要 tab 等
autocmd FileType python setlocal et | setlocal sta | setlocal sw=4
" Python Unittest 的一些设置
" 可以让我们在编写 Python 代码及 unittest 测试时不需要离开 vim
" 键入 :make 或者点击 gvim 工具条上的 make 按钮就自动执行测试用例
autocmd FileType python compiler pyunit
autocmd FileType python setlocal makeprg=\"D:\Python24\python.exe\"\ ./alltests.py
autocmd BufNewFile,BufRead test*.py setlocal makeprg=\"D:\Python24\python.exe\"\ %
" 自动使用新文件模板
autocmd BufNewFile test*.py 0r \"D:\Vim\skeleton\test.py\"
autocmd BufNewFile alltests.py 0r \"D:\Vim\skeleton\alltests.py\"
autocmd BufNewFile *.py 0r \"D:\Vim\skeleton\skeleton.py\"
endif
" python auto-complete code
" Typing the following (in insert mode):
" os.lis<Ctrl-n>
" will expand to:
" os.listdir(
" Python 自动补全功能,只需要反覆按 Ctrl-N 就行了
"if has("autocmd")
"autocmd FileType python set complete+=k\"D:\Vim\vim70\tools\pydiction-0.5\pydiction\"
"endif
au FileType python source D:\Vim\vimfiles\plugin\python.vim
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Python Debugger Script
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
" Block of python
"
python << EOF
import time
import vim
def SetBreakpoint():
import re
nLine = int( vim.eval( 'line(".")'))
strLine = vim.current.line
strWhite = re.search( '^(\s*)', strLine).group(1)
vim.current.buffer.append(
"%(space)spdb.set_trace() %(mark)s Breakpoint %(mark)s" %
{'space':strWhite, 'mark': '#' * 30}, nLine - 1)
for strLine in vim.current.buffer:
if strLine == "import pdb":
break
else:
vim.current.buffer.append( 'import pdb', 0)
vim.command( 'normal j1')
vim.command( 'map <f7> :py SetBreakpoint()<cr>')
def RemoveBreakpoints():
import re
nCurrentLine = int( vim.eval( 'line(".")'))
nLines = []
nLine = 1
for strLine in vim.current.buffer:
if strLine == 'import pdb' or strLine.lstrip()[:15] == 'pdb.set_trace()':
nLines.append( nLine)
nLine += 1
nLines.reverse()
for nLine in nLines:
vim.command( 'normal %dG' % nLine)
vim.command( 'normal dd')
if nLine < nCurrentLine:
nCurrentLine -= 1
vim.command( 'normal %dG' % nCurrentLine)
vim.command( 'map <s-f7> :py RemoveBreakpoints()<cr>')
def RunDebugger():
vim.command( 'wall')
strFile = vim.eval( "g:mainfile")
vim.command( "!start python -m pdb %s" % strFile)
vim.command( 'map <s-f12> :py RunDebugger()<cr>')
EOF
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" ShowFunc
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let g:showfuncctagsbin = 'D:\Vim\Intellisense\cppft\ctags.exe'
map! <F1> <Plug>ShowFunc
map <s-F8> <Plug>ShowFunc
|
几年前学习Linux时,发现了python这个强大的脚本语言。与其说是编程语言,倒不如说是一种编程艺术。其中的感觉不是用语言能够表达了。 python的强大、灵活、高效、与C语言的良好结合,以及开源社区的强大推动,使它成为一种充满活力的开发语言,也深深打动了我。可惜这几年由于时间的 关系,一直没有好好的学习和使用python这个强大的工具。最近有点空了,准备继续学习python。
|
比较了几个blog站点,正式在这里安家。:-)
|
|
|
|
|