From f21dab8d6f4de61ad6de28626d68b8303923b2b5 Mon Sep 17 00:00:00 2001 From: Redyf Date: Sun, 11 Feb 2024 23:40:23 -0300 Subject: [PATCH] refactor: Move keymaps on top of extraConfigLua --- config/lsp/conform.nix | 61 +++++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 31 deletions(-) diff --git a/config/lsp/conform.nix b/config/lsp/conform.nix index f2546981..7b356c5e 100644 --- a/config/lsp/conform.nix +++ b/config/lsp/conform.nix @@ -18,6 +18,36 @@ }; }; + keymaps = [ + { + mode = "n"; + key = "uf"; + action = ":FormatToggle"; + options = { + desc = "Toggle Format"; + silent = true; + }; + } + { + mode = ["n" "v"]; + key = "cf"; + action = "lua require('conform').format()"; + options = { + silent = true; + desc = "Format Buffer"; + }; + } + { + mode = "v"; + key = "cF"; + action = "lua vim.lsp.buf.format()"; + options = { + silent = true; + desc = "Format Lines"; + }; + } + ]; + extraConfigLua = '' local conform = require("conform") local notify = require("notify") @@ -57,36 +87,5 @@ desc = "Toggle autoformat-on-save", bang = true, }) - ''; - - keymaps = [ - { - mode = "n"; - key = "uf"; - action = ":FormatToggle"; - options = { - desc = "Toggle Format"; - silent = true; - }; - } - { - mode = ["n" "v"]; - key = "cf"; - action = "lua require('conform').format()"; - options = { - silent = true; - desc = "Format Buffer"; - }; - } - { - mode = "v"; - key = "cF"; - action = "lua vim.lsp.buf.format()"; - options = { - silent = true; - desc = "Format Lines"; - }; - } - ]; }