diff options
author | Adam <adam.moloney.stuck@gmail.com> | 2022-03-19 15:54:21 +0100 |
---|---|---|
committer | adamstuck <adam.moloney.stuck@gmail.com> | 2022-03-19 23:33:10 +0100 |
commit | 689e513c5d84627efb7c65565c1787d3f5d601f6 (patch) | |
tree | af23846ca79ee2265cea31295675280933c18243 | |
parent | ee2a78dbf59e166eb96a4799d194fd43f98da90e (diff) |
nvim: smarter use of autocmd
-rw-r--r-- | .config/nvim/lua/plugins.lua | 16 | ||||
-rw-r--r-- | .config/nvim/lua/setup/nvim-lsp-installer.lua | 3 |
2 files changed, 11 insertions, 8 deletions
diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua index da232d4..ffb40d4 100644 --- a/.config/nvim/lua/plugins.lua +++ b/.config/nvim/lua/plugins.lua @@ -3,24 +3,24 @@ local packer = require("packer") local plugins = { { "nathom/filetype.nvim" }, - { + { "nvim-lua/plenary.nvim", opt = true, }, { "lewis6991/impatient.nvim", - config = function() - require("impatient") + config = function() + require("impatient") end, }, - { + { "wbthomason/packer.nvim", event = "VimEnter", }, - { + { "adast9/onedark.nvim", after = "packer.nvim", config = function() @@ -69,7 +69,7 @@ local plugins = { -- lsp stuff - { + { "neovim/nvim-lspconfig", event = { "BufRead" , "BufNewFile" }, }, @@ -132,7 +132,7 @@ local plugins = { end, }, - { + { "tpope/vim-surround", event = { "BufRead" , "BufNewFile" }, }, @@ -145,7 +145,7 @@ local plugins = { end, }, - { + { "BurntSushi/ripgrep", opt = true, }, diff --git a/.config/nvim/lua/setup/nvim-lsp-installer.lua b/.config/nvim/lua/setup/nvim-lsp-installer.lua index de086f0..a4322ba 100644 --- a/.config/nvim/lua/setup/nvim-lsp-installer.lua +++ b/.config/nvim/lua/setup/nvim-lsp-installer.lua @@ -6,7 +6,10 @@ lsp_installer.on_server_ready(function(server) local opts = { on_attach = function() vim.cmd('doautocmd User lspAttached') + vim.cmd('augroup Format') + vim.cmd('autocmd! * <buffer>') vim.cmd('autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting_sync()') + vim.cmd('augroup END') end, } |