我打开终端时,.bash_profile#文件正在vim中打开

时间:2019-07-09 20:35:19

标签: macos vim terminal default macos-high-sierra

每当我打开终端时,〜/ .bash_profile#文件都会在VIM中打开。

  1. 当我单击2 + ctrl + g时,我会看到以下文件详细信息
    buf 1:“〜/ .bash_profile#”第1行,占6 --16%-第1行(第1行,共8个)

  2. 从我要去的Vim Ex mode loads when opening terminal试过

Roys-Air:台式机用户名$ ls -altr $ HOME |尾巴
-rw ------- 1个用户名人员12288 Jul 10 01:26 .swo
-rw-r--r-- 1个用户名人员12288 Jul 10 01:27 .bash_profile#.swp
-rw-r--r-- 1个用户名staff 0 Jul 10 01:29 .bashrc
drwxr-xr-x 4个用户名人员128 Jul 10 01:38 private
-rw-r--r-@@ 1个用户名人员14340 Jul 10 01:38 .DS_Store
-rw ------- 1个用户名员工9986 Jul 10 01:40 .bash_history
-rw-r--r-- 1个用户名人员5 Jul 10 01:40 .bash_profile# -rw ------- 1个用户名人员8402 Jul 10 01:40 .viminfo
drwxr-xr-x + 52个用户名人员1664 Jul 10 01:40。
drwx ------ 81个用户名人员2592 Jul 10 01:40 .bash_sessions

我希望终端应该像Roys-Air一样打开:〜UserName $

.bash_profile包含以下内容

# Setting PATH for Python 3.7
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.7/bin:${PATH}"
export PATH
export MONGO_PATH=/usr/local/mongodb
export PATH=$PATH:$MONGO_PATH/bin
##
# Your previous /Users/rajnikantroy/.bash_profile file was backed up as /Users/rajnikantroy/.bash_profile.macports-saved_2018-12-07_at_02:06:08
##

# MacPorts Installer addition on 2018-12-07_at_02:06:08: adding an appropriate PATH variable for use with MacPorts.
export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
# Finished adapting your PATH environment variable for use with MacPorts.


# Setting PATH for Python 3.7
vim .bash_profile# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.7/bin:${PATH}"
export PATH

export ANT_HOME=/Users/rajnikantroy/Documents/ant/apache-ant-1.10.6/
export PATH=$PATH:$ANT_HOME/bin

1 个答案:

答案 0 :(得分:1)

编辑bash个人资料并更正以vim .bash_profile开头的行。在vim中:

:/vim .bash_profile/normal! 0dt#