vim用了三年了,现在还是在基础命令的水平上。
今天用到了个复杂的,记录下:
复制包含关键字的所有行
%g/KeyWord/normal yyGp
对于包含 KeyWord 的任何行,执行 normal mode 命令:复制此行yy、跳到文件末尾G、粘贴p
%g/KeyWord/normal yyp
对于包含 KeyWord 的任何行,执行 normal mode 命令:复制此行yy、粘贴p
复制完后替换下一行的关键字(比如通过var1增加var2经常用到)
:g/\%(^\1$\n)\@<=(.*)$/s/var1/var2/g
这个命令太复杂了,前面那堆符号啥意思回来再慢慢研究……
查了下,可以用bash的快捷键解决这个问题,并且bash快捷键适用范围是跨平台的哦
行首ctrl+A
行尾ctrl+E
记录下其他有用的
ctrl+u
: 删除光标左边所有ctrl+k
: 删除光标右边所有ctrl+xx
: 行首到当前光标替换
https://github.com/hokein/Wiki/wiki/Bash-Shell%E5%B8%B8%E7%94%A8%E5%BF%AB%E6%8D%B7%E9%94%AE
I have found that after the attack to DNS servers in the US, gitrefresh operation seems to be blocked. Got the error:
error: The requested URL returned error: 403 Forbidden while accessing https://github.com/Novarizark/project/info/refs
fatal: HTTP request failed
Then found this in stackoverflow
http://stackoverflow.com/questions/7438313/pushing-to-git-returning-error-code-403-fatal-http-request-failed
change the https method to ssh method really solved the probleme. Although, I am still confused why this problem happens…