config files

10月 25, 2008 · Posted in Linux · Comment 

https://sites.google.com/site/kaionunix

晒历史

10月 21, 2008 · Posted in Linux, something · 4 Comments 
[ ~ ]$ history | awk {'print $2'} | sort | uniq -c | sort -k1 -rn | head
    140 v
    120 git
     61 ls
     55 y
     49 rake
     46 exit
     30 sudo
     30 p
     29 killall
     27 cat

PS. v=vim, y=yaourt, p=pacman.

这么多的包管理命令,看来我太无聊了…

试用c.vim

05月 28, 2008 · Posted in Linux, Promgramming · Comment 

c.vim(C-support)是一个vim插件,C/Cpp开发的助推器,这个系列还有一个lua和Bash的版本。

不废话了,先看看它的主要功能先。

首先是代码模板:

— Statements ———————————————————

\sd do { } while (n,v,i)
\sf for (n,i)
\sfo for { } (n,v,i)
\si if (n,i)
\sif if { } (n,v,i)
\sie if else (n,v,i)
\sife if { } else { } (n,v,i)
\sw while (n,i)
\swh while { } (n,v,i)
\ss switch (n,v,i)
\sc case (n,i)
\s{ { } (n,v,i)

— Preprocessor ——————————————————-

\p< #include <&gt; (n,i)
\p” #include “” (n,i)
\pd #define (n,i)
\pu #undef (n,i)
\pie #if #else #endif (n,v,i)
\pid #ifdef #else #endif (n,v,i)
\pin #ifndef #else #endif (n,v,i)
\pind #ifndef #def #endif (n,v,i)
\pi0 #if 0 #endif (n,v,i)
\pr0 remove #if 0 #endif (n)
— Idioms ————————————————————-

\if function (n,v,i)
\isf static function (n,v,i)
\im main() (n,v,i)
\i0 for( x=0; x<n; x+=1 ) (n,v,i)
\in for( x=n-1; x>=0; x-=1 ) (n,v,i)
\ie enum + typedef (n,i)
\is struct + typedef (n,i)
\iu union + typedef (n,i)
\ip printf() (n,i)
\isc scanf() (n,i)
\ica p=calloc() (n,i)
\ima p=malloc() (n,i)
\isi sizeof() (n,v,i)
\ias assert() (n,v)
\ii open input file (n,i)
\io open output file (n,i)

— Snippets ———————————————————–

\nr read code snippet (n)
\nw write code snippet (n,v)
\ne edit code snippet (n)
\np pick up prototype (n,v)
\ni insert prototype(s) (n)
\nc clear prototype(s) (n)
\ns show prototype(s) (n)

— C++ —————————————————————-

\+c class (n,i)
\+cn class (using new) (n,i)
\+ci class implementation (n,i)
\+cni class (using new) implementation (n,i)
\+mi method implementation (n,i)
\+ai accessor implementation (n,i)

\+tc template class (n,i)
\+tcn template class (using new) (n,i)
\+tci template class implementation (n,i)
\+tcni template class (using new) impl. (n,i)
\+tmi template method implementation (n,i)
\+tai template accessor implementation (n,i)

\+tf template function (n,i)
\+ec error class (n,i)
\+tr try … catch (n,v,i)
\+ca catch (n,v,i)
\+c. catch(…) (n,v,i)

这个表最左边的就是按键,中间就是对应的模板,最后面是对应的模式。n是normal,i就是插入模式,v是虚拟模式。展开的模板放在 ~/.vim/c-support/templates 这里,自己可以hack,比如第一件事就是把Templates中的个人资料改一下。我还把函数声明改了一下,默认是把返回值类型放到上一行,看起来不爽。

然后就是编译链接和运行代码啦,我只用快捷键。

F9 compile and link
Alt-F9 write buffer and compile
Ctrl-F9 run executable
Shift-F9 set command line arguments

Shift-F2 switch between source files and header files

有了这些快捷键之后加上Vim7本身就有的一点点补全功能,其实这个工具也有些IDEful了。

最后看看一些实用功能,比如代码和注释的转化,还有行尾插入注释,插入注释行等等。

— Comments ———————————————————–

\cl end-of-line comment (n,v,i)
\cj adjust end-of-line comment(s) (n,v,i)
\cs set end-of-line comment column (n)
\c* code -> comment /* */ (n,v)
\c/ code -> comment // (n,v)
\cc code -> comment // (n,v)
\co comment -> code (n,v)
\cfr frame comment (n,i)
\cfu function comment (n,i)
\cme method description (n,i)
\ccl class description (n,i)
\cd date (n,i)
\ct date \& time (n,i)

有空试用一下lua-support和bash-support。其实一直想写篇rails.vim的配置和使用和一点点Src分析。

翻译Arch wiki上的wicd页

05月 1, 2008 · Posted in Linux · Comment 

早上翻译了下面这页:
http://wiki.archlinux.org/index.php/Wicd

其中过程,FF3忽然崩溃,又要翻译多一次,其实里面还有点还没有翻译完。。。

终于为ArchLinux做出了点贡献。

很好很快速的Arch(含笔记)

02月 22, 2008 · Posted in Linux · 2 Comments 

花了两天的时间才能安装配置好Arch的桌面,虽然很久但是觉得挺值得的。 Read more

下一页 »