我刚开始学习C语言。
我的系统是我自己编译的OS X 10.10和MacVim 7.4.383,因为我需要它支持python3。
但是我发现如果MacVim.app和:open ~/Desktop/something.c
只是一个双cilck,它会告诉我something.c是一个新文件。但是我的桌面上确实有一个名为something.c的文件,我搜索了情况的原因,似乎有一些关于环境变量的内容,所以我按照指南将此代码添加到file:/// etc / launchd .conf
setenv PATH /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
并重启我的电脑,它没有改变任何东西 我的/ etc / bashrc是
if [ -z "$PS1" ]; then
return
fi
PS1='\d \A \u @ \H \w #\#: \$ '
# Make bash check its window size after a process completes
shopt -s checkwinsize
# Tell the terminal about the working directory at each prompt.
if [ "$TERM_PROGRAM" == "Apple_Terminal" ] && [ -z "$INSIDE_EMACS" ]; then
update_terminal_cwd() {
# Identify the directory using a "file:" scheme URL,
# including the host name to disambiguate local vs.
# remote connections. Percent-escape spaces.
local SEARCH=' '
local REPLACE='%20'
local PWD_URL="file://$HOSTNAME${PWD//$SEARCH/$REPLACE}"
printf '\e]7;%s\a' "$PWD_URL"
}
PROMPT_COMMAND="update_terminal_cwd; $PROMPT_COMMAND"
fi
# ===== ===== ===== =====
# Custom Setting
export CLICOLOR=1
export LSCOLORS=gxfxaxdxcxegedabagacad
export HISTSIZE=250
# Setting PATH for KDE
export KDEDIRS=$KDEDIRS:$HOME/Library/Preferences/KDE:/usr/local/kde4
export PATH=/usr/local/kde4/bin:$PATH
export DYLD_LIBRARY_PATH=/usr/local/kde4/lib:$DYLD_LIBRARY_PATH
launchctl setenv DYLD_LIBRARY_PATH /usr/local/kde4/lib:$DYLD_LIBRARY_PATH
export XDG_DATA_HOME=$HOME/Library/Preferences/KDE/share
export XDG_DATA_DIRS=/usr/local/kde4/share:/usr/local/share:/usr/share
# Setting PATH for MySQL
export PATH=$PATH:/usr/local/mysql/bin/
# Setting PATH for Node.js and NPM
export PATH=$PATH:/usr/local/bin/node
export PATH=$PATH:/usr/local/bin/npm
# Setting PATH for Python 3.4
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.4/bin:${PATH}"
export PATH
# Setting PATH for Python 2.7
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
export PATH
如果我使用这样的绝对路径
:open /Users/XXX/Desktop/something.c
会打印错误
E479:Not match
E32:No file name
那么,我该怎样做才能让MacVim像linux一样工作,谢谢。
答案 0 :(得分:0)
:open
不用于打开文件。您需要使用:edit
或:e
命令。
你可以使用:
:e /Users/XXX/Desktop/something.c
同样$PATH
对:e
命令没有任何影响。
根据vim
帮助:
1:模拟命令 模拟命令
此命令在Vi中,但Vim仅模拟它:
*:o* *:op* *:open* :[range]o[pen] Works like |:visual|: end Ex mode. {Vi: start editing in open mode} :[range]o[pen] /pattern/ As above, additionally move the cursor to the column where "pattern" matches in the cursor line.
Vim不支持开放模式,因为它并不真正有用。对于 那些“:open”将开启模式的情况Vim将离开Ex mode,允许执行相同的命令,但更新整个命令 屏幕而不是只有一行。