终端vim没有加载.zshrc

Mat*_*yan 14 vim zsh zshrc

我的终端vim配置没有加载〜/ .zshrc.Zsh是环境登录shell.这种情况的正确配置是什么?

以下是我已采取并已删除的一些措施:

set shell=zsh
(使用zsh作为shell但不提供rc)

set shellcmdflag=-ci
(所有输出暂停)

cat ~/.zshenv
$ source ~/.zshrc
(打开vim时出现很多错误)

rom*_*inl 8

从手册:

Commands  are  first  read from /etc/zshenv; this cannot be overridden.

[...]

Commands are then read from $ZDOTDIR/.zshenv. If the shell is a
login shell, commands are read from /etc/zprofile and then 
$ZDOTDIR/.zprofile. Then, if the shell is interactive, 
commands are read from /etc/zshrc and then $ZDOTDIR/.zshrc. Finally,
if the shell is a login shell, /etc/zlogin and $ZDOTDIR/.zlogin are
read.
Run Code Online (Sandbox Code Playgroud)

据我所知,

set shell=zsh\ -i
Run Code Online (Sandbox Code Playgroud)

应该管用.

  • 使用`ci`或`c`标志,命令完成类似`21195暂停(tty输出)vim`,我留在zsh shell提示符下.然后我必须输入`fg`才能得到预期的结果. (8认同)
  • 不知道为什么这是接受的答案,它不起作用! (6认同)
  • 这是`set shellcmdflag = -ci`中的第二个命令.当我尝试时,所有输出都被暂停. (3认同)

Yul*_*lun 8

接受的答案不能按预期工作.实际的解决方案应该是将别名和其他~/.zshrc内容放入~/.zshenv.唯一需要的~/.vimrcset shell=zsh没有任何标志.

  • 有点流畅.添加一个符号链接`ln -s~/.zshrc~/.zshenv` (4认同)