xdaqing
-
2009-03-26
Sizzle JavaScript Selector Library - [推荐]
一个纯javascript实现的css选择器, 链接: http://sizzlejs.com/
-
2009-03-26
[视频] Evolving the Java Platform - [推荐]
关于java平台进一步演化的talk: http://www.infoq.com/presentations/Evolving-JVM-Ola-Bini
-
2009-03-26
[推荐] Scalability Best Practices: Lessons from eBay - [推荐]
虽然是很老的文章了, 但还是值得推荐, 最近重读, 大有感触.
链接在这里: http://www.infoq.com/articles/ebay-scalability-best-practices
-
2009-03-22
[教程] Linux C编程一站式学习 - [教程]
一个很简洁很清晰的教程: http://learn.akae.cn/media/index.html
-
2009-03-09
Mac下的16进制编辑器: 0xed - [软件]
这款软件叫0xed, 链接在: http://www.suavetech.com/0xed/0xed.html
-
2009-03-09
[vim] 一个带有英文注释的vim配置 - [推荐]
-
2009-03-05
The Zen of Python - [生活]
进入Python交互式shell, 输入: import this
The Zen of Python, by Tim Peters
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those! -
2009-03-03
[教程] 把Vim配置成IDE - [教程]
先看一下最终效果(点击看大图):
下面我们一步一步的来配置:
1. 基本配置
set nocompatible
set mouse=a
syntax on
filetype on
set autowrite
set number
set showcmd
set lcs=tab:>-,trail:-
set list
set showmode
set title
set tabstop=4
set ruler
set encoding=utf-8
set fileencoding=utf-8
set nobackup
set autoindent
set smartindent
set expandtab
set shiftwidth=4
set smarttab
set fdm=indent
set fdc=4
set nowrap
set hlsearch
set incsearch2. 然后是安装TagList插件
在 这里 可以找到TagList的介绍和下载地址, 安装vim插件的方法都一样, 就是把压缩包下载下来, 解压缩, 一般会得到一个plugin目录和doc目录. 在*nix系统(比如Linux或Mac OS X)中, 只要把这两个文件夹下的文件分别放到~/.vim/plugin和~/.vim/doc下面就行了.
plugin目录下的东西, vim在下次启动时会自动加载, 而那个doc目录下的文件是个帮助文档, 需要用vim打开这个帮助文档, 然后在命令模式下输入 :helptags . (别漏了最后的句点)
TagList的简单配置如下:
map <F3> :Tlist<CR>
let Tlist_Use_Right_Window=1
let Tlist_File_Fold_Auto_Close=13. 然后安装NERDTree
安装方法类似TagList, 就不再细说了.
简单的配置如下:
map <F1> :NERDTreeMirror<CR>
map <F2> :NERDTreeToggle<CR>4. 配置Vim的智能补全, 即所谓的Omni Completion.
fun! OmniComplete()
let left = strpart(getline('.'), col('.') - 2, 1)
if left =~ "^$"
return ""
elseif left =~ ' $'
return ""
else
return "\<C-x>\<C-o>"
endfun
inoremap <silent> <S-Tab> <C-R>=OmniComplete()<CR>
" turn on Omni completion
autocmd FileType c set ofu=ccomplete#Complete
autocmd FileType php set ofu=phpcomplete#CompletePHP
autocmd FileType python set ofu=pythoncomplete#Complete
autocmd FileType javascript set ofu=javascriptcomplete#CompleteJS
autocmd FileType html set ofu=htmlcomplete#CompleteTags
autocmd FileType css set ofu=csscomplete#CompleteCSS
autocmd FileType xml set ofu=xmlcomplete#CompleteTags5. 配合ctags, vim可以从一个函数调用跳转到其函数定义(快捷键是CTRL+]), ctags的用法很简单, 一般来说, 只要在项目的根目录运行 ctags -R . 就行了. vim在启动时, 会自动寻找当前目录下的tags文件, 如果有就会加载, 当然, 也可以告诉vim去哪里找tags文件, 配置如下:
set tags=./tags,~/my/project/tags
还可以配置Tab键来智能补全tags:
fun! KeywordComplete()
let left = strpart(getline('.'), col('.') - 2, 1)
if left =~ "^$"
return "\<Tab>"
elseif left =~ ' $'
return "\<Tab>"
else
return "\<C-N>"
endfun
inoremap <silent> <Tab> <C-R>=KeywordComplete()<CR>6. 其他的小配置:
source $VIMRUNTIME/menu.vim
set wildmenu
set cpo-=<
set wcm=<C-Z>
map <F6> :emenu <C-Z>到目前为止, 我们的vim就相当好用了, 最终的配置文件在这里: http://gist.github.com/70732








