开发者

How do you reset defaults for VI?

I am currently using VI on a remote host and for some reason a number of the commands are mapped incorrectly. For example when pressing lower case x, instead of it deleting the character under the cursor it actually deletes the character two spaces before the cursor, so if the following text is entered BOTY and I have the cursor over the T instead of removing T the O will be removed making the word BTY. Also when inserting text, instead of VI inserting the character under the cursor it will enter the the character two spaces before the cursor so if I have the following text HT and I want to insert ML instead of writing HTML VI will write HMLT.

Does anyone know what would be causing this and how I can fix it or how to reset all settings in VI to default because this is probably not the o开发者_C百科nly items mapped incorrectly?

Thanks


If you just want to reset all things to default, it's very simple, just :set all&


In your home, look at a file called .exrc (.vimrc for vim). It contains vi configuration, if you clear it (make a backup before), vi will return to default configuration.


This looks like you are using the classic "VI" instead of "VIM (VI IMproved)". If you are root on the machine try installing VIM. I experience this behaviour on Ubuntu every time after a fresh os install.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜