vim常用操作

启动

# 打开文件时跳到第92行
vi /usr/local/etc/httpd/extra/httpd-ssl.conf +92

daw – delete a word 删除光标处单词
dw – 同上,但是只删除单词中光标右侧的那一部分

caw – delete the word under the cursor and put you in insert mode 删除并进入到插入模式
cw – 同上,但是只删除单词中光标右侧的那一部分

配置sudo保存

使用 :w!! 保存readonly文件(非常方便): 执行 echo 'cmap w!! w !sudo tee % > /dev/null' >> ~/.vimrc
Continue reading "vim常用操作"