代码之家  ›  专栏  ›  技术社区  ›  Martin Delille

未能将自制公式编辑器设置为fish shell中的vim

  •  0
  • Martin Delille  · 技术社区  · 6 年前

    我有个问题 自酿啤酒 编辑: 原子 使用而不是 vim

    $ brew edit a_brew_formula
    Editing /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/a_brew_formula.rb
    Warning: Using atom because no editor was set in the environment.
    This may change in the future, so we recommend setting EDITOR,
    or HOMEBREW_EDITOR to your preferred text editor.
    

    EDITOR HOMEBREW_EDITOR 井井有条 config.fish :

    set EDITOR vim
    set HOMEBREW_EDITOR vim
    

    我检查了外壳:

    $ echo $EDITOR
    vim
    

    为什么不考虑我的编辑选择?

    1 回复  |  直到 6 年前
        1
  •  5
  •   faho    6 年前

    您尚未导出变量,因此外部进程(如自制)看不到它。

    使用 set -x ,但最好是 set -gx 还要定义变量的全局范围。

    例如。

    set -gx EDITOR vim
    

    要查看外部进程看到的内容,可以使用 env . 如果不带参数调用,它将把环境打印为var=value行。

    如果不显示editor=,您就知道尚未导出$editor。