Skip to content

Instantly share code, notes, and snippets.

@chmouel
Created April 6, 2023 11:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chmouel/8063e9ce5eeb2326d7f3557d998dd95b to your computer and use it in GitHub Desktop.
Save chmouel/8063e9ce5eeb2326d7f3557d998dd95b to your computer and use it in GitHub Desktop.
lvim.autocommands = {
{
"BufWinEnter", {
pattern = { "*.c", "*.h", "*.mk" },
callback = function()
if string.match(vim.loop.cwd(), ".*qmk/keyboards/.*") ~= "" then
vim.api.nvim_set_keymap("n", "<leader>x", "<cmd>TermExec cmd=\"../../go.sh flash %:p:h:t\"<cr>",
{ noremap = true, silent = true })
if vim.fn.expand('%:p:h:t') == "moonlander" then
require('qmk').setup({
name = 'LAYOUT_moonlander',
layout = {
'x x x x x x x _ _ _ _ _ _ x x x x x x x',
'x x x x x x x _ _ _ _ _ _ x x x x x x x',
'x x x x x x x _ _ _ _ _ _ x x x x x x x',
'x x x x x x _ _ _ _ _ _ _ _ x x x x x x',
'x x x x x _ _ x^x _ _ x^x _ _ x x x x x',
'_ _ _ _ _ _ x x x _ _ x x x _ _ _ _ _ _',
},
})
elseif vim.fn.expand('%:p:h:t') == "planck" then
require('qmk').setup({
name = 'LAYOUT_planck_grid',
layout = {
'x x x x x x x x x x x x',
'x x x x x x x x x x x x',
'x x x x x x x x x x x x',
'x x x x x x x x x x x x',
},
})
end
end
end
},
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment