存档

‘技术’ 分类的存档

不要再被x200与tplink路由器不能和睦相处的问题折磨了

2010年1月31日 zhubaining 没有评论
  • 本文链接地址:http://zhubaining.com/blog/2010/01/31/archives/%e4%b8%8d%e8%a6%81%e5%86%8d%e8%a2%abx200%e4%b8%8etplink%e8%b7%af%e7%94%b1%e5%99%a8%e4%b8%8d%e8%83%bd%e5%92%8c%e7%9d%a6%e7%9b%b8%e5%a4%84%e7%9a%84%e9%97%ae%e9%a2%98%e6%8a%98%e7%a3%a8%e4%ba%86
  • 作者:zhubaining

thinkpad x200的intel 5100 AGN无线网卡与tplink无线路由器搭伙干活时总是出问题,时常掉线,或者连接时卡在“获取ip地址”的阶段,而与其他无线设备相连时好像没有问题。我每次都是把无线开关关了又开,或者把无线连接禁用再启用,有时候能好。当然,重启电脑或者重新打开后就没问题,不过我习惯每次休眠。

不能再逆来顺受了,今天一定要把这个问题解决掉。

在网上搜索了一下,看来确实有不少可怜的孩子也是被这个问题困扰着。有的人出招说是无线开关接触不良,有的说要手动创建连接,有的说更新驱动程序。 我试了一下,发现更新一下网卡驱动程序,然后再重启一下机器即可搞定:

http://driverdl.lenovo.com.cn/think/download/driver/dr1256538571049/Intelabgn[6mwc17ww].exe

分类: 技术 标签:

强大的VIM技巧

2009年5月27日 zhubaining 没有评论
  • 本文链接地址:http://zhubaining.com/blog/2009/05/27/archives/vim-technique
  • 作者:zhubaining

K: 查看关键字的man page,在可视模式它会以选中的文本为关键字。

da<      Delete the HTML tag the cursor is currently inside of – the whole tag, regardless of just where the cursor is.
ci"    -> Delete everything inside "" string and start insert mode
da[    -> Delete the [] region around your cursor
vi'    -> Visual select everything inside '' string
ya(    -> Yank all text from ( to )

control-A / control-X:跳到当前行的数字上,进行增1或者减1,居然可以支持C语言风格的八、十、十六进制。

. (period):Repeats the previous change

[I:list all lines found in current and included files that contain the word under the cursor.

Ctrl-c: quit Insert mode (faster than ESC)

Record:

q<some key>
<edit one line and move to the next>
q
Play:

@<some key>
@@ (play last macro)
100@<some key> (apply macro 100 times)

:%s//replace/g will replace the last term that was searched for, instead of you having to type it again. This works well with using * to search for the word under the cursor.

ctrl-x->ctrl-f (while cursor on a path string): searches for the path and auto-completes it, with multi-optional selection.  

Putting options in comments in a file to be edited. That way the specific options will follow the file. Example, from inside a script:
# vim: ts=3 sw=3 et sm ai smd sc bg=dark nohlsearch
% Brace/parentheses match. If you have the cursor on a parenthesis/brace/etc ((){}[]), and hit % it will jump to the corresponding one.

Read contents of an external command into the doc:   :r !ls

:g/search/p:Grep inside this file and print matching lines. You can also replace p with d to delete matching lines.

[[ - Beginning of the current function block.
]] - Beginning of the next funcion.
[{ - Beginning of the current code block.
]} - End of the current code block.

z - position the current line to the top of the screen.
zz - position the current line to the center of the screen.
z- - position the current line to the bottom of the screen.

H 光标移至屏幕顶行。
M 光标移至屏幕中间行。
L 光标移至屏幕最后行。

ZZ - Save & Exit

#: Search backwards in the file for the word under the cursor.  Useful for finding declarations.
%j: To join all lines into a single line.

查看ASCII码: ga         查看当前光标下的字符的ascii,十六进制,8进制
 # 另外,也可以‘man ascii’来查看ascii码表.

:%!xxd 按十六进制查看当前文件
:%!xxd -r 从十六进制返回正常模式 

:%!cat -n : 为文件内容增加行号

:r! command : 将命令 Command 的输出结果放到当前行。

d0 删至行首。
d$ 删至行尾。

:g/gladiolli/#    : 查找并显示匹配的行号

:%norm jdd    : 隔行删除

<C-X><C-L>    : 行自动完成(超级有用)

:Exp(lore)    : 浏览文件

:Sex(plore)    : 分割窗口浏览文件

guu    : 将整行的字母转换成小写

gUU    : 将整行的字母转换成大写

Vu    : 转换选中的行(小写)

VU    : 转换选中的行(大写)

<C-R>=5*5    : 插入25 (小型计算器) (插入模式下)

'.    : 跳回最后编辑的行 (超有用)

[I    : 显示当前行中字符的所有匹配(超级有用)

<C-X><C-F>    : 插入当前目录下的一个文件名到当前位置

▼在当前插入模式下编辑/移动 (真得很有用)

<C-U>    : 删除全部

gf    : 打开光标处广义字命名的文件 (normal模式)

:set ro (Read Only)    : 只读保护
<C-W>    : 删除最后一个单词

PHP函数自动补全:
下载函数名列表文件:http://cvs.php.net/viewvc.cgi/phpdoc/funclist.txt?revision=1.39&view=co
set dictionary-=~/.vim/funclist.txt dictionary+=~/.vim/funclist.txt
set complete-=k complete +=k

搜索:
  • 设置大小写不敏感:  :set ic ,取消: :set noic
  • 临时大小写不敏感搜索:  /\csomething
分类: 技术 标签: