I've got the problem that the neovim language is set to German for some reason even though I only use a German keyboard layout (see this question). Unfortunately I am using lua for configuring neovim (the linked question provides an answer for init.vim
configs) and even though I tried some things, I cannot figure out how to convert language en_US
to valid lua code.
-
Welcome to Vi and Vim!– filbranden ♦Jan 7, 2022 at 17:52
2 Answers
Simply use vim.api.nvim_exec()
(or vim.cmd()
if your NeoVim version still doesn't have it) to run Vimscript commands from Lua.
vim.api.nvim_exec('language en_US')
That should do it.
Recent versions of Neovim require an additional boolean parameter to set the language, so, this would be the proper command in init.lua
:
vim.api.nvim_exec ('language en_US', true)