diff --git a/lua/keybinds.lua b/lua/keybinds.lua index bd7c23f..bab08f9 100644 --- a/lua/keybinds.lua +++ b/lua/keybinds.lua @@ -18,7 +18,7 @@ vim.g.maplocalleader = ";" -- Command Mode = 'c', -- Normal mode -- --- Basic functions +-- Basic commands bind("n", "w", ":w", opts) bind("n", "e", ":q", opts) bind("n", "q", ":qa", opts) @@ -52,22 +52,3 @@ bind("n", "", ":resize -2", opts) bind("n", "", ":resize +2", opts) bind("n", "", ":vertical resize -2", opts) bind("n", "", ":vertical resize +2", opts) - --- Navigate tabs -bind("n", "", ":tabp", opts) -bind("n", "", ":tabn", opts) - --- Visual -- --- Stay in indent mode -bind("v", "<", "", ">gv", opts) - --- Move text up and down -bind("v", "", ":m .+1==", opts) -bind("v", "", ":m .-2==", opts) -bind("v", "p", '"_dP', opts) - --- Visual Block -- --- Move text up and down -bind("x", "J", ":move '>+1gv-gv", opts) -bind("x", "K", ":move '<-2gv-gv", opts) diff --git a/lua/lsp-config.lua b/lua/lsp-config.lua index f4922e9..f8119f6 100644 --- a/lua/lsp-config.lua +++ b/lua/lsp-config.lua @@ -28,7 +28,9 @@ local capabilities = cmp_nvim_lsp.default_capabilities() mason_lspconfig.setup_handlers({ function(server) - lspconfig[server].setup({ capabilities = capabilities }) + lspconfig[server].setup({ + capabilities = capabilities, + }) lspconfig.lua_ls.setup({ capabilities = capabilities, settings = { diff --git a/lua/lsp-format.lua b/lua/lsp-format.lua index f2824bb..ea47e5d 100644 --- a/lua/lsp-format.lua +++ b/lua/lsp-format.lua @@ -3,16 +3,16 @@ if not ok then return end -local formatting = null_ls.builtins.formatting - local augroup = vim.api.nvim_create_augroup("LspFormatting", {}) -null_ls.setup({ +require("null-ls").setup({ sources = { - formatting.rustfmt, - formatting.stylua, - formatting.black, - formatting.prettier, - }, -- you can reuse a shared lspconfig on_attach callback here + null_ls.builtins.formatting.rustfmt, + null_ls.builtins.formatting.stylua, + null_ls.builtins.formatting.black, + null_ls.builtins.formatting.prettier, + null_ls.builtins.formatting.clang_format, + }, + -- you can reuse a shared lspconfig on_attach callback here on_attach = function(client, bufnr) if client.supports_method("textDocument/formatting") then vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr }) @@ -20,8 +20,12 @@ null_ls.setup({ group = augroup, buffer = bufnr, callback = function() - -- on 0.8, you should use vim.lsp.buf.format({ bufnr = bufnr }) instead - vim.lsp.buf.format({ bufnr = bufnr }) + vim.lsp.buf.format({ + bufnr = bufnr, + filter = function() + return client.name == "null-ls" + end, + }) end, }) end diff --git a/lua/plugins.lua b/lua/plugins.lua index 9fa3046..df7da06 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -70,7 +70,7 @@ packer.startup(function(use) run = function() local ntsi_ok, nvim_treesitter_install = pcall(require, "nvim-treesitter.install") if ntsi_ok then - local ts_update = nvim_treesitter_install.install.update({ with_sync = true }) + local ts_update = nvim_treesitter_install.update({ with_sync = true }) ts_update() end end,