# neovim api 执行系统命令 0.10 版本之后 ```lua vim.system ``` 0.10.x 版本之前 ```lua vim.api.nvim_exec2 ``` 查看 table ```lua print(vim.inspect(table)) ``` ```lua -- execute system command local has_cmd = function(cmd) res = vim.system({'which', cmd}, { text = true}):wait() -- ; print(res.code) -- no error, everything is ok if res.code == 0 then return true end -- error return false end ```