6

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 :

2 Answers 2

3

In Lua the syntax is slightly different.

I would do:

vim.g.terminal_emulator='powershell'

Or:

vim.api.nvim_set_var('terminal_emulator', 'powershell')
3
  • Now good luck to me finding out what is the exacting thing I should write in place of 'powershell' :( Feb 18, 2023 at 15:42
  • Is this for bang commands? Because it doesn't seem to work. I always get 'an unknonwn element was received' error Feb 20, 2023 at 14:16
  • 1
    The shell option is used to create the terminal in which the :! command run. See the other answer. Feb 20, 2023 at 14:39
1

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'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.