Important: the ^M is not the ^ character followed by an M. Control-M is a control character, you normally can't see it or type it in. vi allows you to enter control characters by typing CTRL-V CTRL-M.
This means: hold the CTRL key down, hit the V key, keep holding the CTRL key down and now hit the M key.
也就是說,因為vi裡面有一些command key剛好也是Ctrl-??所以當你真的要入這個字時,會被認為是vi控制command而輸入不進去。
vi提供一種方式來輸入這類控制字元,就是按下Ctrl-V,然後再輸入你要的控制字元。
例如,要輸入Ctrl-M時:
- 按下Ctrl不放
- 按下V
- Ctrl不要放開,再按下M
沒有留言:
張貼留言