Skip to content

Commit

Permalink
refactor: move macOS related setting to from /init.lua `client/init…
Browse files Browse the repository at this point in the history
….lua`
  • Loading branch information
ttytm committed Apr 5, 2024
1 parent f604735 commit b48f1bd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
11 changes: 11 additions & 0 deletions lua/nxvim/client/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@ nx.opts = {
second_font = false,
}

-- MacOS
if jit.os == "OSX" then
vim.g.osx = true
if vim.env.TERM_PROGRAM ~= "WezTerm" then
vim.g.eu_kbd = vim.fn
.system(
"defaults read ~/Library/Preferences/com.apple.HIToolbox.plist AppleSelectedInputSources | grep -w \"KeyboardLayout Name\" | awk '{print $4}' | tr -d ';\"'"
)
:gsub("%s+", "") == "EurKEY"
end
end
for _, client in ipairs({ "gnvim", "goneovim", "neovide", "nvui", "fvim_loaded" }) do
if vim.g[client] then vim.g.loaded_gui = client end
end
Expand Down
12 changes: 0 additions & 12 deletions lua/nxvim/init.lua
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
local lazy = require("nxvim.plugins.lazy")

-- MacOS
if jit.os == "OSX" then
vim.g.osx = true
if vim.env.TERM_PROGRAM ~= "WezTerm" then
vim.g.eu_kbd = vim.fn
.system(
"defaults read ~/Library/Preferences/com.apple.HIToolbox.plist AppleSelectedInputSources | grep -w \"KeyboardLayout Name\" | awk '{print $4}' | tr -d ';\"'"
)
:gsub("%s+", "") == "EurKEY" and true or false
end
end

vim.g.multigrid = vim.api.nvim_list_uis()[1].ext_multigrid

-- { == Modules ==> ===========================================================
Expand Down

0 comments on commit b48f1bd

Please sign in to comment.