I have tried adding this line to the init.lua but it doesn't work and I don't understand the syntax:
local g:terminal_emulator="powershell"
I get an error upon running the source
command: it says unexpected symbol near :
In Lua the syntax is slightly different.
I would do:
vim.g.terminal_emulator='powershell'
Or:
vim.api.nvim_set_var('terminal_emulator', 'powershell')
shell
option is used to create the terminal in which the :!
command run. See the other answer.
Commented
Feb 20, 2023 at 14:39
If you want to configure the :terminal
command you have to change the 'shell'
setting instead.
In Lua you can do with
vim.opt.shell = 'powershell.exe'