简体   繁体   English

如何从vim设置iterm2徽章?

[英]How to set iterm2 Badge from vim?

I want to call the function iterm2_set_user_var VARIABE VALUE from vim/neovim using call system() . 我想使用call system()从vim / neovim调用函数iterm2_set_user_var VARIABE VALUE However, I get the following. 但是,我得到以下信息。

zsh:1: command not found: iterm2_set_user_var shell returned 127

This is already done in node.js: How to exec script to set iterm2 Badge from nodejs? 这已经在node.js中完成: 如何执行脚本以从nodejs设置iterm2 Badge?

I'm guessing you've defined iterm2_set_user_var as a shell function in your zsh config somewhere. 我猜您已经在zsh配置中的某个位置将iterm2_set_user_var定义为Shell函数。 Vim doesn't invoke a login shell with the system function. Vim不会使用system功能调用登录shell。 I think you have two options: 我认为您有两种选择:

  1. Change shellcmdflag to force a login shell by adding l to the flags currently there. 更改shellcmdflag可以通过在当前的标志中添加l来强制登录shell。 This would affect all :! 这将影响所有:! commands in vim as well. 在vim中也是如此。
  2. Define iterm2_set_user_var as an executable somewhere in your $PATH . iterm2_set_user_var定义为$PATH某个位置的可执行文件。

Either should work fine. 两者都应该工作正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM