From 07530fb3f828be76c4b4a9e876f61c22c9a3c560 Mon Sep 17 00:00:00 2001 From: Daniel Lynn Date: Thu, 28 Oct 2021 13:05:21 -0500 Subject: [PATCH] Update autopairs, add stylelint LSP --- nvim/autopairs.vimrc | 28 ++++++++++++++++++++++++++++ nvim/lspconfig.vimrc | 2 +- nvim/plugins.vimrc | 2 +- vimrc | 5 +++++ 4 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 nvim/autopairs.vimrc diff --git a/nvim/autopairs.vimrc b/nvim/autopairs.vimrc new file mode 100644 index 0000000..bac3d5c --- /dev/null +++ b/nvim/autopairs.vimrc @@ -0,0 +1,28 @@ +lua < %% is only inside comment or string + npairs.add_rules({ + Rule("%", "%", "lua") + :with_pair(ts_conds.is_ts_node({'string','comment'})), + Rule("$", "$", "lua") + :with_pair(ts_conds.is_not_ts_node({'function'})) + }) +EOF diff --git a/nvim/lspconfig.vimrc b/nvim/lspconfig.vimrc index c18b14b..c1b0f7f 100644 --- a/nvim/lspconfig.vimrc +++ b/nvim/lspconfig.vimrc @@ -36,7 +36,7 @@ end -- Use a loop to conveniently call 'setup' on multiple servers and -- map buffer local keybindings when the language server attaches -local servers = { 'solargraph', 'rust_analyzer', 'gopls', 'tsserver' } +local servers = { 'solargraph', 'rust_analyzer', 'gopls', 'tsserver', 'stylelint_lsp' } for _, lsp in ipairs(servers) do nvim_lsp[lsp].setup { on_attach = on_attach, diff --git a/nvim/plugins.vimrc b/nvim/plugins.vimrc index 9423a11..9f2426f 100644 --- a/nvim/plugins.vimrc +++ b/nvim/plugins.vimrc @@ -1,7 +1,6 @@ " Assorted plugins Plug 'cespare/vim-toml', { 'for': 'toml' } Plug 'chrisbra/unicode.vim' -Plug 'jiangmiao/auto-pairs' Plug 'leafgarland/typescript-vim', { 'for': 'typescript' } Plug 'leafoftree/vim-svelte-plugin', { 'for': 'svelte' } Plug 'lukas-reineke/indent-blankline.nvim' @@ -17,6 +16,7 @@ Plug 'tpope/vim-repeat' Plug 'tpope/vim-surround' Plug 'vim-test/vim-test' Plug 'wakatime/vim-wakatime' +Plug 'windwp/nvim-autopairs' " LSP and autocomplete Plug 'neovim/nvim-lspconfig' | diff --git a/vimrc b/vimrc index 699d693..6cce494 100644 --- a/vimrc +++ b/vimrc @@ -73,6 +73,11 @@ if filereadable(expand("~/.config/nvim/nvim-cmp.vimrc")) source ~/.config/nvim/nvim-cmp.vimrc endif +" Autopairs +if filereadable(expand("~/.config/nvim/autopairs.vimrc")) + source ~/.config/nvim/autopairs.vimrc +endif + " LSP if filereadable(expand("~/.config/nvim/lspconfig.vimrc")) source ~/.config/nvim/lspconfig.vimrc