Vim Ex mode loads when opening terminal

妖精的绣舞 提交于 2019-12-11 18:08:46

问题


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?

Thanks

Edit: To explain further to what i mean when I open terminal.app from Utilities I get the following

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.

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.


回答1:


It appears that you've accidentally updated one of your shell startup scripts so it launches vim.

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.

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 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


来源:https://stackoverflow.com/questions/25844238/vim-ex-mode-loads-when-opening-terminal

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!