Created
April 6, 2023 11:40
-
-
Save chmouel/8063e9ce5eeb2326d7f3557d998dd95b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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