打开终端时将加载Vim Ex模式 [英] Vim Ex mode loads when opening terminal
问题描述
我对终端机(Mac)中的Vim知之甚少,而前几天我正在复制和粘贴文本,我想我在终端机时偶然地做到了.现在,无论何时打开终端,它都会立即在Vim Ex模式下加载.我知道如何在终端中一次退出Ex模式,但是打开终端时有什么办法可以摆脱Vim的加载?
I know little about Vim in terminal(Mac) and the other day I was working copy and pasting text and i think I accidently did it when in terminal. Now whenever I open terminal it instantly loads on Vim Ex mode. I know how to quit Ex mode once in terminal but is there any way i can get rid of Vim loading when I open Terminal?
谢谢
要进一步解释我从实用程序打开terminal.app时的意思,我得到了以下
To explain further to what i mean when I open terminal.app from Utilities I get the following
返回到命令提示符的唯一方法是每次打开终端时都键入quit,但我不明白为什么Vim进程首先运行.
and the only way I get back to the command prompt is by typing quit every time I open terminal and i cant understand why the Vim process is running in the first place.
我正好在终端外,在文档中复制文本并粘贴文本,然后不小心在终端内执行了命令v粘贴,导致了这种情况.
I was just outside the terminal in a document copy and pasting text then accidentally did a command v to paste within terminal which resulted in this happening.
推荐答案
看来您不小心更新了其中一个shell启动脚本,因此它启动了vim.
It appears that you've accidentally updated one of your shell startup scripts so it launches vim.
如果默认外壳程序是csh或tcsh,请查看主目录中的.cshrc
,.tcshrc
和.login
,并查找类似vi -e
或vim -e
的命令.
If your default shell is csh or tcsh, take a look at .cshrc
, .tcshrc
, and .login
in your home directory, and look for a command like vi -e
or vim -e
.
如果您的默认shell是bash,请检查.bashrc
和.bash_profile
.
If your default shell is bash, check .bashrc
and .bash_profile
.
通过检查主目录中的哪个文件最近被修改,可以更容易地弄清哪个文件被弄乱了:
It may be easier to figure out which file you messed up by checking which file in your home directory was modified most recently:
% ls -altr $HOME | tail
-
-a
列出所有文件,包括名称以.
开头的文件. -
-l
为您提供了长长的清单,其中显示了时间戳记. -
-t
按修改时间排序. -
-r
颠倒顺序,因此较新的文件显示在最后 -a
lists all files, including files whose names start with.
.-l
gives you a long listing, showing timestamps.-t
sorts by modification time.-r
reverses the order, so newer files are shown last
这篇关于打开终端时将加载Vim Ex模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!