Skip to content

Commit

Permalink
refactor: Move keymaps on top of extraConfigLua
Browse files Browse the repository at this point in the history
  • Loading branch information
redyf committed Feb 12, 2024
1 parent e36d208 commit f21dab8
Showing 1 changed file with 30 additions and 31 deletions.
61 changes: 30 additions & 31 deletions config/lsp/conform.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,36 @@
};
};

keymaps = [
{
mode = "n";
key = "<leader>uf";
action = ":FormatToggle<CR>";
options = {
desc = "Toggle Format";
silent = true;
};
}
{
mode = ["n" "v"];
key = "<leader>cf";
action = "<cmd>lua require('conform').format()<cr>";
options = {
silent = true;
desc = "Format Buffer";
};
}
{
mode = "v";
key = "<leader>cF";
action = "<cmd>lua vim.lsp.buf.format()<cr>";
options = {
silent = true;
desc = "Format Lines";
};
}
];

extraConfigLua = ''
local conform = require("conform")
local notify = require("notify")
Expand Down Expand Up @@ -57,36 +87,5 @@
desc = "Toggle autoformat-on-save",
bang = true,
})
'';

keymaps = [
{
mode = "n";
key = "<leader>uf";
action = ":FormatToggle<CR>";
options = {
desc = "Toggle Format";
silent = true;
};
}
{
mode = ["n" "v"];
key = "<leader>cf";
action = "<cmd>lua require('conform').format()<cr>";
options = {
silent = true;
desc = "Format Buffer";
};
}
{
mode = "v";
key = "<leader>cF";
action = "<cmd>lua vim.lsp.buf.format()<cr>";
options = {
silent = true;
desc = "Format Lines";
};
}
];
}

0 comments on commit f21dab8

Please sign in to comment.