diff options
| author | JP Appel <jeanpierre.appel01@gmail.com> | 2024-08-16 20:42:08 -0400 |
|---|---|---|
| committer | JP Appel <jeanpierre.appel01@gmail.com> | 2024-08-16 20:42:08 -0400 |
| commit | 14e2b1ad79e00dd2c3cfc3d0acec3cd2aacf24e4 (patch) | |
| tree | c31f51e025e91c78b503ba9801e0a05a3db9a049 /nvim/lua | |
| parent | e184d7cee358abc277a51f040cacf236f1eaceab (diff) | |
changed lsp format keymap
Diffstat (limited to 'nvim/lua')
| -rw-r--r-- | nvim/lua/keymap.lua | 13 | ||||
| -rw-r--r-- | nvim/lua/plugins/lsp.lua | 8 |
2 files changed, 8 insertions, 13 deletions
diff --git a/nvim/lua/keymap.lua b/nvim/lua/keymap.lua index d5751a2..b816776 100644 --- a/nvim/lua/keymap.lua +++ b/nvim/lua/keymap.lua @@ -16,17 +16,4 @@ vim.keymap.set('n',"<Leader>k", function() vim.cmd("make") end) vim.keymap.set('t', "<ESC><ESC>", "<c-\\><c-n>") -vim.api.nvim_create_autocmd('LspAttach', { - buffer = 0, - callback = function(args) - local opts = { - buffer = 0, - silent = true - } - vim.keymap.set('n', "==", function () vim.lsp.buf.format() end, opts) - -- vim.keymap.set('v', "=", function () vim.lsp.buf.format() end, opts) - end, - desc = "Change `==` to `vim.lsp.buf.format()` when available" -}) - return M diff --git a/nvim/lua/plugins/lsp.lua b/nvim/lua/plugins/lsp.lua index 0089033..217802a 100644 --- a/nvim/lua/plugins/lsp.lua +++ b/nvim/lua/plugins/lsp.lua @@ -23,6 +23,14 @@ local lspconfig = { desc = "Rename symbol" }, { + '<C-f>', + function() + vim.lsp.buf.format() + end, + mode = {'n', 'v'}, + desc = "Format code" + }, + { '<leader>la', function () vim.lsp.buf.code_action() |
