feat: add gleam formatting and snippets
This commit is contained in:
parent
ad8ff7d016
commit
09caae2e4e
3 changed files with 131 additions and 2 deletions
|
|
@ -11,10 +11,19 @@ local formatters_by_ft = {
|
|||
sh = { "shfmt" },
|
||||
toml = { "taplo" },
|
||||
yaml = { "yamlfix" },
|
||||
gleam = { "gleam" },
|
||||
}
|
||||
|
||||
conform.setup({
|
||||
formatters_by_ft = formatters_by_ft,
|
||||
formatters = {
|
||||
gleam = {
|
||||
command = "gleam",
|
||||
args = { "format", "--stdin" },
|
||||
stdin = true,
|
||||
cwd = require("conform.util").root_file({ "gleam.toml" }),
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
vim.api.nvim_create_user_command("Format", function(opts)
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ cmp.setup({
|
|||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item({ behavior = cmp.SelectBehavior.Select })
|
||||
elseif luasnip.jumpable(1) then
|
||||
elseif luasnip.locally_jumpable(1) then
|
||||
luasnip.jump(1)
|
||||
else
|
||||
fallback()
|
||||
|
|
@ -37,7 +37,7 @@ cmp.setup({
|
|||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item({ behavior = cmp.SelectBehavior.Select })
|
||||
elseif luasnip.jumpable(-1) then
|
||||
elseif luasnip.locally_jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue