From 421c02feec0291751e51a818640e7c524b98f82e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ensar=20Saraj=C4=8Di=C4=87?= Date: Thu, 19 May 2022 09:18:35 +0200 Subject: [PATCH] Update autocommands to new nvim 0.7.0 syntax --- symlinks/config/htop/htoprc | 4 ++-- symlinks/config/nvim/init.lua | 9 ++++++++- .../config/nvim/lua/esensar/lsp/server_config.lua | 14 ++++++++------ symlinks/config/nvim/lua/esensar/lsp/servers.lua | 2 +- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/symlinks/config/htop/htoprc b/symlinks/config/htop/htoprc index ca01ab4..0661dff 100644 --- a/symlinks/config/htop/htoprc +++ b/symlinks/config/htop/htoprc @@ -3,8 +3,8 @@ fields=0 48 17 18 38 39 40 2 46 47 49 1 sort_key=46 sort_direction=1 -tree_sort_key=0 -tree_sort_direction=1 +tree_sort_key=46 +tree_sort_direction=-1 hide_kernel_threads=1 hide_userland_threads=0 shadow_other_users=0 diff --git a/symlinks/config/nvim/init.lua b/symlinks/config/nvim/init.lua index a4d72b0..0b57e00 100644 --- a/symlinks/config/nvim/init.lua +++ b/symlinks/config/nvim/init.lua @@ -38,4 +38,11 @@ vim.keymap.set("n", "c", ":ccl lcl") vim.cmd("set path+=**") -- automatically rebalance windows on vim resize -vim.cmd("autocmd VimResized * :wincmd =") +local au_id = vim.api.nvim_create_augroup("esensar_init_lua", {}) +vim.api.nvim_create_autocmd("VimResized", { + pattern = "*", + group = au_id, + callback = function() + vim.cmd("wincmd =") + end, +}) diff --git a/symlinks/config/nvim/lua/esensar/lsp/server_config.lua b/symlinks/config/nvim/lua/esensar/lsp/server_config.lua index 90f6d4d..33af17b 100644 --- a/symlinks/config/nvim/lua/esensar/lsp/server_config.lua +++ b/symlinks/config/nvim/lua/esensar/lsp/server_config.lua @@ -19,12 +19,14 @@ local function on_attach(client, bufnr) vim.keymap.set("n", "ac", vim.lsp.buf.code_action, opts) if client.resolved_capabilities.document_formatting then - vim.cmd([[ - augroup LspFormatting - autocmd! * - autocmd BufWritePre lua vim.lsp.buf.formatting_seq_sync() - augroup END - ]]) + local au_id = vim.api.nvim_create_augroup("LspFormatting", {}) + vim.api.nvim_create_autocmd("BufWritePre", { + group = au_id, + callback = function() + vim.lsp.buf.formatting_seq_sync() + end, + buffer = bufnr, + }) end end diff --git a/symlinks/config/nvim/lua/esensar/lsp/servers.lua b/symlinks/config/nvim/lua/esensar/lsp/servers.lua index 112b159..f9b7aa1 100644 --- a/symlinks/config/nvim/lua/esensar/lsp/servers.lua +++ b/symlinks/config/nvim/lua/esensar/lsp/servers.lua @@ -16,7 +16,7 @@ local configuration_overrides = { }, omnisharp = { cmd = { - vim.fn.glob("$HOME") .. "/lsp/dotnet/omnisharp/run", + vim.fn.glob("$HOME") .. "/.local/share/lsp/dotnet/omnisharp/run", "--languageserver", "--hostPID", tostring(vim.fn.getpid()),